---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Recordless RESTMessageV2 example

# Recordless RESTMessageV2 example {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read

You can use the RESTMessageV2() constructor with no parameters to define a REST message
entirely in the script.
When using this constructor you must provide an endpoint and HTTP method. In this example,
the script creates an empty REST message and sets the values needed to insert an incident
record.

    var restMessage = new sn_ws.RESTMessageV2();
    restMessage.setBasicAuth("admin", "admin");
    restMessage.setHttpMethod("post");
    restMessage.setEndpoint("http://<instance>.service-now.com/api/now/table/incident");
    restMessage.setRequestBody("{\"short_description\" : \"Test incident\"}");
    var response = restMessage.execute();


