Hello @Praba Kar , Thank you for reaching out. I believe the following error "Error message: An unexpected 'EndOfInput' node was found when reading from the JSON reader. A 'StartObject' node was expected.
" is coming up as you might not have supplied the payload in the body in correct format i.e:
{
"@odata.id": "https://graph.microsoft.com/v1.0/users/6e821af1-5289-4011-983d-634abf48e7b7"
}
I tried the Postman tool to assign a manager to a user and it worked fine for me.
You need to specify "@odata.id
" as the key in the supplied JSON Body for it to work. The following line in your code graphServiceClient.users(parentObjectGuid).manager().reference().buildRequest().put(directoryObject);
should send the body with the key as @odata.id. If it's not I would suggest debugging the application once and check why that @odata.id is not being sent as the JSON payload in the body of the request.
Hope this helps.
Do let us know if this helps and if there are any more queries around this, please do let us know so that we can help you further. Also, please do not forget to accept the response as Answer; if the above response helped in answering your query.