-
Notifications
You must be signed in to change notification settings - Fork 2
Swagger UI Instructions
Kshitij09 edited this page Nov 5, 2021
·
2 revisions
Swagger UI will provide you with a list of endpoints supported by the API Server.
- You can expand any endpoint section and click on "Try it out" to perform the API call.
- APIs marked with a lock symbol is authorized using bearer token thus you may first need to perform a Login request (
/api/v2/auth/login
) to use such APIs
- Expand
/api/v2/auth/login
section - provide valid credentials to make a successful login request. Server initializes following user accounts with the initialization service. You can find the account details in the users.json file.
email password role [email protected] 1234 User [email protected] 0000 Admin [email protected] 9876 Vendor - Checkout response body, if the login was successful, you'll receive a JSON object having a key 'access_token'
- Copy the access_token value (must be a pretty long string)
- Click on the lock icon of any authorized API section or an "Authorize" button at the top right corner.
- Paste your access token in the 'value' Input and click " Authorize"
- You've successfully configured the required Authorization Header! You may now be able to use the authorized APIs.
- Products API (
/api/v2/products
) supports "Full Text Search" for names, try searching something that won't work with LIKE queries, for instance, search "potatoes" and you'll find out what that feature means. - Try getting all users (
/api/v2/users
) and soon you'll get to know you can only succeed with an admin account. - Try reading user details of some a user other than the one you logged-in with, turns out, you can't do that. Same goes for reading other user's orders.