Tag Info

New answers tagged

0

Found out and fixed. One of the entity did have a "isReference" attribute set on it. This break the JSON serializer and in turn the service. I still don't get why the debugger won't hit any breakpoint on the server, and why I was getting a 401 error.


2

The default format for SharePoint REST endpoint is application/atom+xml. Instead of manipulating results returned in Xml format you could specify JSON format. Use accept header to specify the format for response data from the server. To get the results in JSON format, include an Accept header set to application/json;odata=verbose. Examples The code in ...


1

I would recommend JShare. It is Android and Java library for SharePoint. It supports few authentication options including NTLM.


2

It's not a problem with your REST url, rather a setting you need to change in IE. Go to Options > Content Tab > Settings. Uncheck Turn on feed reading view. See this blog for visuals: http://www.c-sharpcorner.com/UploadFile/anavijai/feed-format-not-supported-when-trying-to-access-the-site-col/ Also, Chrome has some apps that allow you to view REST ...


2

It depends on the following factors: Server side object model : If your code runs on same machine as your Sharepoint farm. You should use Server side object model. The assemblies that define the built-in server-side classes are installed to the global assembly cache of each server when SharePoint 2013 is installed. When you program against the server ...


0

Answser from MSDN forum (Mike Smith TechTrainingNotes.blogspot.com): "SP 2010 REST can be best thought of as an experiment, with the SP 2013 REST the final product. 2010 REST was only available from LISTDATA.SVC and obviously focused on lists and list items. You will have better luck with the Client Side Object Model (CSOM) for getting the kind of info you ...


0

