Permissions needed in order to save a file into sharepoint from Salesforce.

SB 21 Reputation points
2022-12-20T08:57:28.887+00:00

I am trying to create an integration to SharePoint from Salesforce. I was given access to a folder in the organization. In order to establish the connection, I created an app in sharepoint, copied the client Id and Secret to Salesforce and setup the connection.

Once I gave the permissions for the app and save, It asked me whether I could trust this app. But the Trust button was disabled with a message ' Your tenant admin needs to approve the app'. How can I resolve this?

My purpose is save a file from Salesforce to SharePoint and I have only access to that particular folder in sharepoint. What SharePoint permissions do I need in that folder in order to make the integration save a file in that folder?

Suppose https://xxxxxxxx.sharepoint.com/sites/587923/xxxxxx%20Beige/Shared%20Documents/Forms/AllItems.aspx?csf=1&web=1&e=NCyMPQ&cid=8700f339%2Wgyj6%22toQM%2WWmab%Rouwzy&RootFolder=%2Fsites%2F587923%2Fxxxxx%20Beige%2FShared%20Documents%2F1990%5FDecommision%20Webstore%2FWQ%2FCorrupt%20Device&FolderCTID=0x078041695E36FC94D7D5B2Af9E548FI89SF8 is the path to my folder 'Corrupt Device' from the address bar, then what should be the endpoint url to be provided in order to issue a POST request to SharePoint?

I am totally confused with the endpoint url. Can you please provide an answer to these questions?

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

Accepted answer
  1. Tong Zhang_MSFT 9,251 Reputation points
    2022-12-21T02:12:32.983+00:00

    Hi @SB ,

    Once I gave the permissions for the app and save, It asked me whether I could trust this app. But the Trust button was disabled with a message ' Your tenant admin needs to approve the app'.

    To help you better, is the error you described as shown in the screenshot below?
    272674-image.png

    If yes, please use https://xxxx-admin.sharepoint.com/_layouts/15/appinv.aspx to grant permissions to the newly created principal.

    272615-01.png

    According to my research and testing, you can use the following Rest API to upload file to SharePoint (Per my test, we need to grant the APP Write, Manage, or FullControl permissions when we upload file to SharePoint):

    _api/Web/GetFolderByServerRelativeUrl('/sites/abc/FolderTest/Test')/Files/add(url='rename.xlsx',overwrite=true)')  
    

    More information for reference:
    Upload a file by using the REST API and jQuery
    Granting access using SharePoint App-Only

    Hope it can help you. Thanks for your understanding.


    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.


    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

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.