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
- Function's Static IP
Is it possible to have static. IP Address instead of Dynamic IP for getting the IP Address whitelist
- How to use dart workspaces to deploy a f...
Hello, I'm developing a Flutter application and I would like to leverage dart pub workspaces to deploy a function with a dart runtime as advertised here : http...
- [SOLVED] Unable to push function from AP...
When trying to push functions from Gitlab CI (with an API KEY and using the CLI), i saw that i was unable to push functions. ``` $ appwrite client --endpoint $...