Latest Neocron News and Information

  • New test server patch #543 has been released to Vedeena

THNapi:Items DB - JSON Examples

From Neocron Wiki
Revision as of 17:12, 11 May 2020 by Brammers (talk | contribs) (Access list response)
Jump to: navigation, search

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

Note on redirects