Tag Info

New answers tagged

0

Only simple values (numbers, strings, dates) are brought back by default. If you want the other values you need to explicitly request them by using $select. You will most likely need to also use $expand to get object or collection property values. You should get used to using a tool like Fiddler to see what the response coming back from SharePoint looks ...


0

I got the solution with the help of this link here is the complete method function getInformation(userEmailId) { var url = _spPageContextInfo.siteAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetPropertiesFor(accountName=@v)?@v='i:0%23.f|membership|" + userEmailId + "'"; $.ajax({ url: url, method: "GET", async: false, ...


0

AssignedTo in your example is a plain object (with Title property), not a string. DataTables probably tries to call the toString of the object, which will be [object Object]. The best solution I can think of: mData should support deeply nested objects, so try { "mData": "AssignedTo.Title" }: ... "aoColumns": [ { "mData": "Title" }, { "mData": ...


0

I think you just got the URL wrong, try this: _api/Web/Lists/GetByTitle('<List Title>')/DefaultNewFormUrl


0

You can retrieve workflow tasks based on the WorkflowItemId which is the item the workflow is related to. [site]/_api/web/lists/getbytitle('Workflow Tasks')/items?$select=*,WorkflowItemId&$filter=Status eq 'Not Started' and WorkflowItemId eq 25 add a filter for Status to restrict to currently running workflow.


0

Solved it. Turns out someone changed the name of a list, and gave it a name that was already used by another list. This doesn't break anything, it seems, but it does break the REST API, even beyond the name conflicts.


1

In my experience you need to emulate what you get when you do a read (which you can see using a tool like Fiddler). In your case the code would be: var someNumbers = [4, 5]; var itemMetadata = { '__metadata': { 'type': archivo.d.ListItemEntityTypeFullName }, 'GerenciaId': $('#gerencia').val(), 'Planta_AreaId': $('#planta').val(), ...


0

You are right that it should be an array - array of ID's of the referenced items. Try the following: var someNumbers = [4, 5]; var itemMetadata = { '__metadata': { 'type': archivo.d.ListItemEntityTypeFullName }, 'GerenciaId': $('#gerencia').val(), 'Planta_AreaId': $('#planta').val(), 'Tipo_ArchivoId': $('tipoarchivo').val(), ...


0

Turned out to be an issue with RestSharp, and it overwriting the Content-Type header. The following resolved the issue: var request = new RestRequest { Method = Method.POST }; request.Parameters.Clear(); request.AddParameter( "application/json;odata=verbose", javaScriptSerializer.Serialize( requestBody ), ParameterType.RequestBody ); ...


1

The Microsoft documentation has this (along with examples in some standard languages, if it doesn't have yours Google it). REST is built in and unless it is blocked by firewalls or your user lacks permission.


0

I'm not 100% percent sure, but it seems that you need to update the list item and not the file. From the pictures above, it looks like you need to use this post url: $ajax({ url: https://examplecustomer.sharepoint.com/sites/examplesite/_api/web/lists/getByTitle('Dokumenter')/items(19)", type: "POST", data: "{ '__metadata': { 'type': ...


0

You'd need to elevate the app permissions. User Profile Service use tenant/farm level permissions. <AppPermissionRequests> <AppPermissionRequest Scope="http://sharepoint/social/tenant" Right="FullControl" /> </AppPermissionRequests>


0

If you really want to create a document set using Javascript, JSOM/CSOM could be your option. Here is the sample with JSOM: How to create a Document Set in SharePoint 2013 using JavaScript Client Side Object Model. When you are using listdata.svc make sure, that it uses not field InternalName, but some interesting value similar to display name without ...


1

The following example demonstrates how to create Document Set and set its properties: function createFolder(webUrl,listName,folderOptions) { var folderPayload = folderOptions; folderPayload['Title'] = folderOptions.Url.split('/').pop(); folderPayload['Path'] = folderOptions.Url.split('/').slice(0, -1).join('/'); //Create Folder ...


0

It seem the order of retrieved properties specified via $select query option is ignored when property of type Collection(String) (e.g. DirectReports) is specified. In that case you could consider to filter the returned results as demonstrated below: var requestUrl = _spPageContextInfo.webServerRelativeUrl + ...


0

You could consider the following options to retrieve ListItem.Title & File.Name using a single request: Option 1: Using FileLeafRef property https://site/_api/web/lists/getbytitle('<listtitle>')/items(<itemid>)?$select=Title,FileLeafRef Option 2: Using File.Name property ...


1

Assuming that you have only major versions enabled in document library. SharePoint's default behavior is the same when you are getting the version number in REST query. The checked in version is: 6.0 After checking out it became 7.0 version. However, if you want to display the last checked in version of the file you can get that idea from ...


0

You should use selectproperties as paul suggested After adding it your query should look like below _api/search/query?sourceid='d0aa2c2e%2D7709%2D46f1%2D835a%2D244f483e4b0e'&selectproperties='columnName','columnName2'


0

You can expand properties of File object as below https://siteurl/_api/lists/getbytitle('documents')/items?$expand=file


2

You are trying to access a list in the Host Web from the App Web. To do this you need to do two things: Request permission to read the list in the app manifest Modify the url property of the request to use the cross-domain library The url should look something like this: var appUrl = GetUrlKeyValue("SPAppWebUrl"); var hostUrl = ...


0

I've done this by configuring an application in Azure that uses the SharePoint online API with full control of tenant application permissions. You need to get an app-only token using the client-credential oath flow. This way we can elevate privileges to full control thus enabling us to get private folders/files.


0

I would like suggest to use 3rd party solution Workflow Actions Pack to solve this task. It contains Add User to SharePoint Group workflow action. Moreover it allows you dramatically extend functionality of SharePoint Designer, because it contains more than sixty additional workflow actions. Please have a look at full list of workflow action in ...


0

Found a solution in my environment. My script: $(document).ready(function () { var loginName = "domain\username"; function GetCurrentUser() { var requestUri = _spPageContextInfo.webAbsoluteUrl + "/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='Office')?@v=" + "'" + loginName + "'"; var requestHeaders = { ...


3

The persons id is per site, because the persons id is the id of the person's entry in the site's "User Information List". That's why you won't get the Id of the Person using search (because the search is working over more than one site collection, where the Person can have different id's). Also, the "User Information List" just holds only users which has ...


1

A co-worker ran across this issue, and I found the resolution to it on another site. It boils down to this: "To resolve this issue we need to pass Accept and Content-Type as application/json;odata=verbose to both the response headers and request headers. This way we will get JSON response." For a full explanation and walk-through, please see Prasad ...


0

If you want to do a query using $filter expression you can to this like this: http://{site}/_api/web/lists/getbytitle('{listtitle}')/items/select=ID,Title&filter=startswith(ContentTypeId,'0x01010028')


1

You should do it like this: http://myserver.mydomain.com/sites/MyCompany/_api/web/GetFileByServerRelativeUrl('/sites/MyCompany/012_MyDepartment/Shared%20Documents/rm/MyToolConfig/config.xml')/CheckOut() And Request should be POST. Hopefully this helps.


3

Explanation Based on your affirmative response to my comment, I've gone ahead and wrote this using the JSOM API. The script works by disabling the ReadOnly property on the RichMessage field, updating the values on your target item, and re-enabling the ReadOnly field. Up until now, this is the only working strategy I've found to change read-only fields from ...


0

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


1

Try URL webUrl + "/_api/web/lists/GetByTitle('LoggingList')/items(1)" Where 1 is the ID of item to update


0

I know posting a link is looked down upon but i recently discovered PnP. Makes tasks like these (and many others) extremely easy. Check out the link below that demonstrates site creation using PnP https://github.com/OfficeDev/PnP/tree/master/Samples/Core.CreateSiteCollectionFromTemplate Hope it helps.


1

Are you using SharePoint Online? We encountered this same issue with SharePoint Online recently that it started returning 403 errors to requests that have the "Origin" header set, which is the case for Postman as well as a few similar Chrome apps such as "Advanced REST client" and "REST Console." Although it may be the case that it was the behavior of Chrome ...


0

I know this is an old post but I compare current address to ('https://yourURL/_api/Web/FirstUniqueAncestorSecurableObject').d.Url. If they are equal, I assume I'm talking to the site collection. Please correct me if that is off base but I hope this may help someone in the future.


0

Thanks to @erikb, I needed the proper format of my code. I was using dot notation, but needed to hit the array as follows. Please note that I am using the nometadata option in my headers, so my JSON does not have the verbose aspects such as __metadata: { type: "SP.Taxonomy.TaxonomyFieldValue" }. // Create item var itemEntry = new appItems; ...


0

I believe you would need to go through the whole oAuth flow of getting tokens to validate and authorize the user. Matthias has an indepth article on this on his blog, and there is a JS library available to help with the oAuth flow called ADAL.


2

It probably fails because you haven't set itemEntry.MMField = {}; Try using object literal notation (note __metadata): itemEntry.MMField = { __metadata: { type: "SP.Taxonomy.TaxonomyFieldValue" }, Label: '7', TermGuid: "7d5e44d8-e5a7-4eb7-9735-7b51cea64aa8", WssId: -1 }; Update: An alternative solution is to set HTTP request header ...


0

The value does not show up since the field is set with MultiUser. By now, it does not support query on such field. We might have to write service api to fit this requirement or use more than one query to find desire results.


0

Microsoft just announced a preview to the Office 365 Management Activity API. According to the announcement, this does include SharePoint Online transaction logs.


0

found the solution to my problem. As Steve pointed out, it is possible that an AppPart posts to its own AppWeb. The 403 was generated because I tried to get the RequestDigest this way: $('#__REQUESTDIGEST').val(). This works perfectly in masterpages, eg default.aspx. In an AppPart Page there is no __REQUESTDIGEST, so I didnĀ“t get the correct value. Know I ...


0

Loading SharePoint TermStore is very easy. you have load default terms and then have to get the term store by name. and also you can get additional properties of the term store. you can get more details in this article. This Article may be helpful for you. Mark as answer if it is helpful info. ...


0

For a post you will need to add X-RequestDigest: $("#__REQUESTDIGEST").val() in the header.


1

You have to expand folder with $expand=Folder property and use ItemCount property of the folder like this: /_api/web/lists/getbytitle('your_list')/?items$select=ID,Title,Folder/ItemCount&$expand=Folder/ItemCount&$filter=FSObjType eq 1


0

Ah I think I found it. I was using the wrong end point. According to this way down the page in the folder collection resource section. http://<site url>/_api/web/getfolderbyserverrelativeurl('/<folder name>')/folders That does return all the "folders" (and the DocSets are folders). And they all have an ItemCount property. But now I can't seem ...


0

I don't think that is available as a Property in 2013 REST end point. URL you posted is related to 2010 REST EndPoint ListData.svc. Also SPServices uses Web Service interface and not REST interface. I would recommend you get the item count OnSuccess method url: webURL + "/_api/web/lists/getbytitle('" + listName + ...


0

I'm working with DocSets and they are a "folder" type. I'm using url: webURL + "/_api/web/lists/getbytitle('" + listName + "')/items?$filter=FSObjType eq 1" and that is working just fine for me. Before I added that on it was giving me both the docsets and their contents (the contents have FSObjType of 0) and after I added the filter I only have the ...



Top 50 recent answers are included