Upload Files Postman - 403 Error

Mikel Maeso 0 Reputation points
2023-04-10T15:59:13.5866667+00:00

Hi, I have followed mutiple post to be able to upload files to sharepoint using the API. I have registered the APP and given the following permissions:

<AppPermissionRequests AllowAppOnlyPolicy="true">
	<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl"/>
</AppPermissionRequests>

But when I POST the file, I get the following error: User's image

Error details:

917656; Access+denied.+Before+opening+files+in+this+location%2c+you+must+first+browse+to+the+web+site+and+select+the+option+to+login+automatically.

Some other settings I have done: Powershell Config : User's image

Access Control Setup : User's image

The final idea is to be able to upload files from SAP to Sharepoint, in a machine to machine interface, using "client_credentials" Oauth flow. Any clues? Thanks in advance. Mikel

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

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,496 Reputation points Microsoft External Staff
    2023-04-11T07:28:47.92+00:00

    Hi @Mikel Maeso ,

    You can use following powershell cmdlet to fix error 917656.

    Connect-SPOService
    Set-SPOTenant -LegacyAuthProtocolsEnabled $True
    Set-SPOTenant -RequireAcceptingAccountMatchInvitedAccount $False
    
    

    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.