Viresh Mathad
Viresh Mathad

Reputation: 636

Is there a way to check the Avalara API Status in a programmatic way?

Sometimes, Avalara services might be be down due to some internal issue. We check the status by visiting https://status.avalara.com/

We are building some function in the back end which needs to be triggered only when Avalara Service is down. Is there any API which checks, is Avalara is Up and running?

PS : I went through, Ping API but not confident on it. Is there a way I could test it?

https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Utilities/Ping/

Upvotes: -1

Views: 415

Answers (2)

Avalara-Developer
Avalara-Developer

Reputation: 36

Use GET https://sandbox-rest.avatax.com/api/v2/utilities/ping using your Account Username and Password.

cURL:

curl --location --request GET 'https://sandbox-rest.avatax.com/api/v2/utilities/ping' \
--header 'Authorization: Basic bXl1c2VyaWQ6bXlwYXNzd29yZA=='

Example Response:

{
    "version": "21.7.0",
    "authenticated": true,
    "authenticationType": "UsernamePassword",
    "authenticatedUserName": "my.username",
    "authenticatedUserId": 123456,
    "authenticatedAccountId": 1100001234,
    "authenticatedCompanyId": 0
}

Upvotes: 0

Viresh Mathad
Viresh Mathad

Reputation: 636

Avalara Ping API returns

PingResultModel

. So in case, if there are issues with the Avalara API - all the properties of PingResultModel will be null.

So on checking the

version

property of PingResultModel, we can find whether Avalara Service is up or not.

PingResultModel : https://developer.avalara.com/api-reference/avatax/rest/v2/models/PingResultModel/

Upvotes: 0

Related Questions