You need to sign in to do that
Don't have an account?
Test Dev 81
Webhook Intent to receive required
Hi Guys,
I am Integrating Xero with salesforce in my dev org
here's the validation code for the webhook
can you please tell me what I am missing here?
Thanks,
Rahul
I am Integrating Xero with salesforce in my dev org
here's the validation code for the webhook
@RestResource(urlMapping='/XeroApi/*') Global class RT_XeroApiClass { global static String jsonResults; @HttpPost global static Integer validatexero () { String xeroSignature = RestContext.request.headers.get('x-xero-signature'); String xeroPayload = RestContext.request.requestBody.toString(); Blob signedPayload = Crypto.generateMac('hmacSHA256', Blob.valueOf(xeroPayload), Blob.valueOf(System.Label.Webhook_Payload)); String encodedPayload = EncodingUtil.base64Encode(signedPayload); RestContext.response.statusCode = encodedPayload == xeroSignature ? 200 : 401; return RestContext.response.statusCode; } }The Delivery URL in the webhook is
https://appl-dev-ed.my.salesforce.com/services/apexrest/XeroApiwhen I am sending Intent to receive the status always shows "Intent to receive" required
can you please tell me what I am missing here?
Thanks,
Rahul
Tyler Tran 94
Maybe the problem is in
You should change the System.Label.Webhook_Payload to the Webhook Key in Xero.