Back

[CLOSED] Host problem while making POST request

  • 0
  • Users
  • Accounts
  • General
Siddhesh
23 May, 2023, 17:39

I'm using Rest API for creating users using jwt. The problem is when i add the host as "cloud.appwrite.io" as given in the API endpoint, it is not working (status code = 401). The code is in Golang.

TL;DR
The user is having a problem making a POST request using the Appwrite API. The issue is that the cookies need to be set for the user in order to generate a user JWT. They should first login the user using one of the create methods in the Appwrite API documentation. If they want to generate a JWT without requiring the user to be logged in, it's a requested feature that is not currently available. The user is using Golang code and when they add the host as "cloud.appwrite.io," it is not working and they are getting a status code of 401 (Unauthorized).
Binyamin
23 May, 2023, 17:44

To be able to generate user JWT, the user have to be logged in. That mean you need to have the cookies set for that user.

If you run tests in postman for example then the user credentials & cookies will be saved between requests. that mean you'll need to first login the user using any of the create methods here https://appwrite.io/docs/client/account

If you're talking about the option to be able to generate JWT without requiring the user to be logged in then it's a requested feature in Appwrite issues list

Binyamin
23 May, 2023, 17:45
joeyouss
25 May, 2023, 18:37

[CLOSED] Host problem while making POST request

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