Tag Info

Hot answers tagged

5

CSOM and REST was introduced in SP 2010 so you wont be able to use that with 2007. SOM is an option but requires that your code runs on the servers of each farm. SharePoint Web Services will be your best option if you need to support all three versions with the same code from client computers. Lists Web Service (/_vti_bin/Lists.asmx) for getting libraries ...


5

Postman API CLIENT Excellent tool. With Postman, you can construct simple as well as complex requests quickly, save them for later use and analyze the responses sent by the API. Postman can dramatically cut down the time required to test and develop APIs. Postman adapts itself for individual developers, small teams or big organizations equally well. The ...


3

CSOM: will work in SP online, SP 2010, 2013 and most probably 2016 REST: will work in SP online, SP 2010, 2013 and most probably 2016 OOTB Web service: will work in SP 2007, 2010, 2013 but maybe not in 2016 (and maybe not with future versions of SP online) Creating your own Web service with SOM: will work in SP 2007, 2010, 2013 and 2016


3

The simplest solution is to append ?web=1 at the and of file url Ex: https://server/site/lib/filename.ext?web=1


2

If you are looking for a tool to test SharePoint REST API, best options would be: Fiddler. Try composer feature that lets you to make simple GET/POST request. Advanced REST client. It is a add-on for Google Chrome with quite good and easy UI.


2

You can use the function I have added and call it like sendEmail("domain\\sender", "domain\\recipient","This is the body","Mail Subject");: var hostweburl; var appweburl; $(document).ready(function () { SP.SOD.executeFunc('sp.js', 'SP.ClientContext', sendEmail); }); function sendEmail(from, to, body, subject) { ...


2

After _api you specify web which is the SPWeb. To get the site collection features, you can instead use _api/site/features to get the SPSite features. The full list of features for on-prem is usually retrieved via Get-SPFeature, but that requires Shell Admin Access which would be unavailable in SharePoint Online. The feature IDs should be the same across ...


2

The "DocIcon" property will not get you the icon itself but the file extension. You can use mapToIcon method from the SPWeb object in JavaScript to get the image url. Example : http://onlinecoder.blogspot.ca/2014/03/get-oob-document-type-icon-using.html


2

In SharePoint 2013 On Premise we can send emails using REST API where we can utilise SP.Utilities.Utility.SendEmail for doing the job. Note: The recipient is limited to a valid SharePoint user for security reasons. function processSendEmails() { var from = 'asad@Example.com', to = 'someone@Example.com', body = 'Hello World Body', ...


2

If this is exactly the URL you used in IE, there's a typo with the first apostroph sign: ‘ instead of a plain '.


1

You can obtain the file URL and concatenate with a constant as in the following code: function documentWebUrl(ctx) { var fileUrl = ctx.CurrentItem.FileLeafRef.FileUrl; ExecuteOrDelayUntilScriptLoaded(function () { var clientContext = new SP.ClientContext(); var web = clientContext.get_web(); ...


1

Use SPServices for this. You can pass the lastname / first name and get the user object using which you can fetch user properties. See: http://spservices.codeplex.com/wikipage?title=SearchPrincipals


1

The client object model was created in 2010. CSOM did not exist in 2007. So I would recommend the server object model.


1

It is available in Powershell too, if you have downloaded the SharePoint Online module. Not sure what or how you want to use the data, but it is available that way. http://www.microsoft.com/en-us/download/details.aspx?id=35588 Get-SPOSite -Limit All You can also use a search query to look at all STS_Site content classes.


1

I found the following link and an older StackExchange question pointing out that you can do it using CSOM but you can't do it with REST API.


1

If your're working with REST you can apend $select tag to get specific properties. If would look like like this: <Sitename>/_api/web/sitegroups/getbyname('Approvers')?$select=id But even in this case you will get object containing at least __metadata tag, because SharePoint REST services is based on OData web protocol standards specification and ...


1

For the "little square" use the following snippet: <span> <span class="ms-imnSpan"> <a href="#" onclick="IMNImageOnClick(event);return false;" class="ms-imnlink ms-spimn-presenceLink"> <span class="ms-spimn-presenceWrapper ms-imnImg ms-spimn-imgSize-10x10"> <img name="imnmark" title="" ShowOfflinePawn="1" ...


1

CAML Queries do support checking for Null values (unlike the REST api) and you can use CAML in REST. So you can do something like this: http://somesharepointsite/_api/web/lists/getbytitle('yourlist')/getitems(query=@v1)?@v1={"ViewXml":"<View><Query><Where><IsNull><FieldRef ...


1

If you want to get all users of site then _spPageContextInfo.webAbsoluteUrl + "/_api/Web/SiteUsers" If You want to display information of User in site then _spPageContextInfo.webAbsoluteUrl + "/_api/Web/SiteUserInfoList" Display particular user information then _spPageContextInfo.webAbsoluteUrl + "_api/web/GetUserById("+UserID+")" But in your case ...


1

That can be specified by the URL that you use: Get all properties of current user: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetMyProperties Get all properties of Specific User: For Office 365/SharePoint Online: http://siteurl/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|user@domain.com' For ...


1

You can do it with a filter url : _spPageContextInfo.webAbsoluteUrl + "/_api/web/sitegroups/getByName('"+ groupName +"')/Users?$filter=Id eq " + _spPageContextInfo.userId Note: For the group you are testing make sure to change the group settings to – "Who can view the membership of the group?" = Everyone Greetings :)


1

Please refer this link for for detailed code, you shall realize the issue. This link is also useful. Also:Make sure that the recipient is limited to a valid SharePoint user for security reasons. The following is the code: function sendEmail(from, to, body, subject) { //Get the relative url of the site var siteurl = ...


1

REST API is by default enabled in SharePoint 2013. unless it is blocked by firewalls or user have not permission to access it. To understand REST API in SharePoint MicroSoft has done great documentation with example. but if you want to go from the starch in REST API in SharePoint then Go through this Article from which i got reference to learn REST API in ...


1

So the issue as pointed out by Pete Rijks is that google is adding an Origin header to the postman request. I had an old version of postman which didn't have the update notifications. Be sure to download the latest version which is around 3.0.2 at the time of this posting. You will also have to download the postman intercept app as well. turn it ...



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