Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Other endpoints #25

Closed
Blujay75 opened this issue Sep 17, 2020 · 1 comment
Closed

Other endpoints #25

Blujay75 opened this issue Sep 17, 2020 · 1 comment

Comments

@Blujay75
Copy link

Hi Ben,

I'm trying to connect to the Items endpoint and keep getting the following Error:

{"Type":null,"Title":"Unauthorized","Status":401,"Detail":"AuthorizationUnsuccessful","Instance":"3e2b3bc7-21dc-4c20-8943-bb84bb16db39","Extensions":{}}

I've written a new wrapper class and added a method into XeroAPI (basically copied the invoice one), but I get the same even if I just run:

XeroCalloutService.executeCallout('GET','Items');

The following works:

XeroCalloutService.executeCallout('GET','Invoices');

Which is suggesting its not the actual authorisation, so I've tried:

XeroCalloutService.executeCallout('GET','Accounts');
XeroCalloutService.executeCallout('GET','Organisation');
XeroCalloutService.executeCallout('GET','Users');

Also all being lowercase as well, but I still get the AuthorizationUnsuccessful error. I'm able to access all of these endpoints using the API Previewer so I'm assuming its not a Xero setting / issue, but I can't see anywhere in the Salesforce side that should be limiting the endpoints available.

Any ideas or is this one for Xero support?

Kind Regards

Jon

@Blujay75
Copy link
Author

I've figured this out, I needed to add accounting.settings to the default scopes in the Auth. Provider. I also needed to disconnect the App in Xero and connect it again by saving the Named Credential.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant