Personal Access Tokens
To get generated data from the JSON Generator API you need to have a Personal Access Token. You can create as many personal access tokens as you like at Personal Access Tokens page.
Create a personal access token
In the top-right corner, click your username and select “Access Tokens”:
After navigating to Personal Access Tokens page click “Generate new token” button and enter token name in the modal:
Click “Generate token” button. This will create a new token for you. Save the personal access token somewhere safe. After you close the modal window, you no longer have access to the token.
Alright, now you have everything to get the generated data from the API. You can find data URL in the Get Data dropdown on the template page:
You can fetch your data from this URL by providing access token in one of the three possible ways:
-
Authorization
header field where the value is in the formatBearer {token}
:curl https://api.json-generator.com/templates/KvMz6Zubh1xv/data \ -H 'Authorization: Bearer 4us718254sk7ils002z51n1n8r3qyae19i7zeyrt'
-
or
access_token
body parameter:curl -X POST https://api.json-generator.com/templates/KvMz6Zubh1xv/data \ -H 'Content-Type: application/json' \ -d '{"access_token": "4us718254sk7ils002z51n1n8r3qyae19i7zeyrt"}'
-
or
access_token
query parameter:curl https://api.json-generator.com/templates/KvMz6Zubh1xv/data?access_token=4us718254sk7ils002z51n1n8r3qyae19i7zeyrt
Revoke a personal access token
At any time, you can revoke a personal access token.
#. In the top-right corner, click your username and select “Access Tokens”. #. After navigating to Personal Access Tokens page click “Revoke” button and confirm the action.