Tag Info

Hot answers tagged

7

unfortunately, afaik (& tested) the REST services are only working for authenticated users. You'll need to create a bridge service calling with credentials the native ones if you want to provide that functionality but since you're authenticating your request, are you sure it's not an authentication issue ? Does the target username / password combination ...


6

In order to select User or Lookup field values the $expand operator is used (for making a projection of AnnouncedBy column with User Information List). For example, the following query https://contoso.sharepoint.com/news/_api/web/lists/getByTitle('Announcements')/items?$select=*,AnnouncedBy/Title&$expand=AnnouncedBy will return the following result: ...


5

This took forever to figure out, but of course it is simple once you got it. Instead of pasting a bunch of code, here is the context and then the raw HTTP POST request that I ended up with. The documentation is actually right here: http://msdn.microsoft.com/en-us/library/dd962796(v=office.12).aspx Syntax for the slug header is as following: ...


5

Date and time OData functions: day() month() year() hour() minute() second() does not seem to work with SharePoint 2013 REST Service Error: The query is not valid But you could consider the following approaches. Option 1 Utilize SharePoint 2010 REST endpoint: /_vti_bin/listdata.svc/ListName?$filter=month(<DateColumn>) eq <MonthNumber> ...


4

The $skip parameter does not work in SharePoint 2013 for list items. It only works for collection of data (like list collections, ecc..). See my comment at the end of this article: http://msdn.microsoft.com/library/d4b5c277-ed50-420c-8a9b-860342284b72.aspx


4

Choice fields are returned with a Value without the need for expansion: Example: IP_WorkflowStatus = IP_WorkflowStatusValue Here is an example of a query without using expansion: $filter=IP_WorkflowStatusValue eq '2-Validated' If you want to use expansion, then you need to use expanded field notation Relation/Field: $filter=IP_WorkflowStatus/Value eq ...


3

You will need the Id of the Employee whose children you want to fetch. Syntax: https://[My SharePoint]/_api/web/lists/MyList/items?$select=ChildName&$expand=FieldValuesAsText/Employee&$filter=Employee eq 1 This will return the 'ChildName' field of all items in which the user with Id 1 occurs in the 'Employee' field Update: For getting the Id of ...


3

I have various parameters for testing ODATA API And have tested: "_api/Web/Lists/getByTitle('Documents')/itemcount" result: Is equivalent of "_vti_bin/ListData.svc/Documents/$count" the result is fast and immediate: with this "/_vti_bin/ListData.svc/listname?$inlinecount=allpages" add to result as field called "count", see image below: You can ...


3

I see the same issue on SP2013 online with the new OData V3 _api endpoint. For CRUD operation it might be better to use the OData v2 listdata.svc endpoint for the time being.


3

Yes, you can expand multiple columns: /_api/web/lists(guid'<guid>')/items?$select=Title,LookupField1/FieldToBeExpanded1,LookupField2/FieldToBeExpanded2&$expand=LookupField1,LookupField2


3

Try adding following in the URL $select=AnnouncedBy/Id,AnnouncedBy/Title,*&$expand=AnnouncedBy Reference: SharePoint 2013–retrieving the lookup value of User fields using the REST API Getting User Information with the SharePoint 2013 REST API


3

As far as I know it is not supported to apply $filter or $select expression for the endpoint: http://<sitecollection>/<site>/_api/web/lists(listid)/getItems(query) To summarize: CAML and OData query could not be combined. From another hand, since expanding of User Fields is not supported in CSOM/REST i would suggest to construct your ...


2

Unfortunately, the REST API with Javascript will not give you the recurring calendar items. If you want to retrieve the recurring calendar items with client side code, you need to take a look at SPServices: http://spservices.codeplex.com/ Take a look at this thread: http://spservices.codeplex.com/discussions/254560


2

It is not supported for multiselect fields (i.e. fields represented in the normal UI as check boxes). The following quote is for 2013 but the same rules apply for the ListData.svc. You can filter on the client side, though, depending on how you represent the data and the controls you use. Queries for multi-value lookup fields and users Because ...


