We offer a free JSON API to give you an easy way to interface with our service in your own apps. Below you will find documentation on said REST API.
Authorize with the API by passing Api-Key
with your API key as the value in all of your headers.
URL: https://json.psty.io/api_v1/store/<store_name>
Request Type: GET
Example Request:
>> import requests
>> import urllib.parse as urlparse
>> headers = { 'Api-Key': 'API_KEY_HERE' }
>> store_name = 'store_name'
>> res = requests.get('/api_v1/stores/{}'.format(urlparse.quote_plus(store_name)), headers=headers))
>> print(res.json)
{
"stores": [
{
"_id": "5df487587605c3bac616ed55",
"data": {
"test_data": {
"test_array": [
"test_val1",
"test_val2"
]
}
},
"name": "ChickenTurtleBlind",
"owner": "[email protected]"
}
]
}
URL: https://json.psty.io/api_v1/create
Extra Headers: { 'Content-Type': 'application/json' }
Request Type: POST
Parameter | Description | Type | Location |
---|---|---|---|
data | The JSON data you’d like to post to create | Dict | JSON Body |
Example Request:
>> import requests
>> import urllib.parse as urlparse
>> store_template = {
'store_name': 'store_name',
'data': { 'key' : 'value' }
}
>> res = requests.post(
'/api_v1/create',
headers={
'Api-Key': 'API_KEY_HERE',
'Content-Type': 'application/json'
},
data=json.dumps(store_template)
)
>> print(res.content)
{ "message": "Success", "name": "store_name" }
URL: https://json.psty.io/api_v1/stores/<store_name>
Extra Headers: { 'Content-Type': 'application/json' }
Request Type: PUT
Parameter | Description | Type | Location |
---|---|---|---|
data | The JSON data you’d like to post to update | Dict | JSON Body |
Example Request:
>> import requests
>> import urllib.parse as urlparse
>> store_name = 'store_name'
>> res = requests.put(
'/api_v1/stores/{}'.format(urlparse.quote_plus(store_name)),
headers={
'Api-Key': 'API_KEY_HERE',
'Content-Type': 'application/json'
},
data=json.dumps({'key': 'value'})
)
>> print(res.content)
{ "message": "Updated Store" }
URL: https://json.psty.io/api_v1/stores/<store_name>
Request Type: DELETE
Example Request:
>> import requests
>> import urllib.parse as urlparse
>> store_name = 'store_name'
>> res = requests.delete(
'/api_v1/stores/{}'.format(urlparse.quote_plus(store_name)),
headers={
'Api-Key': 'API_KEY_HERE',
'Content-Type': 'application/json'
}
)
>> print(res.content)
{ "message": "Deleted Store" }
URL: https://json.psty.io/api_v1/all_stores
Request Type: GET
Example Request:
>> import requests
>> headers = { 'Api-Key': 'API_KEY_HERE' }
>> res = requests.get('/api_v1/all_stores', headers={'Api-Key': mock_user.api_key})
>> print(res.json)
{
"stores": [
{
"_id": "5df486f92766fa2af193e148",
"data": {},
"name": "bcda975c-bb4b-4b12-ac51-be52b1e9934d",
"owner": "[email protected]"
},
{
"_id": "5df487587605c3bac616ed55",
"data": {
"test_data": {
"test_array": [
"test_val1",
"test_val2"
]
}
},
"name": "13d2708d-2506-4ab2-a958-0d7cde506147",
"owner": "[email protected]"
}
]
}