{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1232,"path":"api-reference/web-services/c_VariableSubstitutionREST.md","title":"Variable substitution in outbound REST messages","bundle":null,"doc_type":null,"release":"australia","body":"\n# Variable substitution in outbound REST messages\n\nYou can use variables when creating outbound REST messages and assign values to those variables when performing a request.\n\nVariables are allowed in the **Endpoint** URL, HTTP Header and HTTP Query Parameter **Value** fields, and the **Content** field for POST and PUT methods.\n\nThe syntax for variables is *$\\{variable\\_name\\}*. 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.\n\nYou can assign a value to variables when running the request using the RESTMessageV2 API setStringParameter and setStringParameterNoEscape methods.\n\nWhen testing an HTTP method that includes variables, the **Test value** for each variable in the **Variable Substitutions** related list is used.\n\n-   **[Generate REST message variables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/web-services/t_GenerateMessageVariables.md)**  \nPopulate the list of variable substitutions automatically based on variables defined in several REST message HTTP method fields.\n\n**Parent Topic:**[Outbound REST web service](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/web-services/c_OutboundRESTWebService.md)\n\n"}}