Scoped App - Getting error when calling a REST call in scoped app

ryadavalli
Tera Expert

There is a scheduled job which is calling a script include which inturn is calling the REST message.

Working fine when done in global scope, but I move the same code in scoped app, I am getting following error:

Cannot find function getMessage in object TypeError: Cannot find function setAuthentication in object [object RESTMessageV2]..

6 REPLIES 6

ryadavalli
Tera Expert

Can we cal 'GlideImportSetLoader' from the scoped app ?

Rich_Art
Tera Contributor

I experienced the same in a scoped app. It appears that you'll have to use "setAuthenticationProfile()" instead. (so not "setAuthentication" as the script preview suggests.)

Source: https://developer.servicenow.com/app.do#!/api_doc?v=kingston&id=r_RMV2-setAuthenticationProfile_S_S

(Please mark this as your solution if it worked for you as well.)