Introduction

Welcome to our API documentation-your gateway to powerful, data-driven insights. Our APIs are engineered to deliver mission-critical performance and reliability, empowering you to build, innovate, and scale. To ensure secure access and a seamless experience, all requests must be authenticated using the following credentials:

  1. Auth Bearer Token
  2. X-OA-Subscription-Key

Your user/password (used to retrieve your Auth Bearer token) and X-OA-Subscription-Key will be supplied upon sign up. Simply include these credentials in your request headers, and you'll be ready to leverage the full potential of our platform.

Note: For a detailed guide on how to call the token endpoint using your user/password credentials, please refer to the dedicated section below.

We're committed to helping you unlock new possibilities-dive in, explore our endpoints, and start creating amazing solutions. If you have any questions, our support team is here to help.

Authentication

Below explains how to retrieve an access token using the Resource Owner Password Grant (password grant type). Replace all placeholder values (e.g., REPLACE_WITH_YOUR_CLIENT_ID) with your own valid credentials.


Endpoint

URL: POST https://auth.gunbrokeranalytics.com/oauth/token

Content-Type: application/json


Request Body

The following JSON payload must be sent in the body of the POST request:

{
  "client_id": "REPLACE_WITH_YOUR_CLIENT_ID",
  "client_secret": "REPLACE_WITH_YOUR_CLIENT_SECRET",
  "audience": "REPLACE_WITH_YOUR_AUDIENCE",
  "grant_type": "password",
  "username": "REPLACE_WITH_YOUR_USERNAME",
  "password": "REPLACE_WITH_YOUR_PASSWORD"
}

Field Descriptions:


Example cURL Request

Below is an example of how you can make this request using curl in a terminal:

curl --request POST \
  --url https://auth.gunbrokeranalytics.com/oauth/token \
  --header 'Content-Type: application/json' \
  --data '{
    "client_id": "REPLACE_WITH_YOUR_CLIENT_ID",
    "client_secret": "REPLACE_WITH_YOUR_CLIENT_SECRET",
    "audience": "REPLACE_WITH_YOUR_AUDIENCE",
    "grant_type": "password",
    "username": "REPLACE_WITH_YOUR_USERNAME",
    "password": "REPLACE_WITH_YOUR_PASSWORD"
  }'

Successful Response

A successful response will typically include an access_token, a token_type, and an expires_in field:

{
  "access_token": "eyJz93a...k4laUWw",
  "token_type": "Bearer",
  "expires_in": 86400
}

Error Handling

If the request fails, you will receive an error in JSON format. Common errors include:


Security Considerations