From e60f2370c3c0c356e1a0bf90673151768f6051f1 Mon Sep 17 00:00:00 2001 From: uzarnom Date: Sat, 1 Nov 2025 21:34:14 +0800 Subject: [PATCH] Update +page.markdoc The curl command's body now requires the following: -d '{"body":"this is json data"}' -- new -d '{"data":"this is json data"}' -- previous Which translates to the following in javascript fetch. (This took me 2 days to figure out, I am such an idiot) fetch('https://64d4d22db370ae41a32e.appwrite.global', { method: 'POST', headers: { 'X-Custom-Header': '123', 'x-appwrite-user-jwt': '', 'Content-Type': 'application/json' }, body: JSON.stringify({ 'body': 'this is json data' }) }); --- src/routes/docs/products/functions/execute/+page.markdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/docs/products/functions/execute/+page.markdoc b/src/routes/docs/products/functions/execute/+page.markdoc index b1042488b7..151038c620 100644 --- a/src/routes/docs/products/functions/execute/+page.markdoc +++ b/src/routes/docs/products/functions/execute/+page.markdoc @@ -29,7 +29,7 @@ curl -X POST https://64d4d22db370ae41a32e.appwrite.global \ -H "X-Custom-Header: 123" \ -H "x-appwrite-user-jwt: " \ -H "Content-Type: application/json" \ --d '{"data":"this is json data"}' +-d '{"body":"this is json data"}' ``` Notice how a `x-appwrite-user-jwt` header is passed in the request, you will use this to authenticate users. @@ -969,4 +969,4 @@ let execution = try await functions.createExecution( Appwrite Functions can be executed using Client or Server SDKs. Client SDKs must be authenticated with an account that has been granted execution [permissions](/docs/advanced/platform/permissions) on the function's settings page. Server SDKs require an API key with the correct scopes. -If your function has a generated or custom domain, executions are not authenticated. Anyone visiting the configured domains will be considered a guest, so make sure to give `Any` execute permission in order for domain executions to work. If you need to enforce permissions for functions with a domain, use authentication methods like JWT. \ No newline at end of file +If your function has a generated or custom domain, executions are not authenticated. Anyone visiting the configured domains will be considered a guest, so make sure to give `Any` execute permission in order for domain executions to work. If you need to enforce permissions for functions with a domain, use authentication methods like JWT.