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 ...


4

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: ...


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

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


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

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

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: ...


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

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

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


1

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 ...


1

The following SharePoint REST query could be used to retrieve content type names and accompanying field names: /_api/web/contenttypes?$select=Name,Fields/InternalName&$expand=Fields/InternalName


1

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 ...


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

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

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

I think that does not work for wcf/odata sources because there is no "standardized" format for the ACL - in code you can translate the incoming ACL to an acl the index understands - but as you mentioned, you need BCS/Custom Connector for this.


1

If you build your project as a SharePoint 2013 App you will not need to have SharePoint installed on your development machine. You will get intellisense and debugging support (even when writing JavaScript). If you're not familiar with App development I suggest you check out Apps for Office and SharePoint on MSDN.


1

This article on MSDN shows some examples of using jQuery.ajax calls: http://msdn.microsoft.com/en-us/library/jj164022.aspx Here is a good blog as well: http://blog.concentra.co.uk/2013/02/06/odata/ The only gotcha at all with calling the SharePoint 2013 REST API is that if you are doing anything other than GET, you have to add the custom X-RequestDigest ...


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.


1

I have never been able to get this to work with the ListData.svc. I always get errors regarding slug headers or something else. For example sending a post to the Shared Documents URL with the following payload: { "ContentTypeID":"0x012000BBD736485259BF4582A1FE518D692108", "Name":"TestFolder2", "Title":"TestFolder2", "ContentType":"Folder" } ...


1

Have you tried this approach: //Create Folder name MyFolder inside a doc library MyLib //Reference to Lists.asmx proxy ListsWebService.Lists listWebService = new ListsWebService.Lists(); string xmlCommand; XmlDocument doc = new XmlDocument(); xmlCommand = "<Method ID='1' Cmd='New'><Field Name='FSObjType'>1</Field><Field ...


1

You can disable the Access permission to remote interfaces to the anonymous users, follow this: Navigate to the site (or sub-site) where you wish to enable anonymous access. Go to Settings - Site settings. Under Users and Permissions, click on Site Permissions. Under the Permissions tab, click on Anonymous Access. Choose whether you want ...


1

The answer seems to be that this does not work (or is blocked) across Site Collections on SharePoint Online. It works with no problems on the sample Northwind OData endpoint (http://services.odata.org/Northwind/Northwind.svc). I will move to my backup solution of using CSOM to download the data and then upload it to a different list.



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