Share Object method child items - Sharepoint rest api

Regular Visitor

Hello, 

 

I'm using the SP.Web.ShareObject method through rest to grant access to a folder for an external user and it works ok, but the user can't see the files inside this folder. Here's the body of my call :

 

{
   "url":"https://example.sharepoint.com/sites/mySite/Shared Documents/folder",
   "emailBody":"test",
   "emailSubject":"test",
   "peoplePickerInput":"[{'Key' : 'example@hotmail.com', 'Description' : 'example@hotmail.com', 'DisplayText' : 'example      @hotmail.com', 'EntityType' : '', 'ProviderDisplayName' : 'Tenant', 'ProviderName' : 'Tenant', 'IsResolved' : true, 'EntityData' :      {'SPUserID' : 'example@hotmail.com', 'IsBlocked' : 'false', 'PrincipalType' : 'UNVALIDATED_EMAIL_ADDRESS', 'AccountName':'example@hotmail.com', 'SIPAddress': 'example@hotmail.com', 'Email' : 'example@hotmail.com'}, 'MultipleMatches' : []}]",
   "includeAnonymousLinkInEmail":false,
   "roleValue":"role: 1073741827",
   "propagateAcl":true,
   "sendEmail":true,
   "useSimplifiedRoles":true
}

 I tried with different roleIds (Design, Edit, Contribute...) but without success. Can't see the items in that folder. Here's the response of the post call :

 

{
    "d": {
        "__metadata": {
            "id": "https://exaple.sharepoint.com/sites/mySite/_api/SP.Web.ShareObject",
            "uri": "https://example.sharepoint.com/sites/mySite/_api/SP.Web.ShareObject",
            "type": "SP.SharingResult"
        },
        "GroupsSharedWith": {
            "__deferred": {
                "uri": "https://example.sharepoint.com/sites/mySite/_api/SP.Web.ShareObject/GroupsSharedWith"
            }
        },
        "GroupUsersAddedTo": {
            "__deferred": {
                "uri": "https://example.sharepoint.com/sites/mySite/_api/SP.Web.ShareObject/GroupUsersAddedTo"
            }
        },
        "UsersWithAccessRequests": {
            "__deferred": {
                "uri": "https://example.sharepoint.com/sites/mySite/_api/SP.Web.ShareObject/UsersWithAccessRequests"
            }
        },
        "ErrorMessage": null,
        "IconUrl": "https://example.sharepoint.com/sites/mySIte/_layouts/15/images/folder.gif",
        "InvitedUsers": {
            "__metadata": {
                "type": "Collection(SP.SPInvitationCreationResult)"
            },
            "results": [
                {
                    "Email": "example@hotmail.com",
                    "InvitationLink": "https://example.sharepoint.com:443/:f:/s/mySite/EljmogCD1ilFiiKoDPn?email=example%40hotmail.com",
                    "Succeeded": true
                }
            ]
        },
        "Name": "folder",
        "PermissionsPageRelativeUrl": null,
        "StatusCode": 0,
        "UniquelyPermissionedUsers": {
            "__metadata": {
                "type": "Collection(SP.Sharing.UserSharingResult)"
            },
            "results": []
        },
        "Url": "https://example.sharepoint.com/sites/mySite/Shared%20Documents/folder",
        "UsersAddedToGroup": null
    }
}

Does anyone know how to solve this ?

Thanks

 

0 Replies