简体   繁体   中英

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/

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/

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
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM