09-27-2023 08:38 AM
Hello,
I need to construct a JSON response to validate a webhook for Adobe Sign.
The required response is { "xAdobeSignClientId": "BGBQIIE7H253K6" }
However by default I get [{ "xAdobeSignClientId": "BGBQIIE7H253K6" }] which is rejected.
Is there a way to remove the square brackets from the response?
Many thanks,
Mark
Solved! Go to Solution.
09-28-2023 04:15 AM - edited 09-28-2023 04:18 AM
One way is to add JSON Formatter Snap after the Mapper Snap, with "Format each document" checked.
BR,
Spiro Taleski
09-27-2023 10:49 AM
@mongley - I'm not sure how you created the document to send, but since the displayed document is an array, you could either follow the reference with [0] to get the first value in the array, or .pop() to get the last element.
09-28-2023 02:06 AM
Thanks for having a look. I am simply assigning a string to the variable $xAdobeSignClientId in a mapper as per screenshot. If I take the variable in a subsequent mapper and use [0] this return the first character of the string, using pop() errors with the message 'String type does not have a method named: pop' so within SnapLogic this is not an array. When I call the triggered task from a browser or Postman it is returned within an array - which is therefore rejected by Adobe.
09-28-2023 04:15 AM - edited 09-28-2023 04:18 AM
One way is to add JSON Formatter Snap after the Mapper Snap, with "Format each document" checked.
BR,
Spiro Taleski
09-28-2023 08:11 AM
Many thanks, that worked perfectly.