Tag Info

Hot answers tagged

9

This page has some good examples on using listdata.svc and specific examples on drilling down into specific items to be selected. Using the REST Interface Examples from page Using code: var query = (DataServiceQuery<InventoryLocationsItem>)context. CreateQuery<InventoryLocationsItem>("InventoryLocations") .Expand("Part") ...


8

Very interesting question and good answers. I have tested it on a usual Tasks list and got it working after trial and error. The link provided above, Using CAML in REST requests, is good, although it contains syntax errors and unintroduced variables that makes it harder to try out the examples. Robert Kaucher has a working solution, even though it contained ...


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

I solved my problem Read file as an readAsArrayBuffer(file) pass that file.target.result as buffer in _arrayBufferToBase64 function _arrayBufferToBase64(buffer) { var binary = '' var bytes = new Uint8Array(buffer) var len = bytes.byteLength; for (var i = 0; i < len; i++) { binary += String.fromCharCode(bytes[i]) } return binary; } here return of ...


6

I was able to add a file with SP.RequestExecutor <%-- _lcid="1033" _version="15.0.4128" _dal="1" --%> <%-- _LocalBinding --%> <%@ Page language="C#" MasterPageFile="~masterurl/default.master" Inherits="Microsoft.SharePoint.WebPartPages.WebPartPage,Microsoft.SharePoint,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" ...


6

Does your App request read permissions to User Profiles?


6

From the example you have supplied it seems that you only need to use POST if you are using CAML queries. You can use a simple GET if you use the OData querying method see OData in SharePoint 2013 with jQuery and SharePoint 2013 – CRUD on List Items Using REST Services & jQuery for fuller explanations and some simple examples. See MSDN - Use OData query ...


6

For a client solution I would use the Search REST API. The grouping has to be done on the client, it depends on how you configure your Managed Properties. The trick with People is to pass the correct Result Source ID in the query: For example: ...


6

Microsoft announced a preview version of an SDK for Andriod at this year's SharePoint conference. https://github.com/OfficeDev/Office-365-SDK-for-Android You could also check out this session which shows how to authenticate with SharePoint from a non-Microsoft platform. http://channel9.msdn.com/Events/SharePoint-Conference/2012/SPC118


6

Since your "today" variable is a JavaScript date object, you can get the string representation by calling the toISOString() method. ...$filter=StartDate ge datetime'" + today.toISOString() + "' and ...


5

Well, I am not absolutely sure, but I think the answer is: there is no way to skip metadata property. You may of course create a kind of proxy by implementing a custom web service which itself consumes listdata.svc and truncates the "__metadata" property? But it doesn't sound good to me. You can of couse skip all other unnecessary properties by defining the ...


5

In your scenario it looks like you have some kind of mobile app running on android or iphone. As you talk about javascript it seems your talking about some kind of webview application (like phonegap). Simplified this is an app that is hosting a browser control. Typical development on the client using native tools for the plattform will work the way you ...


5

Yes, you can. For each lookup field, the list has an implicit field that holds the id of the item in the target list. The name of this implicit field is the name of the lookup field plus Id. In Milind's answer, the lookup field is named State and the id of the item in the target list is 2. So, when you do the update using the REST API you would set StateId = ...


5

First off we needed a page to work on, we could make a request to find default home page, or try document.referrer, but for now we can say it was /SitePages/Home.aspx (we call it variable page). For the sake of the examples we will say that appWebUrl and hostWebUrl are defined (these are available in querystring). Lastly we needed a link to the malicious ...


5

you can use SharePoint’s GetUrlKeyValue() function to get item id. Example: var itemId = GetUrlKeyValue("ID", false, location.href);


5

There's no easy way to do it, but nothing stops you from manually checking if the folder exists and then adding it if you need to, then copying files from inside to the new one: You can check if a list item is a folder by checking its content type (folders will be "Folder")... To get the content type you need to select and expand ContentType on each item ...


4

Lukie, I've recently written a post on how to access Term Store in SharePoint 2013 using the javascript "SP.Taxonomy.js" Hope it helps you. http://cann0nf0dder.wordpress.com/2013/04/09/accessing-taxonomy-term-store-with-jsom/


4

Set the Permissions on User Profiles = Read as mentioned in Rob's Answer and then the following code should work. We don't need to use request executor as we are not making a cross domain call here. $.ajax({ url:"http://<app web url>/_api/SP.UserProfiles.PeopleManager/GetMyProperties", headers:{ Accept:"application/json;odata=verbose" }, ...


4

Have you tried using the "recycle" command using the REST API? (not using HTTP DELETE) Endpoint URI structure: http://<sitecollection>/<site>/_api/web/lists(listid)/items(itemid)/recycle() Please refer to the documentation regarding recycle on MSDN: http://msdn.microsoft.com/en-us/library/jj247053.aspx


4

Everywhere in this answer replace sp2010 with your site url, Table with your list name, PortalHomeDataContext with your site name (without spaces) + DataContext and RestTest.ServiceReference1 with your generated namespace. This is tested against a SharePoint 2010 site: http://sp2010/_vti_bin/listdata.svc/Table?$filter=(Color eq 'Red') and (Active eq false) ...


4

For a specific date: &refinementfilters='Birthday:datetime("2000-06-25")' For a range (a month in this example) &refinementfilters='Birthday:range(datetime("2000-06-01"), datetime("2000-06-30"))'


4

I'm hoping your question was for a multi-select choice field, where the entries are simply text, not referring items in another list. I was able to guess the answer from this microsoft article If you look under the ListItemCollection resource for "POST request example: Create list item" they show the following: method: "POST", body: "{ '__metadata': { ...


4

Unlike REST API in SP 2010 where display name of fields with following rules can be used: 1. Preserve casing, remove spaces and keep the first letter of each individual word as Capital. For example a field with display name "home aDdress" will be "HomeADdress". 2. If a special character like dot is in field name or List name it is to be treated like space ...


4

The REST query https://<siteUrl>/_api/site/usage will return the following: { "d": { "Usage": { "__metadata": { "type": "SP.UsageInfo" }, "Bandwidth": "0", "DiscussionStorage": "0", "Hits": "0", "Storage": "354721461", ...


4

Before I can say for sure, I really need to see your code. But make sure that what you are sending via REST is not the toString() output of the date but the toJSON() output. myDate.toJSON(); //"2014-03-07T14:48:56.431Z" From your comment I don't think you understand what I am saying. You are sending the object as a JSON string to the API but you are NOT ...


4

Try the following. Notice that you need to use POST as you are sending data. You also need the <View>and <Query>tags. <View> <Query> <Where> <Or> <Eq> <FieldRef ID="Assigned To" /> <Value Type="Integer"><UserID/></Value> ...


4

Instead of a network credential, you will need a SharePoint Online Credential: http://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.sharepointonlinecredentials_members(v=office.15).aspx


4

In order to set Url Field value in SharePoint REST specify the following JSON object: URL: {Url: 'http://www.microsoft.com',Description: 'MSFT'} where URL is the name of a field. Example var metadata = { Title: 'myTitle', URL: {Url: 'http://www.microsoft.com',Description: 'MSFT'}};


4

In order to perform an Update operation, the following issues/typos should be fixed in the specified example 1) REST endpoint There is a typo in the specified request /_vti_bin/ListData.svc/RSSData?$filterId eq <ItemID> The proper syntax for request is /_vti_bin/ListData.svc/RSSData?$filter=Id eq <ItemID> ,where filter operator is used to ...


4

Use the following javascript function : function getParameterByName(name) { name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } var prodId = ...



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