I created function called invoice URL https://app.getrestt.com/v1/functions/invoice/executions?id=test-76f948fe83c43422561fe096c0674a1bd3ff0702cdfcf2444293ab31937a9c4d, i make it permission to any. and I deploye the code like this , when i try to access it in public browser, i get this error {"message":"No Appwrite project was specified. Please specify your project ID when initializing your Appwrite SDK.","code":401,"type":"general_access_forbidden","version":"1.7.4"} how can i manage this ? its possible to use function for this purpose ?
Can you try adding your project ID at the end of the URL? Like this: https://app.getrestt.com/v1/functions/invoice/executions
?id=test-76f948fe83c43422561fe096c0674a1bd3ff0702cdfcf2444293ab31937a9c4d
&project=<your_projectID>
Thanks for your response {"message":"User (role: guests) missing scope (execution.read)","code":401,"type":"general_unauthorized_scope","version":"1.7.4"} but i used User : any i checked all permission inside the function , but still same
You are using custom domain right?
And are you sure this domain you're using is same as the one in Domains tab ?
Also, there are two more issues I found:
- You haven't included
Queryin imports but you're using it in your code. It should be like this:import { Client, Databases, Query } from "node-appwrite"; - Also, you are returning entire object in
invoice. It should be something like this to extract only the required part from the response:
const response = await databases.listDocuments(
process.env.DATABASE_ID,
process.env.INVOICE_COLLECTION_ID,
[
Query.equal('irn', invoiceId)
]
);
const invoice = result.documents[0];
Recommended threads
- Appwrite-injected variables are not avai...
I am using rust-1.83 as a runtime and try to access APPWRITE_FUNCTION_API_ENDPOINT or APPWRITE_FUNCTION_API_KEY during runtime. Both are not set during my execu...
- Functions in cloud console not works
please advise as all of my runing functions on Appwrite console was working before , but now it give this error [Invalid `headers` param: Value must be a valid...
- [SOLVED] Production down - createExecuti...
Hey, Since 1.9.6 rollout in fra (~17:00 UTC, 14 Aug), POST /v1/functions/{functionId}/executions returns a 400 whenever the body includes an empty headers ob...