{API}

Getting Started

Getting Started


The Trgtr.io API is a common RESTful API. All requests are performed via an HTTPS connection and responses are returned as JSON. This widely-accepted format allows for easy use with the most common programming languages and development kits while remaining portable, expandable, and secure. Below you will find a description of the various endpoints, the parameters they accept, and the responses they send.

Authentication

API Tokens are sensitive and give access to the data in your account. Only trusted sources should be given access to these keys to protect your account. If you suspect a API Token has been compromised reset the key immediately from the Trgtr.io account page.

You can authenticate your requests by including this API Token as the api_token parameter in the request's query string.

Error Handling

API Tokens are sensitive and give access to the data in your account. Only trusted sources should be given access to these keys to protect your account. If you suspect a API Token has been compromised reset the key immediately from the Trgtr.io account page.

You can authenticate your requests by including this API Token as the api_token parameter in the request's query string.

1. HTTP Errors (4xx/5xx)

As with any web service, our API will return 4xx and 5xx level errors when appropriate. Always check the status code to ensure the request was successfully received and successfully handled.

A 4xx level error code indicates that something is wrong with the request. Our recommendation is to double check the request for any typos.

A 5xx level error code indicates that something went wrong on our end. Our recommendation is to attempt the request again and check our API's status. If the request is still failing let us know at support@trgtr.io.

2. API Errors

All 2xx level responses will contain a status property. This property will indicate whether the requested operation was successfully completed or if an error was encountered.

When an error does occur a message property will be included with a detailed message about why it failed. These error messages will be returned with a 200 level status code.

Example Error Response
                    
{
    "status": "general_error",
    "message": "Invalid parameters provided"
}
            
        
Status Description
success The request was successful
general_error Something went wrong with the request; check the message property for further details
auth_failure The request couldn't be authenticated; ensure your API key has been typed correctly