Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

Error Using REST API to Retrieve SharePoint content

$
0
0

I am developing a rather simple application that retrieves files from SharePoint using the REST Office 365 API. This is a batch job running in the background with no user interface so the following simple 2-step  flow is what I'm doing:

(1) Requesting an Access Token from Azure AD (supplying client ID, client secret, resource, and grant_type=client_credentials) 

(2) Invoke the SharePoint API (https://{base url}/_api/v1.0/Files) using the "Authorization: Bearer <access_token>" as a request header .

That process seems pretty straightforward and sounds simple but I keep getting the following error :

401 Unauthorized

x-ms-diagnostics:  3001000;reason="There has been an error authenticating the request.";category="invalid_client"

Any idea what the problem is and how this can be resolved ? I have been stuck on this for days now. I would REALLY appreciate somebody's help with this. Thanks.

- CW


Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>