I'm facing an issue in uploading the files to sharepoint while I'm able to generate the token but while trying to upload the file it is throwing an error {"error_description":"Exception of type 'Microsoft.IdentityModel.Tokens.AudienceUriValidationFailedEx

Anonym 0 Reputation points
2024-05-27T05:33:33.37+00:00

User's image

This I'm getting after trying to upload the file

User's image

I'm able to generate the token and I've given full control permission also.

I've followed this blog and this collection
https://community.sap.com/t5/technology-blogs-by-members/sharepoint-integration-using-sap-cpi-without-sap-open-connector/ba-p/13495160

Please help me sort this issue as soon as possible

Microsoft 365 and Office SharePoint Server For business
Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,471 Reputation points Microsoft External Staff
    2024-05-27T07:56:50.6433333+00:00

    Hi @Anonym,

    You could put the accesstoken in request header and use the api like following

    http://test.sharepoint.com/sites/testsite/_api/web/GetFolderByServerRelativeUrl('/sites/testsite/library name')/Files/add(url='a.txt',overwrite=true)
    

    User's image

    For more detail steps you could refer to following artilce

    https://global-sharepoint.com/sharepoint-online/in-4-steps-access-sharepoint-online-data-using-postman-tool/


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.