Rest Api explorer authorization

craigsnowadmin2
Kilo Guru

experts the "rest api explorer" in servicenow ,  the authorization field is always readonly OOB with value of "send as me" .

Is there a way to change it to use "a different credential " for testing purposes? 

4 REPLIES 4

Nikita Kale
Giga Guru

Hi

 You can impersonate a user with 'rest_api_explorer' role & use the rest api explorer it will use that user's credentials.

Additionally, you can note down that user's token & end impersonation.

Then enter it in the header as shown below:

find_real_file.png

Please mark this response correct if it resolves your query.

Thanks,

Nikita

but which authorization will take precedence "send as me" or created token header. where do you specify the credential

Hi

The created user's token will take the precedence, if you want you can verify the same by writing a scripted rest API and restrict the authorization to the user token...say set an authorization error if anyone else tries to access with a different token. Here's a pictorial representation of what I mean:

1. Unauthorized attempt

find_real_file.png

 

2. Authorized attempt

find_real_file.png

Let me know if you need any more clarification.

If this resolves your query please mark the answer as correct.

Thanks,

Nikita

Hi @craigsnowadmin2 

Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.

Thanks
Nikita