Browse guides

Authentication and Authorization

Overview

To securely access resources via the Global Data API, clients are required to authenticate using API Keys. These keys serve as credentials, ensuring only authorized entities can interact with the API. This section outlines the process of obtaining, using, and managing these keys.

Generating an API Key

  1. Visit the Global Data API web portal: https://gdapi.globaldata.net.au
  2. Log in with your registered credentials.
  3. Navigate to the API Keys section.
  4. From here, you can generate one or multiple API keys as per your requirement.

Wen generating an API key, you can choose to use the sandbox environment or the live environment. Note that your account may initially be limited to the sandbox environment. Please contact Global Data to request access to the live environment.

Note: For added security, you have the option to restrict each API key's usage to specific IP addresses or subnets.

Using Your API Key

Once you have your API Key, include it in the request header when making API calls. The Authorization header format is as follows:

Authorization: Bearer <your-api-token>

Replace <your-api-token> with your actual API Key.

Handling Authentication Failures

If a request is made with an invalid, expired, or missing token, the API will respond with a HTTP/1.0 401 Unauthorized status. This indicates that the server understands the request but refuses to authorize it. When you receive such a response:

  1. Double-check the token you've provided in the Authorization header.
  2. Ensure that any IP address or subnet restrictions you've set up align with the IP address making the request.
  3. If you suspect the token has been compromised, generate a new one from the web portal and replace the old one in your application.

Access Endpoints

The API uses different endpoints for the sandbox and live environments.

Environment Endpoint
Live https://gdapi.globaldata.net.au/api/v2
Sandbox https://sandbox-gdapi.globaldata.net.au/api/v2

Important Note: Using the wrong endpoint (eg attempting to access the live environment with a sandbox key) will return a HTTP/1.0 401 Unauthorized status.