When I added the X-RequestDigest header to the JavasScript Proxy to the REST Service it all fell into place. (add {"X-RequestDigest": $("#__REQUESTDIGEST").val()} to the headers send


0

Fetch additional lookup columns values in REST lookupList -- List1 : col1, col2 List2: col3(lookupof col1) template: $select=LookupColName/LookupListcolName1,LookupColName/LookupListcolName2&$expand=LookupColName/LookupListcolName1,LookupColName/LookupListcolName2 Example $select=col3/col1,col3/col2&$expand=col3/col1,col3/col2


0

Finally I got the expected output using the below url. https://mydomain.sharepoint.com/_vti_bin/ListData.svc/Documents?$select=CreatedById&$filter=CreatedById eq 12


1

Try using web.Allowunsafeupdates = true; string uploadPathRoot = site2.ServerRelativeUrl + "/Lists/abc"; SPList list = web.GetList(uploadPathRoot); var fcp = new Microsoft.SharePoint.SPFileCollectionAddParameters(); fcp.Overwrite = true; web.AllowUnsafeUpdates = true; ...


0

The REST api does not provide for uploading multiple files in a single call. You would need to write your javascript to loop thru the collection of files and issue individual calls. Scot Hillier has a post which contains utility functions to do most of the work: ...


1

A code sample using REST and the SharePoint Javascript cross-domain library to perform basic operations on document libraries and files: http://code.msdn.microsoft.com/officeapps/SharePoint-2013-Perform-ab9c4ae5


0

The $expand columns must also be included in $select Marc has a sample: http://sympmarc.com/2014/01/21/getting-user-information-with-the-sharepoint-2013-rest-api/


1

You can convert the date time string returned into javascript datetime object, and extract the information required. Take a look at this link var date = new Date("2013-09-23T23:56:46Z");


1

Setting up Mysite fixed the problem.


0

This code works fine against my Office 365 Tenant $.ajax({ url: appweburl + "/_api/SP.UserProfiles.PeopleManager/GetMyProperties", method: "GET", headers: { "Accept": "application/json; odata=verbose", } }) Have you granted you app the permissions to User Profiles (Social)? (Although you should get access ...


0

Based on your snippet, it appears that you are writing Javascript. If so, then the browser will automatically handle the 401 response and pass the auth token of the current user on your behalf. If you attempting to use App Only policy, then you will need to do so in a provider-hosted app, and your app will need to use the pre-configured AppId (ClientID) and ...


3

I answered the question here (not exactly a duplicate, since that was in regards to the Search REST API, and I happened to give an answer for basic REST). Here is how you filter dates in REST: $filter=StartDate ge datetime'2014-01-01T00%3a00%3a00' This filters for items created after 01-Jan-2014, 00:00:00. So to filter between two date ranges, simply ...


2

This article explains REST filtering based on date, http://itblog.wolthaus.net/2011/12/rest-filter-datetime/. You'd want to pass in a date in YYYY-MM-DD format.


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


1

Theoretically yes. My experience has been creating web services outside of SharePoint 2010 and reading data into SharePoint pages. Since 2010 runs on ASP.NET 3.5.1, it's easier to add CORS to your SharePoint application than 2013. With ASP.NET 4.0 and above you need to use a library like Thinktecture.IdentityModel (in the GAC) and add methods to the ...


0

I would recommend the article Manipulating list items in SharePoint Hosted Apps using the REST API, it contains a thorough description with examples how to perform CRUD operations using REST API in SharePoint 2013. Below is provided a slightly modified version of function for creating list item from the specified article: function ...


1

This blog has a code snippet that is useful: // CREATE Operation // listName: The name of the list you want to get items from // weburl: The url of the web that the list is in. // newItemTitle: New Item title. // success: The function to execute if the call is sucesfull // failure: The function to execute if the call fails function ...


0

I did a lot of testing today and found out that all the fields I can't select are so called Managed Metadata Columns. And these unfortunately can't be selected in a list query with the REST API.


0

I cannot tell you why you cannot simply select File_x0020_Size, nor can I tell you why you cannot select other fields in REST. I can, however tell you the REST url to retrieve document file sizes: /_api/web/lists(guid'<guid>')/files?$select=size


0

Unless you can host the app running outside of SharePoint on the same domain as your SharePoint server (which I don't personally know how to configure :-D) you wouldn't be able to do this without making some server-side solution on your external application that would allow it to make the request to SharePoint (with authentication) then serve the data back ...


1

For the REST API, file size is returned in a field called 'Length' when you request a specific file object like with: /_api/web/getfilebyserverrelativeurl('/<folder name>/<file name>') http://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx#bk_FileProperties EDIT1: re-read question and realize you probably want the size of ...


1

You can user following URL to get all listitems in list http://<sharepoint-server>/_vti_bin/ListData.svc/<ListName> You can use this service in your javascript code. To get listitems in javascript using JSOM: function retrieveListItems(siteUrl) { var clientContext = new SP.ClientContext(siteUrl); var oList = ...


0

Here's an example which uses SPServices (instead of the standard rest api) to upload a binary file from clipboard (only works on chrome at this point due to clipboard api) http://pastebin.com/yR6jzxu6


1

I have found a solution: I think something was wrong with the environment settings on Windows Azure Web Sites. I've changed the HttpWebRequest object to an HttpClient object (which internally uses the HttpWebRequest) and my problems went away. My new code: using (var client = new HttpClient()) { ...


1

In order to return items from a specific folder use $filter query option with Path property: $filter=Path eq '<folder relative url>' Example Assume a Documents library that contains Orders folder. Then, the following REST query returns all documents located under Orders folder: ...


1

I was able to get something working with the following (you will need to adapt to your situation). The key thing was the .destroy(), which allows you to reinitialize the DataTable. HTML: <select id='ddlStatus'> <option value='Inserted'>Inserted</option> <option value='Approved'>Approved</option> <option ...


0

In SharePoint 2013, If you configure the search services application(which i am sure you did). You need to configure the Query suggestions.To add phrases that you want the search system to always or never suggest to users as they start typing a query, you have to create one or several text files that contain these phrases, and then import the files into the ...



Top 50 recent answers are included