I am trying to get Xero to send a WebHook to Salesforce so we can capture updates to Contacts and Invoices.

I created an Unauthenticated RESTful web-service by exposing the RestResource annotated Apex Class to the Force.com Site Guest User.

But I am receiving back errors! Xero will not authorise an Endpoint unless it replies with an empty body and without cookies, however, Salesforce always returns back the BrowserId Cookie and I cannot work out how to remove this!

Does anyone have any ideas how to remove this? Or am I trying to find air in space?

  • 1
    I'm looking to do the same thing myself and unfortunately I can't work out a way to remove the cookie either 🙄I've tried numerous things by overriding the RestResponse but not having much luck... Will let you know if I find anything. – benedwards44 Jun 11 '18 at 7:04
  • Yeah I tried that also... the ONLY way I have been able to work out what is going on here is to create a small piece of "middleware" using Node.js on the Heroku platform... but I am absolutely lost with querying the data from Xero from the Node.js app #Newbie – Tim Jun 12 '18 at 10:52
  • Yea that's my only alternative solution as well, set up a custom endpoint on Heroku or similar to receive the message from Xero. From there, you can either: 1. Query Xero from the custom app to retrieve the data and then push that into Salesforce using the standard SOAP/REST API; OR 2. The custom app could just pass the Xero message straight to your Salesforce endpoint, and then Salesforce queries Xero for the data it needs. – benedwards44 Jun 12 '18 at 21:32

I received an update from Xero today saying they had deployed a change and it will accept the BrowserId Cookie that is returned by Salesforce so you should be good to go now :)

| improve this answer | |
  • Does it work now? – Robs Jun 22 '18 at 10:23
  • well I am getting the ITR... but I am having some issues with the HMAC encryption... it doesn't seem to want to work for me -_- salesforce.stackexchange.com/questions/222446/… – Tim Jun 22 '18 at 11:27
  • Awesome! Thanks for the update. I'll implement this and happy to share my code. – benedwards44 Jun 26 '18 at 6:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.