Forum Discussion
7 Replies
- tlikarishEmployee
Can you describe your use case more. Do you need to pass an authorization token that will be used in the pipeline to call another service? If that’s the case then I’d recommend looking at the documentation abouthow to pass input into a triggered task. Search for the heading " POSTing Input to a Pipeline" and try that out.
- jshanaiahNew Contributor II
Thanks @tlikarish
yes , I need to pass the authorization token which will be used to call another service.
I read document. I would require to send it in JSON body in a POST request.Api I am trying to build is GET . @tlikarish How to achieve it for GET request?
- tlikarishEmployee
If you want to have your API to use the HTTP Get method, then you’d have to pass the token through the path or the query string. The one downside of this approach is that often paths and query strings can end up in log files, which would expose your token.
If you want to go that route still, then you’d look at the section Passing Pipeline Arguments for an example with the query string or Semantic URL for an example of how to do it with the path.
- jshanaiahNew Contributor II
@tlikarish Yes, there is always risk of compromising authorization token. We wouldn’t want to pass authorization token as querry or as PATH_INFO(Snaplogic). It’s not best practice.
Is there any other way to do in Snaplogic?
- tlikarishEmployee
You’d either have to change the HTTP method to a post/put or pass in the query string or path. You could file an enhancement request asking for a way to pass custom headers through to pipelines. There are a number of features being worked on to enhance the API management capabilities in the platform, so this might be a good suggestion.
- jshanaiahNew Contributor II
We were unable to file an enhancement request. Is this issue addressed or needs enhancement request?
FYI @kpatnala
- tlikarishEmployee
You can now pass in custom headers to a pipeline. Give this a shot and let me know if you are able to get it working.