1

I need to get the items of specific author : this is my query :

http://site/sites/fr/_api/web/lists/getbytitle('Activites')/items?$filter=Author eq '1'

the error :

at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx) at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView) at Microsoft.SharePoint.SPListItemCollection.EnsureListItemsData() at Microsoft.SharePoint.SPListItemEntityCollection.TryWriteAsOData(ServerStub serverStub, ODataWriter writer, RESTfulQuery query, ProxyContext proxyContext) at Microsoft.SharePoint.Client.ServerStub.Write(Object value, Uri path, ODataWriter writer, RESTfulQuery query, ProxyContext proxyContext) at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.Process() at Microsoft.SharePoint.Client.Rest.RestRequestProcessor.ProcessRequest() at Microsoft.SharePoint.Client.Rest.RestService.ProcessQuery(Stream inputStream, IList`1 pendingDisposableContainer)

any idea

2 Answers 2

1

You should use AuthorId or Author/Id instead of Author in $filter, and need no apostrophe around the value, like:

http://site/sites/fr/_api/web/lists/getbytitle('Activites')/items?$filter=AuthorId eq 1

If it does not work, you can try this as well:

http://site/sites/fr/_api/web/lists/getbytitle('Activites')/items?$filter=Author/Id eq 1

See this thread as well.

1

this works for me "?$filter=Author/Id eq '" + localStorage["idUser"] + "' &select=Author/Id $expand=Author/id ";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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