---
sourceDocument: Yokohama API Reference
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/api-reference

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Variable substitution in outbound REST messages

# Variable substitution in outbound REST messages {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

You can use variables when creating outbound REST messages and assign values to those
variables when performing a request.

Variables are allowed in the Endpoint URL, HTTP Header and HTTP Query
Parameter Value fields, and the Content field
for POST and PUT methods.

The syntax for variables is <var class="keyword varname">${variable_name}</var>. The REST message substitutes
this variable with the parameter values provided when the method runs. For example, if the
REST message Endpoint is
http://myserver.mycompany.com/offices/${id}, a parameter named
id must exist and contain a value that can be used when the method
runs.

You can assign a value to variables when running the request using the RESTMessageV2 API
setStringParameter and setStringParameterNoEscape
methods.

When testing an HTTP method that includes variables, the Test value
for each variable in the Variable Substitutions related list is
used.
* **[Generate REST message variables](https://www.servicenow.com/docs/w8Zoc0IirOW9yjhKWXHwsA)**   
  Populate the list of variable substitutions automatically based on variables defined in several REST message HTTP method fields.

