cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Reading Custom Headers from a triggered Task

Kulashekharan
New Contributor II

I have not been able to access any custom header parameter (not query or URI parameter) that I am posting to snaplogic after I setup a triggered task for a pipeline. I am able to get the JSON in the body successfully but havent been able to find a way to access the customized header parameter (not standard) that was added. Is there any way to get this?

2 REPLIES 2

tlikarish
Employee
Employee

Do you want to access the header from the pipeline? I believe the headers available to the pipeline are restricted to the ones mentioned in the trigger task documentation. Parameters can be passed via the path, query string, or request body. If that doesnโ€™t work for you, do you mind explaining a bit more about what youโ€™re trying to do?

Kulashekharan
New Contributor II

Sure, let me explain:
My customers are making an API call with 2 custom headers to my exposed API.
Example:
xxxxxx.com - xxx sex videos free hd porn Resources and Information. with custom headers
x-org-username
x-org-appid
returning:
x-org-challenge:

This is currently in place using another integration platform that reviews the incoming API callโ€™s custom headers and returns back data in custom header. I will not be able to make changes to start using parameters instead of custom headers as it would be a big change for all my existing customers. To make it seemless when I adopt or migrate to SnapLogic, I need the ability to read the custom headers from a triggered task. Note the custom headers get captured in the response header file when you turn on the trace log option, it is just that I cannot access it from the snap in pipeline.

Another way to look at it is if SnapLogic allows making an API call with custom headers then it should also allow reading custom headers from incoming traffic.
Today in snaplogic if I make a Rest Get call (to an API) that sends back custom headers, I am able to access it from the result as below
โ€œstatusLineโ€:
{protoVersion:HTTP/1.1, statusCode:200, reasonPhrase:OK}
โ€œentityโ€:
{status:SUCCESS}
โ€œheadersโ€:
{x-org-challenge:+VIPNDL8dyz3TWMTgtQJLA==, cache-control:private, set-cookie:SERVERID=orgsecurity_1_10.42.4.63; path=/, transfer-encoding:chunked, content-type:application/jsoโ€ฆ}

Notice x-org-challenge is the custom header that the API returns back which I can use in my pipeline.

Why then is SnapLogic not able to give me the custom headers when an external resource hits the snaplogic api which is setup as triggered task?

Think about it this way, if you make an API call with custom headers from snaplogic to snaplogic the receiving snaplogic will not be able to read the custom headers sent.