1

I seem to be having a problem making a rest call to create a list or add a user to a SharePoint group. Both give me the same error -

Response: {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified."}}}

I've followed a few different guides and googled the issue, but cant resolve it. Interestingly I have a workflow using REST that creates a sharepoint site ok.

this is what I am following - http://codelesssharepointinfopath.com/workflow-useful-rest-calls-add-user-to-group/

Here is my workflow -

Image

The workflow emails me all the dictionaries/variables that are used -

URL: http://abc.abc.com/_api/web/sitegroups/GetByName('trainees')/users

Meta: {"Type":"SP.User"}

Params: {"__metadata":{"Type":"SP.User"},"LoginName":"i:0#.w|abc\\nick"}

Request Header: {"Accept":"application\/json;odata=verbose","Content-Type":"application\/json;odata=verbose"}

Response Code: BadRequest

Response: {"error":{"code":"-1, Microsoft.SharePoint.Client.InvalidClientQueryException","message":{"lang":"en-US","value":"An entry without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified."}}}
3

This is because of a minor typo in the post data. The "t" in the "type" object property should be lower case:

{"__metadata":{"type":"SP.User"},"LoginName":"i:0#.w|abc\\nick"}

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.