My goal is to generate a JWT via a REST endpoint. To the best of my knowlege, in order to accomplish this I am to send a POST request to the following endpoint, /v1/account/jwt
along with the following headers: X-Appwrite-Project
, X-Appwrite-Key
and Content-Type
. Following these instructions here: https://appwrite.io/docs/client/account?sdk=web-default#accountCreateJWT
My assumption is that I would also need to send along my email and password in the request body.
Any chance I am missing something here?
Here is the most common response I am getting:
{
"message": "app.64abac5981e--------a@service.---.190.---.131 (role: applications) missing scope (account)",
"code": 401,
"type": "general_unauthorized_scope",
"version": "1.3.7"
}
I have been able to accomplish this from the client side Via the WebSDK but I was hoping to have an endpoint I can test with in production without needing a client interface.
You're right, you need a session before you can call the create JWT endpoint.
Btw to see how to make a rest API call, you can select REST for the client dropdown
also, all our sdks use the rest APIs so you can also look at the source code for the sdks to see what it's doing
Ah good call. I'll see if I can find what I need in the source code, thanks Steven 🙂
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...