First steps
Head over to the demo environment and login with the admin user credentials provided. Then, on the same browser tab, open https://api.demo.factorial.dev/oauth/applications
Create your credentials
Remember to place your redirect URI
Then, on the same browser tab open https://api.demo.factorial.dev/oauth/authorize?client_id=CLIENT_ID&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code
to generate an Oauth2 code. Don't forget to replace CLIENT_ID
with the Oauth Id provisioned. This will take you to a page where you authorise the Oauth2 protocol.
Once you have authorized the application, you will have all your data available
Data available
Now you are ready to create your token. You can follow these steps in the Create an access token section (remember to change the URL to https://api.demo.factorial.dev/)
Take note of the code
generated.
The next step is creating a user token, this can be done with a simple curl request.
curl -X POST 'https://api.demo.factorial.dev/oauth/token' -d 'client_id=CLIENT_ID&client_secret=CLIENT_SECRET&code=CODE&grant_type=authorization_code&redirect_uri=urn:ietf:wg:oauth:2.0:oob'
Don't forget to replace CLIENT_ID with provisioned OAuth2 Id, CLIENT_SECRET with provisioned OAuth2 secret and the generated CODE!
Finally retrieve the token from the response and you're ready to make API calls. In the next page you have code examples of how to make request with this token.
Api Call Examples
Notice the examples in the next page have the production domain. Don't forget to change them to
https://api.demo.factorial.dev
First API call
To test the token, a simple and easy request is retrieving the information of the token. To do so perform the following curl request. Don't forget to replace TOKEN.
This endpoint will give you access to your token owner information
curl https://api.demo.factorial.dev/api/v2/resources/api_public/credentials -H 'Authentication: Bearer TOKEN'
Conclusion
All endpoints available in this docs are also available in the sandbox environment.
Don't forget to check the domain URL in your requests
Updated 2 months ago