09-15-2020 05:17 AM
Hi everyone,
we’re offering a triggered task as a sort of simplified API for a more complex REST API (specifically Jira).
What we want to achieve is to influence the HTTP return code, status and message we deliver back to the caller of the triggered task based on the return result of the REST API.
Here’s a brief description for context:
Assuming there’s an error in the Jira Search snap, the error will bubble up to the pipeline execute snap, which in turn triggers the attached error pipe of the template pipe.
This will ensure that the error is correctly logged, however, the response to the caller of the triggered task will be 200 in any case.
I’m unsure of 2 points:
Where is the response formed and delivered back to the caller? At the Error pipe or already somewhere before that?
Is there any way to influence what is delivered back to the caller? Ideally we’d like to implement a solution in the template pipeline for e.g. common response codes, but want to refrain from having to implement ‘repsonse code conditionals’ in every integration pipeline.
Any suggestions are highly appreciated!
Thanks and best regards
Thomas
09-21-2020 12:56 AM
Thanks, that’s a pity. ☹️
BR
Thomas
09-22-2020 05:36 PM
It is possible to set the response code for a triggered task. Use a Document to Binary snap as the final snap and set a binary header property called status
, the integer value for that property will be the response code for the API call. For example, the attached pipeline returns a 409 response code
If more fine-grained control is required on the API response, the API management functionality which is a subscription feature allows for full control on the API response.
reds_2020_09_22.slp (3.2 KB)
09-28-2020 12:29 AM
Thank you!
12-23-2021 05:31 PM
Is it only the Status code that can be modified? i.e. the body of the message returned to the POSTing system is:
{
“http_status_code”: 200
}
Are you saying there is no way to control this body response?