how to use external client oAuth access token in inbound scripted REST API

Sagaya1
Giga Expert

Hi,

I have created the external client oAuth access token through https://<instance>.service-now.com/oauth_token.do.

How do i use this access token in scripted REST api script for authentication ?

 

Regards,

Sagaya.

1 ACCEPTED SOLUTION

@Sagaya 

Glad to know that it worked.

Please close the thread as answered by marking my response as correct and helpful If I was able to help/guide you.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

24 REPLIES 24

Sagaya1
Giga Expert

HI Ankur Bawiskar,

Thank you for the information . However even i follow the same steps I got below error message . Please find the attachment.

 

{
    "error": {
        "detail": "Required to provide Auth information",
        "message": "User Not Authenticated"
    },
    "status": "failure"
}

Regards,

Sagaya.

Hi,

So you are getting the access token correctly

But unable to use that.

Did you verify the access token is valid?

Did you check the API which you are consuming has any ACL attached?

check these links for help

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

https://hi.service-now.com/kb_view.do?sysparm_article=KB0565021

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@Sagaya 

Any update on this thread?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Sagaya1
Giga Expert

Hi Ankur,

Still i am unable to access the oAuth token in my API .

could you please help to resolve .

 

Regards,

Sagaya.

 

 

Hi,

So you have created an OAuth endpoint in instance A for external application to get the access token.

where are you trying to get the access token?

is it from same instance A or from another instance B?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader