Assign variable to Request Header value for REST API call ?

Assign variable to Request Header value for REST API call ?

  

Hi there,

Just starting out with outsystems and one of the key features I need is the ability to be able to read and write from REST interfaces.

First REST API I am trying to setup uses an API key. I'd like to be able to gather this from the user, I've setup an INput field that does this and stores the value in a variable.

I've then got my REST API defined and the header field set that I now need to put the variable into to then make the call. I can see where to put a value for this in the Test area, but can't seem to work out how to add my variable 'MerakiAPIKey' and assign the value of it to my header X-Cisco-Meraki-API-Key ?


Any help ?


Thanks,

Roy.


Hello Roy, 

Did you already take a look in the online presentation on WebServices (REST)?
Or the online documentation?

You have some actions that can be handy on those situations, like the OnBeforeRequest, where you can manipulate the data and headers of the REST request.

https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/REST/Consume_REST_APIs/Simple_Customizations

https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/REST/Consume_REST_APIs/Advanced_Customizations

Cheers.

Thanks. Got that added, but it's now this bit "Add your own logic to customize the request." that I'm stuggling with. How do I set the value of my header X-Cisco-Meraki-API-Key  yo be equal to what's in my variable MerakiAPIKey ?


Thanks,

Roy.


What I mean is I can't seem to see a way to set my Header to be a variable.