SharePoint API authorization token

New Contributor

I am attempting to build an integration between the product the company I work for sells, and SharePoint. 


The purpose of the app is to create a folder or site structure based on data, and retrieve links to the files users upload to that structure so we can redirect people to them.


The admin that takes care of our office365 set up the app, and I can get access tokens, but I get "Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedException' was thrown." or "Unsupported app only token." as a response.


Here is how I am getting the token:


URL:<<tenant ID>>/oauth2/v2.0/token


Headers: Content-Type: application/x-www-form-urlencoded


Body (without URL encoding): client_id=<<client ID>>&scope=<<client secret>>&grant_type=client_credentials


Request Type: POST


Here is an example of what I am attempting to send (a request to get a list of files in a folder):




Headers: Authorization: bearer <<Access Token>>

          Accept: application/json;odata=verbose


Request Type: GET

0 Replies