- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 12:16 PM
Hi,
I have a Client Script variable:
contentUrl = "mySite";
I pass this variable to the Script include and then pass the variable to the REST message
siteTokenRequest.setRequestHeader('siteContentUrl',contentUrl);
I also tried:
siteTokenRequest.setQueryParameter('siteContentUrl',contentUrl);
When I usde the actual "siteContentUrl" value the request is successful. However, when I use variable substitution ${siteContenUrl} the REST request fails.
Any thoughts?
Sincerely,
Roland
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 01:18 PM
try using
siteTokenRequest.setStringParameterNoEscape('siteContentUrl', contentUrl);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-28-2018 01:18 PM
try using
siteTokenRequest.setStringParameterNoEscape('siteContentUrl', contentUrl);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2018 06:21 AM
Thank you Mike,
This didn't work. Also I was under the assumption that setStringParfameterNoEscape was used to set parameters for the endpoint and using setQueryParameter was used to set parameters for the http query, but I haven't found a sample or explanation how to set a variable in the content of a post.
Sincerely,
Roland
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2019 05:28 AM
Hi, Is there another way, another method, to pass this variable from the include script to the REST message? I tried different formats/methods and none seem to work.
Sincerely,
Roland

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2019 06:53 AM
On your content tab you need something like. Value of JSON also needs quotes and use
siteTokenRequest.setStringParameterNoEscape('siteContentUrl', contentUrl);
{
"credentials":{
"name":"<user-name>",
"password":"<password>",
"site":{
"contentUrl":"${siteContentUrl}"
}
}
}