Warm tip: This article is reproduced from serverfault.com, please click

XERO Delete connection with connection id

发布于 2020-12-01 12:23:52

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?

Questioner
huligan17
Viewed
0
SerKnight 2020-12-03 05:24:30

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