Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] make it easier to understand how to use the self hosted environment API #10

Closed
nati-levi opened this issue Sep 8, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@nati-levi
Copy link

Tried to used the API from postman.

Searched for the base URL in the settings, with no luck. Eventually, i inferred from the code that it is http:https://localhost/v1/.

Also, no place stated that the key should be sent as header X-Appwrite-Key.

@eldadfux
Copy link
Member

eldadfux commented Sep 8, 2019

It is a good idea to have the UI indicating the API base endpoint. Maybe we can add it to the project settings and to the new platform dialog window.

The X-Appwrite-Key header is used to pass the secret API key and should only be used when integrating with a server side language. It can be a MAJOR security issue when being used directly in your client code and this is why it's not being mentioned anywhere.

@eldadfux eldadfux added the enhancement New feature or request label Sep 8, 2019
@nati-levi
Copy link
Author

nati-levi commented Sep 8, 2019 via email

@eldadfux
Copy link
Member

eldadfux commented Sep 9, 2019

Well, its really depends on what you are trying to achieve with postman.

If you are just trying out the API the best way is probably by treating it as a backend and just passing an API key.

If you want to mock real user behaviour, you need to use the entire register-login flow to obtain a user session cookie, and then add it to all other requests.

This might be easier if in some point we will add Appwrite as an OAuth provider on its own, and then auth process will be more straight forward from 3rd parties like postman.

@eldadfux eldadfux self-assigned this Sep 9, 2019
@eldadfux
Copy link
Member

image

Added this just near the project ID to make life a bit easier.

Committed to master branch, will be released in next version.
20234f6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants