Readme.io has a nice feature to try an API on the right panel. Here we take the example of Smart Home APIs to show you how to try our APIs in readme.io:
- Most of APIs require Bear token for authentication
- You need to first try Agent login API to get a token
- When you try other API, copy this token into Bear area on the top of right panel
Get Bear authentication token
The following are a list of steps to get Bear token:
-
Select Agent → Login API from left menu.
-
In middle section, Under BODY PARAMS:
-
You will get grant_type is having default value as ‘password’.
-
Type to fill up value for username.
-
Type to fill up value for password.
-
-
After doing above mention things, in Right section, you will see Request Example is formed as:
![try.png 461](https://files.readme.io/9d117df-try.png)
-
Now click on ‘Try It!’ button.
-
You will get the result of request in Response Example as:
![try2.png 452](https://files.readme.io/58e81e6-try2.png)
- Copy the “access_token” value from Response to use it for other APIs example.
Example: Try List of Properties API
Here we show an example how to use the token you obtained from Auth Login API. The following are steps:
-
Select Properties → List of Properties API from left menu.
-
Put copied access_token value in Authentication section for Bearer token under right menu.
![tr4.png 458](https://files.readme.io/deacf88-tr4.png)
- Now click on ‘Try It!’ button. Below is what it looks like in Reademe right panel:
![try10.png 445](https://files.readme.io/959b97d-try10.png)
- You will get the result of request in Response Example as shown below
![try1.png 448](https://files.readme.io/e44e22a-try1.png)
![try2.png 1496](https://files.readme.io/5363d70-try2.png)