Overview
You are looking for instructions on how to get the event data records(EDRs) for an account in your Totogi Tenant using the GraphQL API.
Solution
In order to make the requests through the API, the information below is required.
- The Provider ID.
- The account ID for which you want to get the EDRs
- An Access Token using the credentials from the Tenant Admin User.
In order to get the EDRs for an account, one should use the getEventDataRecordsByAccount query API call. With this method, one can query the EDRs associated with the account.
Below is an example payload to query EDRs with some important specifications:
- The EDR query API can also be filtered based on an EventDataRecordFilter. The filter in turn supports EventDataRecordType, from and to dates for the EDRs.
- The request handles different possible results such as what to return if the account does not exist(error - AccountNotFound)
query GetEventDataRecordsByAccount {
getEventDataRecordsByAccount(
accountId: "<Account ID>"
providerId: "<providerId>"
filterBy: { types: BILLING }
first: 20
) {
... on EventDataRecordAccountConnection {
edges {
node {
id
createdAt
action
eventData
}
}
}
... on AccountNotFound {
errorCode
errorMessage
accountId
}
}
}
The result (if the EDRs are retrieved successfully) is the EDRs as shown below: