Latest Neocron News and Information
- New test server patch #749 has been released to Vedeena
- New retail server patch #747 has been released to Titan
Difference between revisions of "THNapi:Items DB - JSON Examples"
From Neocron Wiki
(Created page with "== List of groups of datasets you have access to == <pre> curl -i -H "X-THN-API-User: <Your API user Key>" -H "X-THN-API-Key: <Your API key secret>" -H "Accept: application/j...") |
(Access list response) |
||
| Line 3: | Line 3: | ||
<pre> | <pre> | ||
curl -i -H "X-THN-API-User: <Your API user Key>" -H "X-THN-API-Key: <Your API key secret>" -H "Accept: application/json" -H "Content-Type: application/json" -L https://db.techhaven.org/api/access-list.json | curl -i -H "X-THN-API-User: <Your API user Key>" -H "X-THN-API-Key: <Your API key secret>" -H "Accept: application/json" -H "Content-Type: application/json" -L https://db.techhaven.org/api/access-list.json | ||
| + | </pre> | ||
| + | |||
| + | === Response === | ||
| + | <pre> | ||
| + | { | ||
| + | "deny": [], // For THN use only | ||
| + | "granted": [ | ||
| + | { | ||
| + | "name": "Rifles", | ||
| + | "path": "weapons/rifles", | ||
| + | "granted": true | ||
| + | }, | ||
| + | { | ||
| + | "name": "Helmets", | ||
| + | "path": "armor/helmets", | ||
| + | "granted": true | ||
| + | }, | ||
| + | { | ||
| + | "name": "Brain implants", | ||
| + | "path": "implants/brain", | ||
| + | "granted": true | ||
| + | }, | ||
| + | ... // Rest of output skipped for clarity. | ||
| + | ] | ||
| + | } | ||
</pre> | </pre> | ||
Revision as of 17:12, 11 May 2020
List of groups of datasets you have access to
curl -i -H "X-THN-API-User: <Your API user Key>" -H "X-THN-API-Key: <Your API key secret>" -H "Accept: application/json" -H "Content-Type: application/json" -L https://db.techhaven.org/api/access-list.json
Response
{
"deny": [], // For THN use only
"granted": [
{
"name": "Rifles",
"path": "weapons/rifles",
"granted": true
},
{
"name": "Helmets",
"path": "armor/helmets",
"granted": true
},
{
"name": "Brain implants",
"path": "implants/brain",
"granted": true
},
... // Rest of output skipped for clarity.
]
}
API Response for a group
curl -i -H "X-THN-API-User: <Your API user Key>" -H "X-THN-API-Key: <Your API key secret>" -H "Accept: application/json" -H "Content-Type: application/json" -L https://db.techhaven.org/weapons/melee.json
API Response for an Item
curl -i -H "X-THN-API-User: <Your API user Key>" -H "X-THN-API-Key: <Your API key secret>" -H "Accept: application/json" -H "Content-Type: application/json" -L https://db.techhaven.org/item/1562.json
..or you can use the item slug.
curl -i -H "X-THN-API-User: <Your API user Key>" -H "X-THN-API-Key: <Your API key secret>" -H "Accept: application/json" -H "Content-Type: application/json" -L https://db.techhaven.org/item/mendicant-rifle.json