{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1385,"path":"api-reference/web-services/t_ScriptingWithREST.md","title":"Generate a REST message script preview","bundle":null,"doc_type":null,"release":"australia","body":"\n# Generate a REST message script preview\n\nYou can generate an example script to send a REST message based on content and parameters you provide in the method record.\n\n## Before you begin\n\nRole required: web\\_service\\_admin or admin\n\n## About this task\n\nGenerate an example script and use it as a starting point when scripting outbound REST messages.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **System Web Services** &gt; **REST Message**.\n\n2.  Select a REST message record.\n\n3.  In the **HTTP Methods** related list, select an HTTP method record.\n\n4.  Ensure the HTTP method is configured as needed, including any variables.\n\n5.  Save the record.\n\n6.  In the Variable Substitutions related list, assign a value to each variable.\n\n7.  Under Related Links, click **Preview script usage**.\n\n    The instance displays the script that the REST message generated for this method.\n\n    \\[Omitted image \"RESTMessageScriptPreview.png\"\\] Alt text: REST Message Script Preview\n\n8.  Copy this script and modify it as needed to use elsewhere in the instance.\n\n\n## What to do next\n\nRefer to the RESTMessageV2 and RESTResponseV2 APIs for more information on available scripting methods. Outbound REST scripting examples are also available.\n\n**Parent Topic:**[Scripting outbound REST](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/web-services/c_ScriptingOutboundREST.md)\n\n"}}