In this Article I'm going to show you how to use HEADERS in the REST Component.
This builds upon a past article but shows using Parameters in Headers.
- Workflow - REST Generator
- Using the REST Generator in Workflow 7.6
- Using the REST Generator (GET) in Workflow 7.6 with Mobility Suite
- Using the REST Generator (Headers) in Workflow 7.6 with Mobility Suite
- Using the REST Generator (POST) in Workflow 7.6 with Mobility Suite
- Using the REST Generator (Response Content) in Workflow 7.6
- Using the REST Generator (PATHs) in Workflow 7.6
- Workflow - Read Write JSON
- Workflow - REST - Response Header
I noted before that
| **Warning!**Passing the API key as a query parameter is not recommended and is deprecated.
Support for passing the key via URL parameters will be removed in the near future. |
| --- |
So to rectify this we can pass it in the Header.
When you're creating the REST Generator there is a "Headers..." button, click this.
Now add the requried values.
Content-Type | application/json |
---|---|
X-Nukona-API-Key-v1 | [lockapikey] |
Here [lockapikey] is a parameter denoted by the square brackets [ ].
If you have multiple methods make sure to name this apikey differently each time or you will get an error.
This will then be available within the Workflow.
Once completed you can then set the Properties on your variable.
Now in your Workflow you can set the API Key dynamically.
I like to use Profile Properties within Process Manager, so there is one place to maintain/administer it.
There is also a StatusCode you can get returned from the REST Generator, give this a name, but to use it you will need to declare it before.
Use an Add Data Element and give it the same name.
You can then use this Status Code for logging etc
Previous Articles