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 ?



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.


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 ?



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

Roy did you ever figure out how to do this?