REST API SetQueryParameter with specific order, instead of random

Anantha Chinvar
Tera Contributor

Hi

 

This is regarding the REST API outbound call. I need to send Query Parameter in specific order/position 

1. dql

2. items-per-page

3. Page.

 

Third party wanted in the specific order like above. but when we are sending below query it is going as 'page' as first.  How to give a order in the REST API

 

https://xxxx.com/repositories/hrtest?page=1&dql=select * from hr_personnel where workday_number = '1000541637'&items-per-page=100

 

I tried with Substitution, http parameter.  nothing is working.

third party REST API requires in specific position of the parameter.

 

4 REPLIES 4

MrMuhammad
Giga Sage

Hi,

Please check my response to your previous post (link below) and I'd encourage you to avoid creating duplicate threads.

https://community.servicenow.com/community?id=community_question&sys_id=789000b8db011510847d5ac2ca96...

Regards,

Muhammad

Regards,
Muhammad

Anantha Chinvar
Tera Contributor

Variable Substitution is not working for get method. also with endpoint is failing.. error message is invalid query.  same query in postman it is working.

 

https://XXXX/d2-rest/repositories/hrtest?dql=select * from hr_personnel where workday_number = 'xxxx'&page=1

 

not sure whats the issue.

Anantha,

You probably want to urlencode your querystring, that may well help.

Thanks,

Richard

Hi

 

I used the urlEncode still not working.