The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Using Ampersand (&) with REST API with Parameters

mauricio23
Mega Expert

Greetings!

How should I be encoding Ampersand (&) in my parameters when using the REST API?

I'm using Perl to make a call ... and it is failing due to the Ampersand (&). In the code sample below, I want query Department=Development & Architecture.

$client->GET("/api/now/table/cmn_department?sysparm_limit=10&sysparm_query=name=Development & Architecture",

                             {'Authorization' => "Basic $encoded_auth",

                                                                 'Accept' => 'application/json'});
1 ACCEPTED SOLUTION

Daryll Conway
Giga Guru

you can use "%26" or "&" in place of ampersand (&)


View solution in original post

2 REPLIES 2

Daryll Conway
Giga Guru

you can use "%26" or "&" in place of ampersand (&)


Actually - this one works!!!!




      "/api/now/table/cmn_department?sysparm_limit=10&sysparm_query=name=Development %26 Architecture",