1

I want to add a (new) external user to an Office365 Sharepoint site

This article: https://dev.office.com/patterns-and-practices-detail/1870 has this piece of code:

SharingResult result = ctx.Web.ShareSite("someone@example.com", ExternalSharingSiteOption.Edit,true, "Here's a site shared for you.");

Especially this remark gives me hope:

Notice - This capability is also available with RESTful interfaces.

I know how to get lists etc... using REST (and OAuth) but I cannot find the endpoint and payload (JSON) to send to this endpoint to achieve my goal.

=== update ====

When I post JSON to this endpoint

https://*****.sharepoint.com/sites/*****/_api/SP.Web.ShareObject

JSON

{
"url":"https://*****.sharepoint.com/sites/*****/",
"peoplePickerInput":"external user @ otherorg.com",
"sendEmail":"true",
"emailSubject":"Hello World"
}

I get this error:

"ErrorMessage": "SPWeb.ShareObjectInternal: no resolved users. >ShareByEmailEnabled: False, CanPickerAcceptAnyEmail: False

Does this mean a misconfiguration in SharePoint or should I provide my new external user in a different way ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.