<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Outbound REST API special character not passing ? in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/outbound-rest-api-special-character-not-passing/m-p/1817542#M474468</link>
    <description>&lt;P&gt;Try to Test the REST API variable substitutions of special character (%) , its returns 500 error&lt;/P&gt;
&lt;P&gt;and If we remove % , its inserted correctly&lt;/P&gt;
&lt;P&gt;Its outside application issue where we inserting the record? or ServiceNow Issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/45432iE7CACE776957F4B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 11 Sep 2022 04:07:01 GMT</pubDate>
    <dc:creator>sukran</dc:creator>
    <dc:date>2022-09-11T04:07:01Z</dc:date>
    <item>
      <title>Outbound REST API special character not passing ?</title>
      <link>https://www.servicenow.com/community/developer-forum/outbound-rest-api-special-character-not-passing/m-p/1817542#M474468</link>
      <description>&lt;P&gt;Try to Test the REST API variable substitutions of special character (%) , its returns 500 error&lt;/P&gt;
&lt;P&gt;and If we remove % , its inserted correctly&lt;/P&gt;
&lt;P&gt;Its outside application issue where we inserting the record? or ServiceNow Issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/45432iE7CACE776957F4B9/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2022 04:07:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/outbound-rest-api-special-character-not-passing/m-p/1817542#M474468</guid>
      <dc:creator>sukran</dc:creator>
      <dc:date>2022-09-11T04:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Outbound REST API special character not passing ?</title>
      <link>https://www.servicenow.com/community/developer-forum/outbound-rest-api-special-character-not-passing/m-p/1817543#M474469</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;It is the issue with the special character.&amp;nbsp; Please use Escape type as with escape instead of "No escaping"&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Narsing&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2022 04:30:46 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/outbound-rest-api-special-character-not-passing/m-p/1817543#M474469</guid>
      <dc:creator>Narsing1</dc:creator>
      <dc:date>2022-09-11T04:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Outbound REST API special character not passing ?</title>
      <link>https://www.servicenow.com/community/developer-forum/outbound-rest-api-special-character-not-passing/m-p/1817544#M474470</link>
      <description>&lt;P&gt;&lt;SN-MENTION class="sn-mention" table="live_profile" sysid="d5ae862ddbd41fc09c9ffb651f96192f"&gt;@Narsing&lt;/SN-MENTION&gt; tried but same error&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2022 06:13:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/outbound-rest-api-special-character-not-passing/m-p/1817544#M474470</guid>
      <dc:creator>sukran</dc:creator>
      <dc:date>2022-09-11T06:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Outbound REST API special character not passing ?</title>
      <link>https://www.servicenow.com/community/developer-forum/outbound-rest-api-special-character-not-passing/m-p/1817545#M474471</link>
      <description>&lt;P&gt;Hello Sukran,&lt;/P&gt;
&lt;P&gt;I am not sure on how you can pass the % in Rest message via variable substitution but if you try to call the Rest Message API via script and then pass the data that include % character in request body then it will not give an error. Please refer to the below script:&lt;BR /&gt;&lt;EM&gt;&lt;STRONG&gt;var requestBody = {"name": "ServerTesting1%"}; &lt;/STRONG&gt;&lt;/EM&gt;is the request body set in the below example and the Server is created with &lt;EM&gt;&lt;STRONG&gt;ServerTesting1%&lt;/STRONG&gt;&lt;/EM&gt; name in target instance.&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;(function () {
	var tableName = "cmdb_ci_server";
	var requestBody = {"name": "ServerTesting1%"};
	var RESOURCE_PATH = "/api/now/table/cmdb_ci_server";
	var request = new sn_ws.RESTMessageV2();
	request.setEndpoint("https://&amp;lt;YOUR_INSTANCE_URL&amp;gt;.service-now.com/"+RESOURCE_PATH );
	request.setHttpMethod('POST');
	//request.setQueryParameter("sysparm_query", "name=ApplicationServerHelpdesk");

	//Eg. UserName="admin", Password="admin" for this code sample.
	var user = 'admin'; //replace your user name here
	var password = 'admin'; // replace user's password here
	request.setBasicAuth(user,password);

	//gs.print(JSON.stringify(requestBody));
	request.setRequestBody(JSON.stringify(requestBody));

	request.setRequestHeader("Accept","application/json");
	var response = request.execute();
	var responseBody = response.getBody();
	gs.print(responseBody);
})();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Please mark my respsone as helpful/correct, if it answer your question.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 11 Sep 2022 09:24:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/outbound-rest-api-special-character-not-passing/m-p/1817545#M474471</guid>
      <dc:creator>Mahendra RC</dc:creator>
      <dc:date>2022-09-11T09:24:33Z</dc:date>
    </item>
  </channel>
</rss>

