I want to know how I can add a Guest Reader site user on my OneDrive. Since a Guest Reader is for a particular file, I want to know if I can add such a user through REST API. I am looking for something like
https://{mysite URL}/_api/Web/siteusers
Method POST
Body
{ '__metadata': { 'type': 'SP.User' }, 'LoginName':'SHAREPOINT\\reader_blabla'}
where blabla is the UniqueId of my file (with dashes removed)
Content-Type
application/json;odata=verbose
Accept
application/json;odata=verbose
Response
{
"error": {
"code": "-2130575276, Microsoft.SharePoint.SPException",
"message": {
"lang": "en-US",
"value": "The user does not exist or is not unique."
}
}
}
I have read here that you can add site users to sitegroups, so lets say if I do as the instructions say, I have a limited access group with id 14
https://{mysite URL}/_api/Web/sitegroups(14)/users
The body and headers are the same. Still I get the same error. What am I doing wrong?