Eagle API Documentation

Eagle GraphQL API

This documentation explains how standard Eagle API clients create credentials, request a session token, and make GraphQL requests against the main Eagle GraphQL endpoint.

Client credentials Token-based authentication GraphQL endpoint access Schema explorer reference

1. Overview

The standard Eagle API uses client credentials to create a short-lived session token, which is then used to make GraphQL requests to the main API endpoint.

Integrators first create a client_id and client_secret in Eagle, then exchange those credentials for a session token via the token endpoint, and finally use that token in the Authorization header for GraphQL requests.

Credential ManagementCreate and manage API credentials in the Eagle app.
https://www.eagleagent.com.au/agent
Token EndpointExchange client credentials for a session token.
/api/v3/token
GraphQL EndpointUse the session token to query the Eagle GraphQL API.
/api/v3/graphql
Reference: for full schema details, field availability, and supported queries and mutations, use the GraphQL schema explorer linked at the bottom of this page.

2. Creating a new client ID / client secret

Create API credentials in the Eagle application before requesting a session token.

  1. Go to https://www.eagleagent.com.au/agent and sign in.
  2. Click Settings in the top-right corner.
  3. Click API Credentials in the left-hand navigation.
  4. Click New Credentials.
  5. Enter a description for the token, for example My Integration.
  6. Click Create.
  7. You will then see a list of your current tokens. The client secret is hidden by default, so click show to display it.
Important: store the client secret securely. It is used together with the client ID to request session tokens.

3. Acquiring a session token

The /api/v3/token endpoint generates a session token that expires after 24 hours. The Authorization header must contain the client ID, followed by a colon, followed by the client secret.

Using cURL

Example request using a sample client ID and client secret:

Request

curl \
  -X POST \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer 5889796789559:230408972308020237838' \
  https://www.eagleagent.com.au/api/v3/token

Response

{
  "data": {
    "token": {
      "token": "eyJ0eXAfKV1QiLCJhbGciOiJIUzI1NiJ9....",
      "expiresAt": 1582206763
    }
  }
}

4. Making a GraphQL request using cURL

After you receive a session token, use it in the Authorization header as Bearer TOKEN when making requests to the GraphQL endpoint.

GraphQL endpoint

https://www.eagleagent.com.au/api/v3/graphql
The main GraphQL schema explorer / reference page is available at https://api.eaglesoftware.com.au/v3/.

5. Example GraphQL request

5.1 GraphQL query to get a list of properties

query GetProperties {
  properties {
    nodes {
      id
      formattedAddress
      latitude
      longitude
      vendors {
        contact {
          firstName
          lastName
        }
      }
    }
  }
}

5.2 Using cURL

Request

The authorization header should be Bearer TOKEN, where TOKEN is the session token returned by the token endpoint.

curl \
  -X POST \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer eyJ0eXAfKV1QiLCJhbGciOiJIUzI1NiJ9....' \
  --data '{
    "query": "query GetProperties { properties { nodes { id formattedAddress latitude longitude vendors { contact { firstName lastName } } } } }"
  }' \
  https://www.eagleagent.com.au/api/v3/graphql

6. Example response

{
  "data": {
    "properties": {
      "nodes": [
        {
          "id": "1",
          "formattedAddress": "1366 May Locks, EUROA",
          "latitude": 51.7247,
          "longitude": 77.0944,
          "vendors": []
        },
        {
          "id": "3",
          "formattedAddress": "4831 Konopelski Summit, EUROA",
          "latitude": 59.8443,
          "longitude": -20.4846,
          "vendors": []
        }
      ]
    }
  }
}

7. Implementation notes

8. Reference documentation

Main GraphQL schema explorer / reference page:

https://api.eaglesoftware.com.au/v3/

Main GraphQL request endpoint:

https://www.eagleagent.com.au/api/v3/graphql

Token endpoint:

https://www.eagleagent.com.au/api/v3/token