XERO 删除带有连接 ID 的连接 [英] XERO Delete connection with connection id

查看:25
本文介绍了XERO 删除带有连接 ID 的连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想允许从我的 api 中删除特定租户,但每次我向 发出 DELETE 请求时https://api.xero.com/connections/{connectionId} 使用我的访问令牌,我得到AuthenticationUnsuccessful".此外,当我将 DELETE 更改为 GET 时,我会正确接收所有活动连接:/我该如何解决这个问题?

解决方案

我可以假设您可以进行其他成功的 API 调用吗?您是使用 SDK 还是如何形成请求标头和正文?

假设您可以发出以下请求,并想删除一个连接:


获取 https://api.xero.com/connections/<预><代码>[{id":f683ae71-f147-44fa-afbf-bb78eeed4c15",authEventId":3531f1f9-08cf-420a-a109-e3f639267b02",租户 ID":1d04172c-9be1-4209-8d23-b078053d172a",租户类型":组织",tenantName":Demo Company (NZ)",createdDateUtc":2020-11-02T23:38:27.5156140",updatedDateUtc":2020-11-17T20:09:05.9875150"}]

删除https://api.xero.com/connections/f683ae71-f147-44fa-afbf-bb78eeed4c15

授权:承载"+ access_token//这是您请求中的标头

I want to allow deleting specific tenant from my api but every time I make DELETE request to https://api.xero.com/connections/{connectionId} with my access token I get "AuthenticationUnsuccessful". Furthemore, when I change DELETE to GET I recieve all active connections properly :/ How can I resolve this problem?

解决方案

can I assume you can make other successful API calls? Are you using and SDK or how are you forming your request headers and body?

Assuming you can make the following request, and wanted to delete a connection:


GET https://api.xero.com/connections/

[
  {
    "id": "f683ae71-f147-44fa-afbf-bb78eeed4c15",
    "authEventId": "3531f1f9-08cf-420a-a109-e3f639267b02",
    "tenantId": "1d04172c-9be1-4209-8d23-b078053d172a",
    "tenantType": "ORGANISATION",
    "tenantName": "Demo Company (NZ)",
    "createdDateUtc": "2020-11-02T23:38:27.5156140",
    "updatedDateUtc": "2020-11-17T20:09:05.9875150"
  }
]

DELETE https://api.xero.com/connections/f683ae71-f147-44fa-afbf-bb78eeed4c15

Authorization: "Bearer " + access_token  // this is a header in your request

这篇关于XERO 删除带有连接 ID 的连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