Skip to main content
This guide provides an overview of how to authenticate and retrieve events and transactions from our API. It covers the login process, fetching transactions, and retrieving activity events.

Table of Contents

  1. Authentication
  2. Retrieving Transactions
  3. Retrieving Activity Events

1. Authentication

Before you can access any data, you need to authenticate with our API. We use a token-based authentication system.

Login API

To obtain an access token, use the Login API

Endpoint

POST /login

Request Body

Parameter Data Type Description UserName string The username of the credential TenantName string The name of the tenant that the user belongs to. Password string The password of the credential

Request Body Sample

Sample curl request

Response Body

Parameter Data Type Description cognitoToken.AuthenticationResult.IdToken string The JWT token that serves as the identity token cognitoToken.AuthenticationResult.AccessToken string The token used to access API resources cognitoToken.AuthenticationResult.RefreshToken string The token used to refresh the authentication when the current token expires cognitoToken.AuthenticationResult.ExpiresIn integer The expiration time of the token in seconds cognitoToken.AuthenticationResult.TokenType string The type of the token provided user.OloID string OloID of the user user.TenantID string The ID of the tenant user.TenantName string The name of the tenant that the user belongs to.

Sample Response

Store the AccessToken securely. You’ll need to include it in the Authorization header for subsequent API calls. For more details on the Login API, see the full Login API documentation.

2. Retrieving Transactions

To fetch transactions, use the List Transactions API:

Endpoint

POST /transactions

Headers

  • Authorization: Bearer <your_access_token>
  • Content-Type: application/json

Request Body

Parameter Data Type Description PageSize number Number of items in the result set FromDate Epoch time The start timestamp for filtering results ToDate Epoch time The end timestamp for filtering results ApplicationID string The ID of the application

Sample curl Request

Response Body

Parameter Data Type Description data.NextPageToken Json Object To paginate through the result set data.transactions Array A list of transactions message string Additional information about the status of transactions

Sample Response

To fetch subsequent pages, include the NextPageToken in your next request. For more details on the List Transactions API, see the full List Transactions API documentation.

3. Retrieving Activity Events

To fetch activity events, use the Filter Activity API:

Endpoint

POST /filterActivity

Headers

  • Authorization: Bearer <your_access_token>
  • Content-Type: application/json

Request Body

Parameter Data Type Description start Epoch time The start timestamp for filtering results end Epoch time The end timestamp for filtering results limit Number Number of items on result set Sample curl Request
Response Body Parameters Data Type Description data.activities array A list of activity objects data.nextToken JSON Object Token for paginating through result set message string Additional information about the status of activities

Sample Response

To fetch subsequent pages, include the nextToken in your next request. For more details on the Filter Activity API, see the full Filter Activity API documentation.

Best Practices

  1. Implement token refresh logic to maintain uninterrupted access.
  2. When fetching large amounts of data, use pagination to improve performance.
  3. Consider implementing rate limiting in your application to avoid hitting API limits.

Error Handling

All APIs may return error responses. Always check the HTTP status code and error message in the response body. Common error codes include:
  • 400: Bad Request
  • 401: Unauthorized
  • 403: Forbidden
  • 404: Not Found
  • 500: Internal Server Error