Mantic Companion API
URL Location and Structure
All calls to the Mantic Companion API must use the following URL format:
https://companion.manticgames.com/api/<game_prefix>/<game_object>/?api_key=<API_KEY>[&optional_params]
- game_prefix - One of arm, dz, kow, ff
- game_object - The table to load
- API_KEY - The API to authenticate your connection
- optional_params - Some object support additional parameters such as id etc
Example:
https://companion.manticgames.com/api/arm/armies/?api_key=asdlkh8re7c6rg
Return Data
All data from the API is returned as a JSON string. Every connection will return at least a "success" key in the JSON object. If "success" is false, an "error_message" key will also exist.
Authentication
Connection to the Mantic Companion API will occur with the presence of a valid API key sent as the URL parameter "api_key". Any request may return the following error states when attempting to authenticate:
| Error header code | Message | Action | 
|---|---|---|
| 403 Forbidden | No API Key sent | Ensure the api_key parameter is set | 
| 401 Unauthorised | API Key invalid | The sent API key is not valid - send a valid API key | 
| 404 Not Found | API URL must contain sub-directory of one of the following: arm, dz, ff, kow | Ensure the URL game_prefix is one of arm, dz, ff, kow | 
Testing the connection
A useful end point for any game_prefix is "help", for example: https://companion.manticgames.com/api/dz/help/?api_key=asdlkh8re7c6rg. The "help" endpoint details all endpoints for that game_prefix:
{
    "success": true,
    "message": "End points for dz",
    "end_points": [
        "dz_armies",
        "dz_base_sizes",
        "dz_equipment",
        "dz_keywords",
        "dz_list_entries",
        "dz_lists",
        "dz_rules_chapters",
        "dz_rules_sections",
        "dz_unit_components",
        "dz_unit_custom_rules",
        "dz_unit_types",
        "dz_unit_upgrades",
        "dz_units",
        "dz_weapons"
    ]
}                    
                    
