Tag Info

New answers tagged

0

I found the best way of accomplishing this was to create a workflow and use the workflow initiation form to capture all the necessary meta data, and then create the document via the workflow itself, inserting the corresponding fields from the initiation form into the document columns.


2

Make sure the correct ServerRelativeUrl has been provided, the following formats could be specified: Server-relative URL: /<web url>/<list url>/<folder url> Site-relative URL: <list url>/<folder url> For example, to create a folder named Orders in a Documents library in a sub site Projects, you could specify: ...


2

What about using the Add method: If for example using SiteCollectionDocuments in a Site Collection 'url' : _spPageContextInfo.siteAbsoluteUrl + "/_api/Web/Folders/add('SiteCollectionDocuments/newfolder')" This shouldn't require the data payload 'postData'. See more here: ...


4

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


0

CopyTo does not appear to be supported for folders in the REST API. See the Folder Methods section of Files and folders REST API reference


0

An Anonymous user won't have a SP/App Context. You can run the code above in a Provider hosted app for an anonymous user but you will need to request an 'App Only' token which means that the context is using the Apps identity not the user (as it's anonymous). You should be able to do the same for a SharePoint hosted app as well. Remember, to create a ...


0

I haven't used C# to do REST calls in awhile, but when I did, I used the HttPWebRequest, as that's what I found on MSDN: var Data = string.Concat( "{ '__metadata': { 'type': 'SP.WebCreationInformation' },", "'Title': 'Team projects', 'Url': 'TeamProjects', 'WebTemplate': 'STS'", "'UseSamePermissionsAsParentSite': true ...


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



Top 50 recent answers are included