[英]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.有时,由于某些内部问题,Avalara 服务可能会关闭。 We check the status by visiting https://status.avalara.com/
我们通过访问https://status.avalara.com/查看状态
We are building some function in the back end which needs to be triggered only when Avalara Service is down.我们正在后端构建一些仅在 Avalara 服务关闭时才需要触发的功能。 Is there any API which checks, is Avalara is Up and running?
是否有任何 API 可以检查 Avalara 是否已启动并正在运行?
PS : I went through, Ping API but not confident on it. PS:我通过了, Ping API 但对它没有信心。 Is there a way I could test it?
有什么方法可以测试吗?
https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Utilities/Ping/ https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Utilities/Ping/
Avalara Ping API returns Avalara Ping API 返回
PingResultModel
Ping结果模型
. . So in case, if there are issues with the Avalara API - all the properties of PingResultModel will be null.
因此,如果 Avalara API 出现问题 - PingResultModel 的所有属性都将为空。
So on checking the所以在检查
version
版本
property of PingResultModel, we can find whether Avalara Service is up or not. PingResultModel 的属性,我们可以查看 Avalara Service 是否已启动。
PingResultModel : https://developer.avalara.com/api-reference/avatax/rest/v2/models/PingResultModel/
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.使用您的帐户用户名和密码使用 GET https://sandbox-rest.avatax.com/api/v2/utilities/ping 。
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
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.