Select Page

API Authentication

API Key

In order to use our APIs, you need to acquire an API key. All you have to do is Signin to your account and grab it from your dashboard. Once you have your API key ready you can start issuing requests to our servers. It's that simple!

API Key security information:

Your API Key represents your account. It is important that it always remains a secret and should therefore never be used in any front-end environment where it can be easily read or accessed.

If you happen to misplace your key or suspect that it has been leaked, make sure to immediately revoke/generate a new one in your dashboard.

If you're trying to find out how many tokens you have left in your account, on your next successful request you can always check out the X-Tokens-Remaining and X-Tokens-Expiry headers that will always be attached to requests made with your API Key.

Making A Request

Making a request to our endpoints is easy. Simply, point your HTTPs client of choice to the desired endpoint URL and provide it with the X-API-Key header along with all the information the endpoint requires. Our servers will then process your request and return the result payload to you. As our platform name implies, all of our endpoint replies are JSON based.

When providing body parameter data it is recommended that you encode the url-encode the data properly and use x-www-form-urlencoded.

The base URL for all our endpoints is: https://api.jsonrepo.com/{endpoint}

Request Example
// Make a request to one of our endpoints

curl https://api.jsonrepo.com/{endpoint} \
-H "X-API-Key: {YOUR_API_KEY_HERE}"
// Example server response

{
    "http_code": 200,
    "http_message": "Ok",
    "message": "Successful execution",
    "payload": {
        "some_key": [...]
    }
}

A typical response will include: http_code field, http_message field, timestamp field, message field and a payload field (which will be set to an empty array for errors or endpoints that return no data).

Importance of URL-encoding:

Some of our APIs will require you to provide data as query or body parameter(s) for the endpoint to do its job. When sending the required data please make sure that everything is URL-encoded properly. Otherwise, the request may be misinterpreted or dropped altogether.

For more information check the examples in the documentation for your specific endpoint of choice.

Authentication Failure

When the API key is not provided or an incorrect/invalid one is sent, our service will reject the request and return a 401 HTTP error code response. Similarly, when you exceed your request allowance, the 429 code will be sent. To find out more, see our Error Rules Guide.

Failed Response
// Server failed auth response

{
    "http_code": 401,
    "http_message": "Unauthorized",
    "timestamp": 1730345509,
    "message": "Authentication header was not included in the request.",
    "payload": []
}