New answers tagged

1

Not sure how the REST call supposed to be made but you'll not be able to call it under the current user if they don't have corresponding permissions. In your case, I'd recommend using MS Flow and a new SharePoint action - Grant access to an item or folder.


0

There is also this method. https://siteurl/_api/web/GetFolderByServerRelativeUrl('List or Library Name/')/Files('File Name')/ The following example shows how to retrieve a file. https://my365.onmicrosoft.com/sites/sample/_api/web/GetFolderByServerRelativeUrl('SiteAssets/')/Files('01.jpg')/


0

Below is the complete example of how to get the file from SharePoint: var hostweburl = decodeURIComponent(getParameterByName('SPHostUrl')); var appweburl = decodeURIComponent(getParameterByName('SPAppWebUrl')); var fileContentUrl = "_api/SP.AppContextSite(@target)/web/GetFileByServerRelativeUrl('/site/library/madcow.xlsx')/$value?@target='" + hostweburl + "...


0

Yes, It is possible to fetch the 1000 items using $top. Use something like below: https://domain/sites/site/_api/web/lists/getbytitle('example')/items?$select=Email/EMail&$expand=Email&$top=1000 Also, I noticed in URL, you have used: /lists/getbytitle%example%/ Is it working correctly? If Not, it should be like : /lists/getbytitle('example')...


0

The type for creating a new list item is not SP.Data.ListItem. It is actually based on the name of the list when it was created. You can find the correct type at this endpoint. /_api/web/lists/'getbytitle('[target list]')/listItemEntityTypeFullName It will be something like SP.Data.TargetListListItem (assuming you named the list TargetList when it was ...


3

This can be done via PowerShell: $tenant = "https://tenant-admin.sharepoint.com" $web = "https://tenant.sharepoint.com/sites/ModernTeam" Connect-PnPOnline -Url $tenant -SPOManagementShell $site = Get-PnPTenantSite -Detailed -Url $web if ($site.DenyAddAndCustomizePages -ne 'Disabled') { $site.DenyAddAndCustomizePages = 'Disabled' $site.Update() $...


4

You need to use /_api/groupsitemanager/HideTeamifyPrompt method to disable the Teamify banner. You can use it in PnP PowerShell as below: Connect-PnPOnline -Url "https://tenant.sharepoint.com/sites/TestTeamSite" $jsonBody = "{'siteUrl':'https://tenant.sharepoint.com/sites/TestTeamSite'}" Invoke-PnPSPRestMethod -Method Post -Url "/_api/groupsitemanager/...


0

I put together a "SharePoint REST Tester" to help learn and test the SharePoint REST APIs on my own site without writing testing code. While in no way complete, it does have over 80 examples or REST calls. After testing a call, it can display the returned data, an example of a JQuery AJAX call and steps to duplicate the call in a SharePoint Designer 2013 ...


0

While adding/updating list item, REST endpoint should be like given below: http://site url/_api/web/lists/getbytitle('ListName')/Items Where ListName is Display name of the SharePoint List. In your code, itemType is ListItemEntityTypeFullName property of List. The ListItemEntityTypeFullName property is especially important if you want to create and ...


0

For SharePoint Online and SharePoint 2016/2019 $batch Rest API is supported. However, $batch REST API supported but implementation is very tricky, and there is very limited resource available online. Recently I have found an easy way to implement $batch API using a few lines of code using BatchUtils.ts. See below code snippet for CRUD Operation using $batch ...


0

The way expanding lookup columns works is that you specify the name of the lookup column in the main list you are querying, and then specify the name of the column you want data from in the lookup list. So in your example, the name of the lookup column in the list you are querying is Email, but the name of the column that stores the email in the lookup list ...


1

To get the List Item Count using REST API you need to use: http://sitename/_api/web/lists/getbytitle('List Name')?$select=ItemCount Where List Name is display name of your list (Not the list name in URL). For more clarification check my answer given in below link: SharePoint rest api not bringing items from List Update: From Image attached to your ...


0

Try using below REST Query: http://dev.listdata.com/_vti_bin/listdata.svc/WasteCodes?$select=Col_Order,Description&$orderby=Col_Order asc,Description Or try using something like below REST API: siteUrl/_api/web/Lists/getbytitle('ListName')/items?$orderby=Col_Order asc,Description Reference: Using the REST Interface.


0

We can get trending documents from a particular location(like shared documents). Please refer below code, var queryTrendingUrl = "/_api/search/query?querytext='path:http://siteurl/ShearedDocuments/'&sortlist='ViewsLifeTime:descending'"; getItems(queryTrendingUrl).done(function (data) { data.d.query.PrimaryQueryResult.RelevantResults.Table.Rows....


4

You can pass the display name of your SharePoint List in REST API call like below: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('abc list')/items" Also make sure you are passing correct ListItemEntityTypeFullName in type property inside __metadata. You can check ListItemEntityTypeFullName of your list using below URL: /_api/web/lists/...


1

We can use the REST API to get UserId of all the users in the people picker field, then pass field data as below to add item using REST API. "RequestorId": { "results": userIds} The following example code for your reference. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script type="text/...


-1

Try replacing data: JSON.stringify(data) with body:JSON.stringify(data). This worked for me. thank you.


0

Adding var rowId=$(".ms-listviewtable>tbody>tr").attr("id") in success of rest api call and passing rowid as id of a row,solved my issue. As I display different list per user,I have to use this approach. I f your list is same for every user then you can go for data.d.results[0].Id approach also.


0

You can follow steps like below: Fetch the list items from SharePoint list. Bind the list items to your custom table along with the ID of list item (If you don't want to show the ID to user then you can hide that column from table using CSS). Whenever you are calling update item function, you can pass the ID of first row of your table instead of <ITEM_ID&...


0

Remove the Authorization from your dictionary


0

I have refactored the code and using HttpClient to download the file. private static async Task DownloadDocumentAsync(string webUrl, string folderServerRelativeUrl, string fileName, string path) { try { string accessToken = "Access Token"; //Creating Endpoint Uri Uri endpointUri ...


1

it is because you need to create a client ID for you application **enter here to create your ID https://yourtenantname.sharepoint.com/_layouts/15/appregnew.aspx **Enter Here to authorize your APP https://yourtenantname.sharepoint.com/_layouts/15/appinv.aspx **do not Forget set this xml you can figure out where!! :) <AppPermissionRequests ...


0

As stated in the comments I ended up solving this with a work around where I make sure to only query 5000 items or less at a time and then filter those items on the values I need. The process goes likes this: Find the lowest Id and the highest Id in the desired list and calculate how many calls the request must be split into: Math.ceil((highest-lowest)/5000)...


Top 50 recent answers are included