New answers tagged

0

The user-type field called AssignedTo is a lookup field which uses the ID of the user (Username) you have entered. So you will definitely get the ID or you can only set the ID inplace of username. That is not a bug of new 2016 version


0

Still this no API for retrieving all user profiles from SharePoint Online You can get current user's profile _api/SP.UserProfiles.PeopleManager/GetMyProperties Or a particular user's profile by login name /_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|xx@siteurl.onmicrosoft.com' BUT You can get available ...


0

//Display items created by user id 1 var currentUserId = 1; var url = SPAppWebUrl + "/_api/SP.AppContextSite(@target)" + "/web/lists/getbytitle('" + listName + "')/items?$orderby=OfficeLocation,Department,FirstName&$filter=AuthorId eq " + currentUserId + "&" + "@target='" + SPHostUrl + "'"; $.ajax( { url: url, ...


0

It seems that the problem was the formatting of string value as a valid SharePoint datetime. After convert the following string value: 01/05/2016 08:10 Using the following code: var nDate = null; var string_date = "01/05/2016 08:10"; nDate = new Date(string_date.split('/')[2], (string_date.split('/')[1]-1), string_date.split('/')[0], ...


0

You can do a workaround using the TaxCatchAll field as long as you know which terms belong to which taxonomy field - if you have multiple. /_api/web/Lists/GetByTitle('<list>')/Items/?$select=*,TaxCatchAll/Term$filter=TaxCatchAll/Term eq 'Puzzlepart'&$expand=TaxCatchAll


4

Have you tried moving your code into the jQuery.getScript() success callback? Like this: $.getScript(hostweburl + "/_layouts/15/SP.RequestExecutor.js", function() { var executor = new SP.RequestExecutor(appweburl); // rest of code... });


0

You can get below REST method to get users from the group. GET request example: Get the users in a group executor.executeAsync({ url: "<app web url>/_api/SP.AppContextSite(@target)/web /sitegroups(7)/users ?@target='<host web url>'", method: "GET", headers: { "accept": "application/json; odata=verbose" }, success: ...


0

If you're still trying to figure out the problem with AuthorID i believe it is referenced as Author/ID here's a snippet of the parameters I use on my code for pulling up the tasks: var params = { URL:"/_api/Web/Lists/GetByTitle('tasks')/Items" , params:{ 1:1 , $select:[ 'Id' ,'Title' ...


0

I had been confronted to that and the parent ID is not the best way. Because if you want to order your answers, if you have answers of answers, and that you delete more than one in a row, you will loose the link between the topic and your answers... I recommend you to use the ThreadIndex, it's specific to each item (Topics and Replies). You will have a long ...


0

this is what worked for me: _api/web/lists/getbytitle('LISTNAME')/Items?$orderby=Created desc&$filter=FSObjType+eq+1 FileSystemObjectType seems not to work


1

Install the OData Query Builder available (for free) in the App Store https://store.office.com/odata-querybuilder-WA104051159.aspx?assetid=WA104051159


2

You're writing it wrong. You need to use $filter= to filter results.


0

You can use the following code to check whether current user is site admin or not. var user = SP.ClientContext.get_web().get_currentUser(); var value = user.get_isSiteAdmin ();


0

isSiteAdmin gets you Site Admin info, not Site Collection This might be easier: _spPageContextInfo.isSiteAdmin


0

Here's the solution to my issue (HK is the title of the list): /_vti_bin/ListData.svc/HK/$count?&$filter=((Updated_by_workflow eq false) and (Validated_by_manager eq false) and (Manager_Mail ne null) and (Employee_ID ne null))


0

Please try below mentioned code if it works for you. var FirstRow = { '__metadata': { 'type': 'SP.Field' }, 'Title': 'Comments', 'FieldTypeKind': 3 } var SecondRow = { '__metadata': { 'type': 'SP.Field' }, 'Contact': 'Comments', 'FieldTypeKind': 3 } $.ajax({ url: "http://<site url>/_api/web/lists(guid'da58632f-faf0-4a78-8219-99c307747741') ...


0

I usually use this approach when querying a list: _api/web/lists(guid'D38E6516-FB4F-4FCF-9E29-4FEC9CE06D2B')/GetItems(query=@v1)?@v1={"ViewXml":"<View><Query><Where><Eq><FieldRef Name='Your field here'><Value Type='The field type'>The value you want to look ...


0

There is a maximum 256 character limit in SharePoint for REST URLs - reference: https://msdn.microsoft.com/en-us/LIbrary/dn292556.aspx However URL parameters are not included in the length-restriction, so can be used to get round this limit. Here is an example of using URL parameters to bypass this limit: ...


1

For me : 1- Yes they are two different ways to retrieve data from SharePoint (Technically speaking). 2- for the name SharePoint rest api and SharePoint Search rest API (See MSDN) 3- Yes both are active and present in SharePoint 2016 4- the difference is one is based on search services, so need to take care about indexing and planning your search schema ...


0

You can use jquery & REST API combined to upload a file to SharePoint online. Below is the best example explained on MSDN:- Upload a file by using the REST API and jQuery


0

You can Insert Items into SharePoint List by using REST API in SharePoint 2013 using example mentioned in below link. Insert Items into List by using REST API in SharePoint 2013 Notes You need to change the column names according to your SharePoint Column's internal names. You have to change the list Name & URL. If you want specific items from list ...


0

Ok, well, I cracked it, but the answer is... eh. I took the code above, put it into a separate js file, hosted it at intranet.domain.com, and ran it from teamsites.domain.com. No issues.


1

Or you can add a select option to your rest call to specify the fields that you want. This can solve your problem if you don't want all the lookup fields. Have a look here about select: https://msdn.microsoft.com/en-us/library/office/fp142385.aspx#sectionSection0


0

You can configure the throttle from the Central Administration under Web Application Settings.


-1

In addition to the previous answer check permissions of the user on SP site. See this post.


0

I think this occurs due to missing Type attribute in List Item entry. If you want to create list items using REST you will need to include the list item type. The list item type is a string automatically created by SharePoint when the list is first created. You can generate this value using the list name. The syntax is : SP.Data.{ListName}ListItem. So ...


0

You will have no Cross Origin Failure as long as you are in the same domain. intranet.domain.com and teamsites.domain.com are not considered same domain. Have you tried using the Cross Domain Library (CDL) and the RequestExecutor ? https://msdn.microsoft.com/en-us/library/office/fp179927.aspx


1

Try writing this $.getScript(hostweburl + "/_layouts/15/SP.RequestExecutor.js", getSubSite("/Test 2")); like this instead $.getScript(hostweburl + "/_layouts/15/SP.RequestExecutor.js", function(){ getSubSite("/Test 2"); }); to avoid immediate execution of the getSubSite method ( = to wait until SP.RequestExecutor.js is actually loaded)


0

yes add Id to column names it worked: Columns : Course_x0020_Id and Participant var courseId = GetQueryStringValues('ID'); var currentUser = GetCurrentUser(); var todaysDate = GetTodaysDate(); var itemToCreate = {'Category' : 'Register', 'Course_x0020_IdId' : courseId, 'ParticipantId' : currentUser, 'RegistrationDate' : todaysDate}; ...


0

You may use this in your oData which will get the navigation "Navigation":{"__deferred":{"uri":"https:///_api/Web/Navigation"}} Reference: https://msdn.microsoft.com/en-in/library/office/dn499819.aspx


2

SPWeb.EnsureUser(logonName) should add a user account to the site, which is what happens when the user has been "used" on the site (or even just visits the site, which presumably they haven't since they are new users). Once the account is added to the site, you should then be able to get the principleID for it. According to the JSOM reference for ...


-1

You can also check basic guide for CSOM using .net managed code from the following URL. http://www.c-sharpcorner.com/ebooks/sharepoint-2013-dot-net-client-side-object-model-cookbook. Thanks, Alok


0

It's a Limitation in SharePoint 2013 REST filter, You have to use CAML with REST - url: "/_api/web/lists/getbytitle('ListName')/getitems" method: "POST", body: "{ 'query' : {'__metadata': { 'type': 'SP.CamlQuery' }, "ViewXml": "<View><Query><Where><BeginsWith><FieldRef Name='URL'/><Value ...


1

i believe you can't filter hyperlink column via rest. What you can do is use caml query with Rest api, that will solve your issue. Here are the important things about it: A REST request with a CAML query is always a POST request A REST request with a CAML query has always to have X-RequestDigest http header (actually because it is a POST request) A REST ...


0

I am not sure what programming language you are using. Assuming JavaScript and jQuery query.RestQuery = "getbytitle('RFA')/Items?$select=ESI_ProjectSeqNoLookup/Id&$expand=ESI_ProjectSeqNoLookup&$filter=ESI_AFENo/Id eq '" + $('#txtAFENo').val() + "'";


1

If you are going to be writing managed code (C# or VB) then you should use the Client Object Model (CSOM). It has better documentation, the API has more coverage, it requires less lines of code, and it has better tooling in Visual Studio. If you are going to be writing JavaScript, my suggestion would be to start with the JavaScript version of the Client ...


0

Try the below REST End point, _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('Videos')/items?files?$filter=Id eq 1&$select=File$expand=File" or _spPageContextInfo.webAbsoluteUrl +"/_api/web/lists/getbytitle('Videos')/getitembyid(1)?$select=File&$expand=File" Get the file name with extension by accessing Name property and url ...


0

use /_api/web/lists/getbytitle('Videos')/Files and you should be able to get the file name and extension


0

Try getting the items with guid of the list instead of title e.g http://****/_api/web/Lists(guid'<your list id>')/items


2

It seems you ESI_ProjectSeqNoLookupId is lookup column. If it is true, then your approach is not correct. Correct Approach Let's say, lookup column name is ESI_ProjectSeqNoLookup. Now the query should look like query.RestQuery = ...


0

If there is no restriction on .Net based solutions, you can host a .Net site on the same server instead of the HTML site. This would give you access to the server side libraries which can easily do operations on SharePoint. You can have any UI you want and also have the user restrictions in place by having IIS impersonate the requestor. Cross domain calls ...


0

You can create a custom REST Service which can call SP and you can use the REST API for all CRUD operations: You can follow this article to help create the REST Service: http://www.codeproject.com/Articles/128478/Consuming-WCF-REST-Services-Using-jQuery-AJAX-Call Here is a tutorial on how to use REST API on SharePoint: ...


0

SharePoint does not trust your blue-eyed REST call without you passing an extra proof your call came from that SharePoint Page Wictor explains it all at http://www.wictorwilen.se/sharepoint-2013-how-to-refresh-the-request-digest-value-in-javascript Oh, one thing.. Wictors example requires jQuery to get a DOM value; which you can do completely without ...


0

Did you need to add the authorization to the header? endpointRequest.Headers.Add("Authorization", "Bearer " + accessToken); "You do not need the access token if you make this call from inside an add-in web, as you would in a SharePoint-hosted add-in. Note that you cannot obtain an access token from code that is running on a browser client. You must ...


0

The way I have done it in o365 which I think it is the same SP 2013. results object had the user properties var results = data.d.results; var image = siteURL + "/_layouts/15/userphoto.aspx?size=L&accountname="; <div class='contact-item'><div class='contact-profile-image'><img src='" + image + results[i].Person.EMail + "'></div>


1

The correct one is https://sitename/_api/web. If you type this URL in a browser like Chrome, it should display the current site information in XML. Also check your protocol, it might be https instead of http. If you still get the error than you need to download the SP 2013 Client Components SDK & brought up PowerShell V3 Use below mentioned code in ...


0

Unfortunately, the REST services are only working for authenticated users. It doesn't work with anonymous access in 2013. SharePoint 2013 APIs for anonymous and/or mobile access But You need to set the Bearer property in the request header with Authorization token. Please look into below mentioned code. SharePointContextToken ContextToken = ...


0

All request to the SharePoint REST API are made using the context of the current user. Since you are trying to call SharePoint REST API in your external java application, it is not able to authenticate the user thereby returning 403 Forbidden error. Please go through the below link on how to configure Basic authentication from Java to SharePointBASIC ...


0

I have found! Here solve my problem : POST /_api/lists/getbytitle('Billets')/items { "__metadata": { "type": "SP.Data.BilletsListItem" }, "Title": "Mise à jour", "PublishedDate": "2016-05-06T10:52:00Z", "Body": "test", "PostCategoryId": {"results": [2]} }


0

You can pass your CAML query to this endpoint: http://<sitecollection>/<site>/_api/web/lists(listid)/getItems(query) For low level details, refer this answer



Top 50 recent answers are included