cancel
Showing results for 
Search instead for 
Did you mean: 

How to log request and response for a pipeline which has Rest api post and get calls?

Nidhi
New Contributor II

I have a pipeline where i make a REST api call . I want to log the request body and the response body everytime the pipeline executes.How can this be achieved.Kindly help in this regard.

4 REPLIES 4

bojanvelevski
Valued Contributor

Hey @Nidhi,

The simplest way would be to add a Copy snap both on the input, and on the output of the pipeline. That way you can ensure that the incoming payload as well as the response, can be logged. You can use whatever target system you prefer (i.e. File, DB, etc.).

image

Nidhi
New Contributor II

Hello @bojanvelevski ,
Appreciate your quick response.
I tried to add output snap as per your suggestion.However, i am getting error as - “Pipeline has 3 unlinked input views”
Please check the below screenshot of the integration.

image

Nidhi
New Contributor II

Hello @bojanvelevski ,

I got the issue .
So i just needed to keep the Json Parser first and then add the copy snap and it is successfully logging the request and the response.
image

Thanks a lot for your suggestion. 🙂

jcornelius
New Contributor III

JFYI, your error issue was not caused by needing a json parser first. you 3 inputs error was cause by not having you snaps connection enabled (note the white connection after Copy and json formatter), the pipeline thought you had 3 inputs, not just 1, connecting these outputs would of removed your error.