1

I have appwrite instance deployed locally. I have created a function and deployed successfully. How can I call that function from postman through HTTP request?

My local instance URL: http://localhost/v1

Function path as per appwrite.json is functions/greetings

I am passing the required projectId and API-KEY. I am using the below URL to call the function:

http://localhost/v1/functions/greetings

But, this is not working. Giving the below error:

{
    "message": "Function with the requested ID could not be found.",
    "code": 404,
    "type": "function_not_found",
    "version": "1.2.0"
}

But, the function is available in the deployments.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
Deva
  • 11
  • 2
  • According to the [documentation](https://appwrite.io/docs/client/functions?sdk=web-default#functionsCreateExecution), HTTP method should be `POST` and the URL should be `http://localhost/v1/functions/greetings/executions`. – aadel Jan 03 '23 at 18:14

1 Answers1

0

To execute the function, you'll need to make a POST request to http://localhost/v1/functions/{functionId}/executions. The folder path is the function name and may not actually be the function ID.

FYI, I recommend using HTTPS instead of HTTP in order to avoid any HTTPS redirect problems.

For reference:

Steven Nguyen
  • 452
  • 4
  • 4