cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture the Trigger task API headers

spinaka
New Contributor III

Hi,

I want to capture all the headers passed to a Triggered task. Generally they are hidden in the Pipeline Parameters in a triggered execution. Based on a header ‘User-Agent’ we have to take an action.

Could someone please help with info on this?

image

4 REPLIES 4

viktor_n
Contributor II

Hi @spinaka,

Here is a link of the documentation of how you can get headers.
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/986383617/Passing+Pipeline+Arguments+to+Tr...

You need to put the name of the header in parameters but everything need to be in upper case and spaces to be replaced with underscores as they are shown in the site.

image

Regards,
Viktor

spinaka
New Contributor III

This is also helpful in one way but have to make little changes at the client end. I tried pipe.args suggested by @bojanvelevski and that is straight forward to capture all. Anyway, thank you much for responding @viktor_n.

bojanvelevski
Valued Contributor

Hi @spinaka,

Not sure what’s the use case here, because you receive the headers in the response. If you’re trying to get the headers on the Triggering Pipeline side, you can use the pipe.args function that will send all of the headers and parameters in the response.

Triggering Pipeline:

image

Response:

image

pipe.args function worked simply. Thank you very much, @bojanvelevski