Issue connecting Copilot to ServiceNow

RogueFader
Tera Expert

Hello

I'm totally new to creating AI agents, and my knowledge of ServiceNow is limited to little more than creating reports.

I've been asked to create an AI agent that teams can use which can search SN for knowledge articles, problems, previous incidents etc... also to search external sources such as Sharepoint etc.

Within the Sandbox for Copilot Studio, I've created an agent and attempted to add ServiceNow as a source for knowledge.

 

Authentication Type  I leave as Oauth2

I enter instance Name, Client Id and Client Secrets, and it constantly throws me an error, is anyone familiar with this and what it is I'm doing or not doing? Thanks in advance.

 

"Failed to create connection for connection id '/providers/Microsoft.PowerApps/apis/shared_service-now/connections/shared-service-now-c83fac59-1da6-4f97-9df7-3600ab766ddd'. The request failed with client error: 'Input parameters are invalid. See details for more information. Details:errorCode: InvalidServiceProviderParameter. Message: Service provider parameter value failed validation: name=InstanceName, pattern=^[^.://\?]{0,127}$'. The correlation Id is '00af34f6-80e3-416c-a'."

 

 

5 REPLIES 5

Daniel Makarenk
Tera Contributor

Exactly the same issue here...can't find anything online so far.

BasicAuth works fine, but I need OAuth 2.0

For the URI use the instance name instead of the full URL.

 

i.e. yourservicenowinstance

Don't use https://yourservicenowinstance.com/

That works, cheers mate.

Another question, what do you use in the Redirect URL in Oauth 2.0 that you created in ServiceNow?

I have tried the following: 

For M365 Enterprise: https://gcs.office.com/v1.0/admin/oauth/callback,
For M365 Government: https://gcsgcc.office.com/v1.0/admin/oauth/callback

Doesn't work.

DanielMakarenk_1-1752833491199.png

 

I was using the URI instead of the full URL and still get 

Invalid redirect_uri