I am trying to create a SharePoint list view through the SharePoint REST API, with a defined set of columns to be part of the view. The endpoint i am using is below:
POSTMAN API Request:
HTTP METHOD: POST
URL: https://tenantname.sharepoint.com/sites/SPSite/_api/web/lists/getbytitle('ListName')/views Headers:
'Accept' - 'application/json;odata=verbose' 'Content-Type' - 'application/json;odata=verbose' Body (JSON):
{
"__metadata":{
"type":"SP.View"
},
"Title":"TestViewTHI",
"ViewQuery":["Name","Title"]
}
I get a JSON error, since this payload does not seem to be right. Need help in understanding how to create a view with specific fields through the SharePoint REST API.
Thanks, Yesh