---
original_url: "https://jace.pro/blog/recordless-rest-is-great/"
format: markdown
ai_optimized: true
---

Recordless Rest Is Great# Recordless Rest Is Great

September 15, 2019 [rest-api ](/tags/rest-api/)[servicenow](/tags/servicenow/)

  Enable AI AnimationIt seems this page was lost in the rearranging of files. I pulled it out
of storage

I often use the record-less rest calls to test things. I didn’t see it on
my blog, so here’s an example so I can find it in the future.\

`var instance = "dev40379";
var requestBody = {
  short_description: "test incident"
};
var restMessage = new sn_ws.RESTMessageV2();
restMessage.setBasicAuth("slack", "slack");
restMessage.setHttpMethod("post");
restMessage.setEndpoint("http://"+ instance +".service-now.com/api/now/table/incident");
restMessage.setRequestBody(JSON.stringify(requestBody));
var response = restMessage.execute();
var error = response.haveError();
if(error){
  var errorCode = response.getErrorCode();
  var errorMsg = response.getErrorMessage();
} else {
  
}
var headerVal = response.getHeader("Content-Type");
var headers = response.getHeaders();
var queryString = response.getQueryString();
var statusCode = response.getStatusCode();
var responseBody = response.getBody();
gs.info(statusCode);
gs.info(responseBody);
/**
* *** Script: 201
* *** Script: {"result":{"parent":"","..."}}
*/`
---
[View this page on GitHub](https://github.com/jacebenson/jace.pro/tree/main/./src/posts/2019/2019-09-14-recordless-rest-is-great.md).

[Recordless Rest Is Great](https://jace.pro/blog/recordless-rest-is-great/) [Jace Benson](https://jace.pro) ![Jace Benson](https://jace.pro/icon-512x512.png)

---

*This content is from Jace Benson's ServiceNow and tech blog at jace.pro*
*Original post: https://jace.pro/blog/recordless-rest-is-great/*
