REST API INTEGRATION WITH SHAREPOINT Online (Without OOB SPOKE)

GB14
Kilo Patron

We’re working on integrating ServiceNow with a SharePoint Online list (without using the SharePoint spoke). Has anyone successfully done this and can share the steps or point us in the right direction?

 

We’re able to obtain the OAuth token successfully, but we’re running into issues when trying to create or update a list item.

 

The error from the logs is:

 

*** Script: SharePoint API call failed. Status: 401 Response: {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":{"lang":"en-US","value":"Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"}}}: no thrown error

 

Any guidance would be appreciated.

12 REPLIES 12

@Ankur Bawiskar 
Thanks, It does, but where are these permissions? In Azure, we have granted the Sites.FullControl.All delegate role. Any guidance what else needs to be checked and where for permissions? 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @GB14 

If you ask whether inheritance is possible—yes, you can do it.
But is it a recommended approach? I would say no.

Why build something that ServiceNow already provides as part of its spoke?
If you run into issues, ServiceNow may not support it, since it would be considered a customization.
You’ll likely have to handle the troubleshooting on your own.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

@Dr Atul G- LNG 

Thank you! 
why build? The COST is the main concern for us in this case. It is included in the enterprise IH package but we don't have that subscription and not planning to get it near future either. 

 

 

 

Hi @GB14 

I 100% agree that there’s a cost involved, but the key issue here is whether that cost is justifiable—especially considering the amount of effort you're putting into building and maintaining this custom API.

Right now, you're stuck at the first step, and hopefully that gets resolved soon.
But if you encounter another issue, things could become even more difficult and time-consuming.

That’s why I’m suggesting that using the out-of-the-box spoke is the better and safer option.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

SumanthDosapati
Mega Sage
Mega Sage

@GB14 

It is not authentication issue. It is access issue. 

Check this link to understand better.

 

Accept the solution and mark as helpful if it does, to benefit future readers.
Regards,
Sumanth