Get PublishingRollupImage using REST?
Hii Guys,
I am developoing a listing page of News using REST, the custom list contains Title, PublishingRollupImage, and other fields which is provided in the $select
http://xyz/_api/web/lists/getbytitle('News')/Items?$select=Title,Link,PublishingRollupImage
the column "PublishingRollupImage" is there and i can return the result by using normal javascript api with CAML query.
but REST calling while specifying this column is failing with this error
The field or property 'PublishingRollupImage' does not exist
Microsoft.SharePoint.Client.InvalidClientQueryException
i am able to develop the component using SP.ClientContext and SP.CamlQuery, but i wanted to use what microsoft is marketing :)
I just replicated your scenario where Link is HyperLink and PublishingRollupImage is Picture type. It worked without any issue.
So just for the testing I changed column name to PublishingImage instead of PublishingRollupImage. Change the query to reflect the same and I ran into the same issue as yours.
So make sure
1) There is not typo in the column name. I mean your Select column name matches with actual column name.
2) Also make sure your column internal name is not different than your column display name. Basically you should be using the internal names in your REST query.
Amit
Similar Messages
-
Problem when selecting PublishingRollupImage using REST API using Javascript ?
Hii Guys,
I am developing a listing page of News using REST, the custom list contains Title, PublishingRollupImage, and other fields which is provided in the $select
http://xyz/_api/web/lists/getbytitle('News')/Items?$select=Title,Link,PublishingRollupImage
the column "PublishingRollupImage" is there and i can return the result by using normal JavaScript API with CAML query.
but REST calling while specifying this column is failing with this error
The field or property 'PublishingRollupImage' does not exist
Microsoft.SharePoint.Client.InvalidClientQueryException
please note that this is not the (hyperlink/image) field,
its an existing site columns (publishing image)Hi,
According to your post, my understanding is that you want to get Rollup Image data using REST API.
Per my knowledge, we can’t get it using REST API.
We can use Client Object Model to achieve it, the following code snippet for your reference:
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 = items.getItemAtIndex(0).get_item('PublishingRollupImage');
console.log(rollupImage);
If you still want to use the REST API, we can customize a We Service to achieve it.
http://sharepointlearningcurve.blogspot.in/2013/08/creating-wcf-rest-service-for.html
Here is a similar thread for you to take a look:
http://sharepoint.stackexchange.com/questions/46844/how-to-get-publishingrollupimage-for-page-in-page-library-with-rest-and-jquery
Best Regards
Dennis Guo
TechNet Community Support -
How to get permission of a sharepoint list for a user using REST api
Hi there,
I have a requirement where i need to check the access permission of a user against a List or Library only using REST api from my remote salesforce app. [I already have access token and I am able to view list, add item etc..]
Say for example, I have to send the list name and user name, and get the result as Read, Write, Contribute(Manage), None. I need to display what permission does that user have for that List.
How do I achieve this. Please help me.
Thanks in advance.Hi,
For High and low bits, we can create a new SP.BasePermissions object to use like below:
function success(data){
var permissions = new SP.BasePermissions();
permissions.set(SP.PermissionKind.manageLists);
var hasPermission = permissions.hasPermissions(data.d.EffectiveBasePermissions.High, data.d.EffectiveBasePermissions.Low);
Here is a detailed article for your reference:
http://www.lifeonplanetgroove.com/checking-user-permissions-from-the-sharepoint-2013-rest-api/
Thanks
Best Regards
Jerry Guo
TechNet Community Support -
How to Get user profile properties in provider -cloud hosted app in sharepoint online - office 365 using REST API?
any idea?Hi,
From your description, my understanding is that you want to get user profile properties in provider-hosted app in SharePoint online using REST API.
Here is sample code for getting user profile properties:
http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
Here is a blog below about accessing data from the provider-host apps:
http://dannyjessee.com/blog/index.php/2014/07/accessing-sharepoint-data-from-provider-hosted-apps-use-the-right-context/
Best Regards,
Vincent Han
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected] -
Get item by it's guid using rest
Hello everyone,
for a solution i build for SharePoint 2013 i need to find a specific file using it's guid.
the szenario is, that i get information about files in sharepoint and save its guid in another system.
later then, i have to find the file knowing only its guid and its parent web.
so i need a REST pendant for web.getFileById
is there a way?
thanks in advance
DennisHi Dennis,
Per my understanding, you might want to get file by its GUID using REST API.
As there is no such endpoint in
REST API can meet you requirement, a workaround is that, you can iterate through the lists/libraries in the current web, then retrieve the GUID property of all the
files, find the corresponding file with the specific GUID in the retrieved result set, though it is not so elegant as the Web.GetFileById() method provided in Client Object Model.
Thanks
Patrick Liang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
contact [email protected]
Patrick Liang
TechNet Community Support -
How to get the list of parameter and set them using RESTFul WS for a Crystal Report
Hi All,
I am able to schedule a Crystal report using following POST Restful call - http://localhost:6405/biprws/infostore/4738/scheduleForms/now and with a request xml body. But report is failing because I am not passing the parameter.
But I need pass parameters/prompts to the Crystal report to execute successfully.
What is the request XML to pass the parameter for the report?
I was able to do this for WEBI reports but I am not able to find any way to do this for Crystal reports?
Any help on this matter is really appreciated.Hi Venki
Please have a look at:
How to pass parameters and generate the report using RESTful API in VB.net
This is also described in the Developer Help files:
http://help.sap.com/businessobject/product_guides/sbo41/en/sbo41_webi_restful_ws_en.pdf
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter -
Is there a way to use REST service to query data from a forms collection?
I want to query and retrieve data from a SharePoint forms collection. I have a forms library that has multiple documents all being created using the same template.
I need to query and retrieve data from it using oData/ReST API.
I could see the /_vti_bin/listdata.svc and it seems I cannot get the forms data using this.
What will be the best approach?
Does that helps?
If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”.
Thanks,
Kangkan Goswami |Technical Architect| Blog: http://www.geekays.net/
http://in.linkedin.com/in/kangkanHi,
Rest service is not available to retrieve the data in forms.
For this issue, the common workaround I know is to first populate the form fields as columns in form library, then retrieve the columns value instead. You can also use rest service in this way.
If it is not convenience this way, please provide more information about the scenario to get the data.
Thanks,
Qiao Wei
TechNet Community Support -
Add Item using REST and populate People field (SharePoint 2010)
I am trying to add an item to a list that has a People type field using REST API. For some reason, I am getting 400 (Bad Request) error. Can anyone show me how to add a list item and populate the user field?
Here's the code snippet I am using -
var url = 'https://mytestsite/_vti_bin/listdata.svc/mylist';
var item = {};
item.Title = 'my REST item';
item.User = 'contoso\user1';
var jsonObj = Sys.Serialization.JavaScriptSerializer.serialize(item);
$.ajax({
type: 'POST',
url: url,
contentType: 'application/json',
processData: false,
data: jsonObj,
success: function ()
console.log('item updated');
Thanks!Hi,
To update the People field, we will need to make a reference to the user information list.
Here are two links will provide more information:
http://sharepoint.stackexchange.com/questions/65650/rest-api-update-a-muli-value-user-field
http://charliedigital.com/2011/04/23/updating-user-fields-via-listdata-svc/
You can view the User Information list in this way:
http://zimmergren.net/technical/sharepoints-hidden-user-list-user-information-list
Best regards
Patrick Liang
TechNet Community Support -
Add user to sharepoint group using REST API
I am trying to add a user to sharepoint group with following code
serviceUrl= Appweb + "/_api/SP.AppContextSite(@target)/web/sitegroups("+GroupId+")/users?@target='host web'";
$.ajax({
url: serviceUrl,
type: "POST",
contentType: "application/json; charset=utf-8",
dataType: 'json',
body: "{'__metadata': { 'type': 'SP.User' },'LoginName':'i:0#.f|membership|'+email }",
headers: {"accept":"application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest":$("#__REQUESTDIGEST").val()
async: false,
success: function (data) {
alert('success');
error: function (data) {
alert('fail');
The request goes to error function. Response of the request is Microsoft.SharePoint.Client.InvalidClientQueryException and message is A node of type 'EndOfInput' was read from the JSON reader when trying to read the start of an entry. A 'StartObject' node was
expected
I tried the sample from following link but fail it
https://msdn.microsoft.com/en-us/library/office/dn531432.aspxHi,
Per my understanding, you might want to add an user to a SharePoint group in host web from a SharePoint Hosted App using REST API.
Here is a working demo for your reference:
var hostweburl;
var appweburl;
$(document).ready(function () {
//Get the URI decoded URLs.
hostweburl = decodeURIComponent(getQueryStringParameter("SPHostUrl"));
appweburl = decodeURIComponent(getQueryStringParameter("SPAppWebUrl"));
// Resources are in URLs in the form:
// web_url/_layouts/15/resource
var scriptbase = hostweburl + "/_layouts/15/";
// SP.RequestExecutor.js to make cross-domain requests
$.getScript(scriptbase + "SP.RequestExecutor.js", loadPage);
// Utilities
// Retrieve a query string value.
// For production purposes you may want to use a library to handle the query string.
function getQueryStringParameter(paramToRetrieve)
var params = document.URL.split("?")[1].split("&");
for (var i = 0; i < params.length; i = i + 1)
var singleParam = params[i].split("=");
if (singleParam[0] == paramToRetrieve) return singleParam[1];
function addUsersInGroup() {
var executor;
// Initialize the RequestExecutor with the app web URL.
executor = new SP.RequestExecutor(appweburl);
executor.executeAsync({
url: appweburl + "/_api/SP.AppContextSite(@target)/web/sitegroups(8)/users?@target='" + hostweburl + "'",
method: "POST",
contentType: "application/json; charset=utf-8",
dataType: 'json',
body: "{'__metadata': { 'type': 'SP.User' },'LoginName':'i:0#.f|membership|[email protected]'}",
headers: {
"Accept": "application/json; odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest":$("#__REQUESTDIGEST").val()
success: addUsersInGroupSuccessHandler,
error: addUsersInGroupErrorHandler
function addUsersInGroupSuccessHandler(data)
console.log(data);
var jsonObject = JSON.parse(data.body);
console.log(jsonObject);
function addUsersInGroupErrorHandler(data)
console.log(data);
var jsonObject = JSON.parse(data.body);
console.log(jsonObject);
Thanks
Patrick Liang
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]. -
Unable to upload Files to child site collection using REST
Dear All,
I referred this article http://www.shillier.com/archive/2013/03/26/uploading-files-in-sharepoint-2013-using-csom-and-rest.aspx for uploading documents to SP Document Library and it works fine for any document library under the root site collection(
for example "http://<server name>/Shared Documents" but when i upload the same document to one of the sub site collection created using Managed Path( the site collection path is "http://<server name>/files/Case" and the library
name is "records") it fails and i get below error:
The security validation for this page is invalid. Click Back in your
Web browser, refresh the page, and try your operation again, Error Code -2130575251 Microsoft.SharePoint.SPException"
Any help suggestion to resolve this? I've almost tried everything to resolve this issue but no luck.. appreciate any help
for this..
Regards,
VishalHi,
According to your post, my understanding is that you had an issue uploading files to subsite using REST.
I had made a simple code demo below, it will upload a file to Document Library after you make your selection with the File control.
<script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
function uploadFile(){
//alert(2);
if (document.getElementById("file").files.length === 0) {
alert('No file was selected');
return;
var parts = document.getElementById("file").value.split("\\");
var filename = parts[parts.length - 1];
var file = document.getElementById("file").files[0];
uploadFileSync("http://YourSite", "Documents", filename, file);
//Upload file synchronously
function uploadFileSync(spWebUrl , library, filename, file)
//alert(3);
var reader = new FileReader();
reader.onloadend = function(evt)
if (evt.target.readyState == FileReader.DONE)
var buffer = evt.target.result;
var completeUrl = spWebUrl
+ "/_api/web/lists/getByTitle('"+ library +"')"
+ "/RootFolder/Files/add(url='"+ filename +"',overwrite='true')?"
+ "@TargetLibrary='"+library+"'&@TargetFileName='"+ filename +"'";
$.ajax({
url: completeUrl,
type: "POST",
data: buffer,
async: false,
processData: false,
headers: {
"accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"content-length": buffer.byteLength
complete: function (data) {
//uploaded pic url
console.log(data.responseJSON.d.ServerRelativeUrl);
error: function (err) {
alert('failed');
reader.readAsArrayBuffer(file);
</script>
<input type="file" id='file' onchange="uploadFile()"/>
Thanks,
Jason
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected].
Jason Guo
TechNet Community Support -
How to update 500 list items using Rest API
Hi All,
i have requirement that is "required to update 500 list items using rest Api".
how can i do it,please share your thoughts with me.
Thanks,
Madhu.Didn't get you correctly, if you asking reference for REST API to update list items please refer below links
http://msdn.microsoft.com/en-us/library/office/jj164022(v=office.15).aspx
Destin -MCPD: SharePoint Developer 2010, MCTS:SharePoint 2007 Application Development -
How to use RESTFUL web services in SMP 3.0 Appbuilder?
Hi All,
I want to develop an application using RESTfull service. I have already developed REST service,I want to use that service in Appbuilder Application for SMP3.0. How can I call the REST services into our SMP 3.0 Appbuilder application? If i directly call the services(GET method) from Appbuilder, It is working but ODataQuery is not working for filter.
1.How to access the POST method in Appbuilder?
2.where should I provide the username and password for the login URL in our appbuilder for POST method URL?
3.How can I convert those REST service to ODATA services?In this discussion i found the solution for this issue. But Appbuilder supports the REST services i to used the REST service with GET method, I don't know how to use the POST method directly in Appbuilder?
Can any one suggest me
1.How do i querying the GET method of REST services?
2.Is there any other procedure to call the REST Service with POST method in Appbuilder? -
Searching for values in a specific field using REST Search
To conduct a Search using REST...you only have the querytext parameter which searches all fields. How can I search within a specific field using REST?
BrianYou can use the following code as an example to post a query. The example shows how to search against the title managed property. It also shows you how to bring back certain properties for viewing and refiners. You can also do the same with a GET.
function executeRESTSearch() {
var appweburl = _spPageContextInfo.webAbsoluteUrl;
$.ajax(
'url': appweburl + "/_api/search/postquery",
'method': 'POST',
'data': JSON.stringify({
'request': {
'__metadata': {
'type': 'Microsoft.Office.Server.Search.REST.SearchRequest'
'Querytext': 'title:whatever',
'Refiners': 'title,created',
'SelectProperties': { 'results': ['created','path'] },
'SortList': {
'results': [{
'__metadata': {
'type': 'Microsoft.SharePoint.Client.Search.Query.Sort'
'Direction': 1,
'Property': 'created'
'headers': {
'accept': 'application/json;odata=verbose',
'content-type': 'application/json;odata=verbose',
'X-RequestDigest': $('#__REQUESTDIGEST').val()
'success': function (data) {
var d = data.d.postquery.PrimaryQueryResult.RefinementResults.Refiners.results[0].Entries.results[0].RefinementValue;
'error': function (err) {
alert(JSON.stringify(err));
http://msdn.microsoft.com/en-us/library/office/jj163876(v=office.15).aspx
Blog | SharePoint Field Notes Dev Tools |
SPFastDeploy | SPRemoteAPIExplorer -
Using REST API to promote Document Properties into SharePoint document library
Hi,
Is it possible to extract Document properties of a file and update library column using REST API?
Thanks,
techieHi,
We can use the following REST endpoint to get document property:
http://site/_api/web/getfilebyserverrelativeurl('/Shared Documents/filename.docx')/<property name>
https://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx#bk_File
If you want to update document library column, the following blog for your reference:
Updating SharePoint List items with SharePoint’s REST API in JavaScript
http://community.rightpoint.com/blogs/viewpoint/archive/2014/10/23/updating-sharepoint-list-items-with-sharepoint-s-rest-api-in-javascript.aspx
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support -
Set group owner using REST API
I'm trying to use the REST API to set the owner of a SharePoint group. I can successfully create the group using REST, but I can't change the owner. I've tried the following.
1 - Specifying a group owner while creating the group
Endpoint: .../_api/web/sitegroups
Method: POST
Headers:
Content-Type: application/json; odata=verbose
Body:
{ '__metadata': { 'type': 'SP.Group' }, 'Title': '<title>', 'Description': '<description>', 'Owner': { '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}}
This returns a 500 error: "The specified name is already in use. Please try again with a new name". In other words, the owner title I specified already exists, which is correct - I'm trying to make an existing principal the owner of the new group.
2 - Merging a new group owner into an existing group
Endpoint: .../_api/web/sitegroups(<group_id>)
Method: POST
Headers:
Content-Type: application/json; odata=verbose
X-HTTP-Method: MERGE
Body:
{ '__metadata': { 'type': 'SP.Group' }, 'Owner': { '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}}
This returns a 500 error with a Microsoft.SharePoint.SPException: "Exception from HRESULT: 0x80131904". The trace logs don't shed any light on it.
3 - Using the owner endpoint directly
Endpoint: .../_api/web/sitegroups(<group_id>)/owner
Method: POST
Headers:
Content-Type: application/json; odata=verbose
X-HTTP-Method: PUT
Body:
{ '__metadata': { 'type': 'SP.Principal' }, 'Title': '<owner_title>'}
This throws various 400 errors. If the current owner of the group is a user, I get the error "The required property 'Email' does not exist in the message" - i.e. it wants SP.User properties. If the current owner of the group is another group, I get
the error "The required property 'AllowMembersEditMembership' does not exist in the message." - i.e. it wants SP.Group properties.
I've tried various adaptations of the three approaches above, such as specifying additional SP.Principal properties or passing SP.User or SP.Group objects instead, but with no success. Any ideas?As we chatted on email. There doesn't seem to be any combo that will set the owner. Only way to do it is to use the CSOM XML method and post to client.svc\ProcessQuery:
POST
http://weburl/_vti_bin/client.svc/ProcessQuery HTTP/1.1
X-RequestDigest: 0xAE382F0A8F11688BA9BE66739F84443892CE5E5452BA3E2622F6013D9D97EA8A8D9476463EDC503F700EB24F45024150D0DEEB2F40B160CD88BA7C7B4769BECD,15 Jan 2014 00:11:02 -0000Content-Type: text/xml
Host:
www.sanspug.org
Cookie: FedAuth=blah
Content-Length: 612
Expect: 100-continue
Accept-Encoding: gzip, deflate
XML body is:
<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="15.0.0.0" ApplicationName=".NET Library" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009">
<Actions>
<SetProperty Id="45" ObjectPathId="32" Name="Owner">
<Parameter ObjectPathId="33" />
</SetProperty>
<Method Name="Update" Id="46" ObjectPathId="32" />
</Actions>
<ObjectPaths>
<Identity Id="32" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:a1452dcc-8fc4-4631-8ada-97cb204810f1:g:9" />
<Identity Id="33" Name="740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:a1452dcc-8fc4-4631-8ada-97cb204810f1:g:7" />
</ObjectPaths></Request>
The ids are randomly generated and can be anything you want, as long as they correlate (setproperty and method objectpathid is the object you are updating). The most important part is the
“Name” parts. The first part is the typeid of the object (in this case is means SPGroup), the second part as you can see if the site guid id. The response does in fact return json if you tell it too:
Chris Givens CEO, Architecting Connected Systems
Blog Twitter
Maybe you are looking for
-
Ipod not identified by PC, won't turn on, got sad thing, help
I got big problems. I plug my ipod into the computer as usual and the ipod isn't identified, it's not in itunes either. Also, it won't turn on, tried resetting it and all that stuff on the support site. It's got that sad icon, which is the hard disk
-
How to stop the rotation i don't want to happenin relationship in mountain lion
how do i stop the rotation i don't want to happening relationship in mountain lion. Everytime I try and work now, the page swipe deal happens, I hate that on my Mac, and then my page all the sudden rotates and I can't figure out how to stop that from
-
Hi Experts, I am really stuck on this issue now. I am trying to get an attribute of BuilMarketing object(Industry attribute) on my lead screen corresponding to the prospect selected. I am using query object for this.I am writing this code in the even
-
Windows 8.1 Ente. KMS client
Hi, I need to download windows 8.1 enterprise KMS client. Is it available to download? Win 8.1 Evaluation available on TechNet is retail channel. N.A.Malik
-
I am using Pages to work with colleagues who use Microsoft Word. I would like to create headers that will be translated to the correct format and level in the final document. I want headers that will have heading status in the final document, with re