2

When updating a list item you should use the uri from the metdata of the list item you want to edit results[i].__metadata.uri. $(document).ready(function () { var defaultClient = OData.defaultHttpClient; var spClient = { request: function (request, success, error) { request.headers = { "Accept": "application/json;odata=verbose", ...


2

Remove the "eq true" from your query. http://server/site/subsite/_api/Lists/getbytitle('SomeList')/items?$filter=startswith(Title, '[%Variable: StringToMatch%]')


2

You are missing ID in expand. The query should look like: _api/Web/Lists(guid'id')/items?$select=Id,Author/ID&$expand=Author/ID&$filter=(Author/ID eq 21)


2

Having worked with & built similar stacks for extending/integrating SharePoint with external LOB systems, I can say our approach has been to attack it from the other end. That is, rather than trying to use the BCS to connect to an on-prem DB, we'd create a RESTful WCF service that ran on-prem alongside the DB (could be OData as well if based off a ...


2

According to OData specification: The syntax of a $expand query option is a comma-separated list of Navigation Properties. Additionally each Navigation Property can be followed by a forward slash and another Navigation Property to enable identifying a multi-level relationship. In your example, List Item resource does not expose RootFolder ...


2

The syntax of your query seems correct. Most probably this error occurs since $select and $expand operators are case-sensitive. Try the following query: /_api/web/lists/getByTitle('Customer')/items?$select=Parent/Title&$expand=Parent


2

Issue got resolved after updating the SQL 2012 Server(PowerPivot) version to SP1 and changing the account for SQL Server Analysis Services (PowerPivot) to Local System account. Also, the service account used for the Excel Services Application needs to be set as an Analysis Services administrator. MSDN reference link


2

Since AssignedTo is a multi-user field, you'd receive an array. You can then loop into the array and receive specific properties such as title or id. Make sure the properties are in the $select. See the example below: var call = $.ajax({ async: false, url: _spPageContextInfo.webAbsoluteUrl + "/_api/Web/Lists/GetByTitle('Tasks')/items" + ...


2

Since the original query: $filter=Created ge datetime'<startdate>' and Created lt datetime'<enddate>' includes all the items that have been created between startdate and enddate the following query in opposite excludes items that have been created in this date interval: $filter=Created lt datetime'<startdate>' or Created ge ...


1

You could also filter fields by SPField.CanBeDeleted property in order to get the list of questions from a Survey List How to get the list of questions from a Survey List via REST API /_api/Web/Lists/getByTitle('Survey')/fields?$filter=(CanBeDeleted eq true)


1

If you navigate to the service root you'll see all the lists that are exposed by the service. /_vti_bin/listdata.svc/


1

If you want to do this as a single request, then I suggest you take a look at the search API. The way you are doing it, won't be manageable, if possible at all unless you are able to do it with Macros and an iterative approach. http://msdn.microsoft.com/en-us/library/office/jj163876%28v=office.15%29.aspx Using this you can filter by URL, Current Site, ...


1

If I understand you correctly you need ListName or ListGuid of Lookup field ? You can get it from /_api/lists/getbytitle('list1')/Fields - here you find Author Lookup field and Guid of list you are looking for. Inside of Field XML you get this, like in my example: <d:LookupList>{5cc890cb-1974-4142-9939-c41c2539e03e}</d:LookupList> To get ...


1

There is no need to use $expand operator if you don't need to return the projected fields. The following REST endpoint demonstrates how to filter by Author Id: /_api/Web/Lists/getByTitle('Tasks')/items?$filter=(AuthorId eq 12)


1

The way the SharePointOnlineCredentials must be used differ from a client app versus web service - i believe this example explains it http://tomaszrabinski.pl/wordpress/2013/03/18/connecting-to-office-365-using-client-side-object-model-and-web-services/


1

You will want to use a filter, for example: ?$filter=CreatedBy/Name eq 'system account' Similar to expand, filters can drill into an object.



Only top voted, non community-wiki answers of a minimum length are eligible