Eagle API Documentation

Eagle API Documentation.

1. Creating a new client_id/client_secret in the software.

  1. Go to "https://www.eagleagent.com.au/agent" and sign-in
  2. Click "Settings" in the top right hand corner.
  3. Click on "API Credentials" on the left hand side navigation bar
  4. Click "New Credentials"
  5. Enter a description for the token. (Example: "My Integration")
  6. Click "Create"
  7. You will now see an index of all your current tokens. The client secret is hidden by default. Click "show" to display it.

2. Acquiring a session token in order to make requests

The "/api/v3/token" endpoint will allow you to generate a session token that will expire in 24 hours. The "Authorization" header must be your client id, followed by a colon, followed by the client secret.

Using cURL

Example (assuming your client id is "5889796789559" and your client secret is "230408972308020237838")

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
    }
  }
}

3. How to make a GraphQL request using cURL

GraphQL request to get a list of properties

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

using cURL

Request

The authorization header should be "Bearer TOKEN" where "TOKEN" is the session token you received by querying the previous endpoint.

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

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": [] }
      ]
    }
  }
}

For full details on our GraphQL API please refer to the documentation below:

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