2

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?

huligan17
  • 23
  • 1
  • 2
  • Are you making the delete call with the connection ID or the tenant ID? `{ "id": "e1eede29-f875-4a5d-8470-17f6a29a88b1", "authEventId": "d99ecdfe-391d-43d2-b834-17636ba90e8d", "tenantId": "70784a63-d24b-46a9-a4db-0e70a274b056", "tenantType": "ORGANISATION", "tenantName": "Maple Florist", "createdDateUtc": "2019-07-09T23:40:30.1833130", "updatedDateUtc": "2020-05-15T01:35:13.8491980" }` – Rett Behrens Dec 01 '20 at 17:11
  • Hello! I am making delete call with authEventId (as I understand it is a connection id). For Authorization im using 'Bearer ' + access_token. I have done many combinations of requests already but i am still seeing AuthenticationUnsuccessful in responce with delete... – huligan17 Dec 01 '20 at 22:54

1 Answers1

1

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
SerKnight
  • 2,502
  • 1
  • 16
  • 18
  • Thank you! I missed that we have to use id instead of authEventId... I think it should be written in documentation for people like me :D Thank you again! – huligan17 Dec 02 '20 at 21:58