swright
6 years agoNew Contributor III
REST snap errors when passing in variables for HTTP Entity and Service URL
I’m basically doing what is described in the following article but am getting an error.
REST Post JSON Payload AND Use Snap Variable Designing Pipelines
@matt.bos...
- 6 years ago
@swright your input JSON doesn’t look correct. If you want to reference two variables, they need to be within the same JSON object. For instance, this is an example of an input document to the REST PATCH Snap that would allow referencing
$serviceUrl
and$requestBody
in the Snap settings:[ { "requestBody": { "ExternalIdentifierNumber": "002500012" }, "serviceUrl": "https://" } ]
If you wanted two PATCH requests to be sent (sequentially, to different URLs etc), the input body would look like:
[{ "requestBody": { "ExternalIdentifierNumber": "002500012" }, "serviceUrl": "https://someurl.com" }, { "requestBody": { "ExternalIdentifierNumber": "ABCD" }, "serviceUrl": "https://anotherurl.com" }]