Back

[SOLVED] Executing a function with API

  • 0
  • Functions
my_variable
16 May, 2023, 10:34

Error : {"message":"Function with the requested ID could not be found.","code":404,"type":"function_not_found","version":"0.10.15"} Function ID is correct Executing log showing this "Environment variables are not set. Function cannot use Appwrite SDK."

TL;DR
Solution: The issue was resolved by passing the "project" parameter in the payload object. The corrected payload should look like this: ```javascript payload = { "project": "6462fc2bb1482c6cbcbb", "data": '{}' } ``` Additionally, the error message "Function with the requested ID could not be found" was resolved by ensuring that the function ID was correct. The log indicated that the environment variables were not set, so the function was unable to use the Appwrite SDK. This may need to be addressed by setting the appropriate environment variables.
Binyamin
16 May, 2023, 10:55

You'll need to send the project either as a header

Binyamin
16 May, 2023, 10:55

Or within the payload but name it just project

TypeScript
  payload = {
    "project": "6462fc2bb1482c6cbcbb",
    "data": '{}'
  }
my_variable
16 May, 2023, 14:11

thanks for your help now its working

joeyouss
16 May, 2023, 16:50

[SOLVED] Executing a function with API

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more