To add up on Mostafa answer, let me state the following:
- When you consume a REST API, you can specify URL variables, like {environment}, {domain}, etc. that will be replaced at "call time" with the corresponding input values. Once you define these variables as such, OutSystems will create the required number of input parameters (so, again, OutSystems can replace the variables with the passed values at runtime).
- It seems to me that what you're looking for is a bit different. Meaning, it's still a variable, but it doesn't serve the purpose that {variables} in REST URL's have. It's more of a setting than an actual variable.
- I suggest one of two approaches:
1, preferred) Define the REST URL with the variables as OS intended (in your case {domain_id}) and then encapsulate the call to the REST method. This encapsulation will only take the inputs that should behave as, well, variables and inside said encapsulation do the necessary logic to fill out the settings. Something like:
client.callMethod(id) and your callMethod action would have callREST(domain, id). I know this is a bit of high code, but should help.
2, possible) Use the OnBeforeRequest to modify the request URL, but you need to make sure the settings part of the URL are known at the server level (so you can actually get them). You can't use a Client variable for that, since the name says it all: it's a client variable, not a server variable. If the CampaignId is set at the client level (which seems like something that could totally come from the server), you'll need to pass that as well.
Let me know if this helps.