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


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

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

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


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


5

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


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

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


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


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

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

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


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

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'}};


3

Would it be possible to use the Client Object Model? This works for me: var ctx = new SP.ClientContext(); var items = ctx.get_web().get_lists().getByTitle('Pages').getItems(new SP.CamlQuery()); ctx.load(items); ctx.executeQueryAsync(function() { // Get the first items rollup image, just as an example var rollupImage = ...


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

You just use an HTTP PUT to place a file in a library. It's not so much REST as good old HTTP ... From that link: WebResponse response = null; try { // Create a PUT Web request to upload the file. WebRequest request = WebRequest.Create(SharePointPath); request.Credentials = CredentialCache.DefaultCredentials; request.Method = "PUT"; ...


3

Your question implies that you already know the specific item. That makes it easier to isolate the data you want. Each of the lines shown will return a text response as shown below assuming that these are not "special" fields like choice, lookup, etc. This URL will return christophe http:/.../_vti_bin/listdata.svc/Contacts(2988)/Contact/$value This URL ...


3

Although there is currently no API in the JavaScript CSOM which lets you change the search center url directly, SharePoint stores the search settings in the Property Bag of the root SPWeb object in a sitecollection. You can set these property bag values and your search settings should get modified. "SRCH_ENH_FTR_URL" – Search Center URL ...


3

I assume that you don't have problems to get the SPFile. Here is a little example: SPFile xmlFile = ... using (var sr = new StreamReader(xmlFile.OpenBinaryStream())) { String xmlString = sr.ReadToEnd(); ... } OpenBinaryStream gives you back a stream. You will get the naked bytes back ;)


3

To add a group via the REST API you need to send a JSON string as a body of a POST request to: http://<server>/<site>/_api/Web/SiteGroups The format that the endpoint expects is the following: { "__metadata": { "type": "SP.Group" }, "Title": <name>, "Description": <description> } This will return the ...


3

I'm not exactly sure what which aspect is confusing your so I will break down the process into some steps. Let's imagine we have a custom list titled Issue Tracker with the following definition: Fields: Id (number) the default field Title (text) the default field Problem Description (text) Products (multiselect ...


3

Source ID looks to be the GUID of search scopes. It looks like you want to use ListId: instead. Source LIST Search (document library) https://myhost.com/rnd/mennysite1/_api/search/query?querytext='horses+AND+ListId:4f87042a-22cb-4c45-b043-972bd1b414b7'&clienttype='Custom' Things to notice: Notice the listId property is using “:” (contains) ...


3

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


3

The Site User Info list is cached. So yes you can use it, but no it won't be up to date all the time. You are better off using the User and Groups part of the REST api for this. MSDN: http://msdn.microsoft.com/en-us/library/office/dn531432.aspx Direct link to the cheat sheet from MSDN: http://zoom.it/OLUf#full The correct way is to check if the user has ...


3

See if these paths to the row count variables work: data.d.query.PrimaryQueryResult.RelevantResults.RowCount data.d.query.PrimaryQueryResult.RelevantResults.TotalRows If you have specific questions about the object model, I find that the best first point of reference is to look at the returned xml or json using web developer tools and looking at the ...



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