Politics and War Wiki
Politics and War Wiki
Advertisement
(This page is a WIP.)

This page details the various errors that can be returned when attempting to retrieve data from the Politics and War API. It (will eventually) contain errors mentioned on other pages.

API Error Response[]

When an error occurs in an API call, the query returns the following JSON, where general_message has the actual error message.

{
        'success': false, 
        'general_message': 'ERROR MESSAGE HERE'
}

General Errors[]

The following errors can occur regardless of which API you are attempting to access:

Invalid API Key[]

This error tells you that your API key may be invalid. It is possible that there is a typo in your API key or API key is missing.

See Accessing the API for information on how to obtain your API key.

{
        'success': false, 
        'general_message': 'Invalid API key.'
}

 

Exceeding the maximum amount of API requests per day[]

This error tells you that you've crossed your daily API request limit.

Limits: 2000 for non-VIP. 5000 for VIP.

On a non-VIP account:

{
        'success': false, 
        'general_message': 'Exceeded max request limit of 2000 for today.'
}

On a VIP account:

{
        'success': false, 
        'general_message': 'Exceeded max request limit of 5000 for today.'
}

Endpoint Specific Errors[]

Nation not found - Nation API[]

This error tells you that the requested nation doesn’t exist. It’s possible that the value of your id is not a number or nation doesn't exist.

{
        'success': false, 
        'general_message': 'Nation doesn\'t exist.'
}

Invalid resource - Trade History API[]

This error tells you that the requested resource doesn’t exist. It’s possible that there’s a typo in your request (resource names are case-sensitive).

{
        'success': false, 
        'general_message': 'No valid resource parameters were sent.'
}

Invalid record amount - Trade History API[]

This error tells you that the records key was invalid. It's possible that the there's a typo in the key value, the value is not a number, is less than 1 or greater than 10000.

{
        'success': false, 
        'general_message': 'Request is limited to 10,000 records maximum.'
}
{
        'success':false, 
        'general_message':'Unable to return less than 1 record.' 
}
Advertisement