REST API
8 TopicsSharepoint Rest API - issues GetFileByServerRelativeFilePath- File content retrieve issue Postman
Hi Team, I am using rest apis to get sharepoint file content. While trying to fetch the file content Iam facing issues using postman. The authentication etc is right using Azure AD application only authentication. Rest api below <org>details and api GetFileByServerRelativePath('relative path and file name Response Cannot deserialize data for type Microsoft SharePoint SPResourcePath Tried both Relative path and URL if I addGet File By Server Relative url then I get the below error Which is wrong The file File path doesnot exist809Views0likes0CommentsGet Display Names of User Properties in SharePoint API
I am doing a pnp Rest API to get All the user properties from SharePoint. But what I get is an array of objects. like [{"Key":"contoso" , Value: "something"}] But in the Key The API returns the "Name" of the property. What I am looking for is "Display Name". For example in the below picture you can see "Name" and that value is returned in the "Key" but I want to get "Display Name".1.1KViews0likes0CommentsSharepoint REST API: How to retrieve all columns of all records via RenderListDataAsStream api
Hello, I have a sharepoint online list with 14k+ rows and 250+columns, 35+ of them being lookups. We have reached the maximum number of fields that can be indexed. It's a legacy list and it's used a source of data entry, not for documents/files. I am trying to retrieve via REST api all the rows (and all its columns), however, I am facing an issue while doing so. Here is all that I've tried: I used the Items endpoint, I get all columns but the lookup fields contain Id and not the actual LookUp value itself. I cannot use $expand because it crosses the threshold limit for number of lookups being expanded I used the RenderListDataAsStream api, and configured the body of the request with a ViewXML property to define the CAML query and omitted the "ViewFields" defintion while specifying pagination and RowLimit. This works like a charm except not all fields are returned, some lookup fields are left out. It also leaves out some of the Indexed lookup fields. I cannot specify all the columns in "ViewFIelds" because then it throws a threshold limit error I tried using Items/(ITEM_ID)/FieldValuesAsText and this works fine except the date fields have values that are not what we want/expect. I then tried using Items/(ITEM_ID)/Versions?$top=1 (AND) Items/(ITEM_ID)/Versions?$filter=IsCurrentVersion eq true and this seems to solve the problem but again, some date field values are confusing Most of the date fields are stored as DateOnly but when we retrieve via normal Items they return in UTC format which is fine. Can someone help/point me in the right direction please? Thanks10KViews0likes1CommentUpdate Group SharePoint Custom Field Collums after Fileupload with REST Graph API
Hi, I've made an upload with Graph with the following JS code: async function uploadSingleFileMetaToSharepoint(file, name, metaData, groupId, graphAccessToken) { //console.log(file, name, metaData, groupId); //TODO get Filepath from config of App let pathToFiles = 'General' let apiurl = msgraph + `/groups/${groupId}/drive/root:/${pathToFiles}/${name}:/content`; if (debug) { console.log("uploading File: ", file); console.log(`API-URL: ${apiurl}`); } let header = { 'Authorization': graphAccessToken, } let body = file; //TODO catch errors let result = await fetch(apiurl, { "method": 'PUT', "headers": header, "body": body }); if (!result.ok) { console.error("upload file to sharepoint failed"); return } let res = await result.json(); //console.log(res); if (res === undefined || res.id === undefined) {console.error("Die DAtei wurde nicht hochgeladen"); return;} /... } which is working fine. But now i'm struggling to fill the values of the collumns from sharepoint : Does anybody know how to approach this?593Views0likes0CommentsHow to get all pages under "sitePages" using SharePoint REST API in modern sites ?
I have created number of pages under "/SitePages" and want to retrieve them using SharePoint REST API. The below one's doesn't work _api/web/lists/getbytitle('SitePages')/Items _api/web/lists/getbytitle('Pages')/ItemsSolved24KViews0likes4CommentsSharePoint follow documents Rest API not working
Hi Community, I have been using SharePoint online rest end point to get users followed documents. The end point is {sitepath}/_api/social.following/my/followed(types=2) I was able to get follow docs in the response but from last couple of hours, this end point has stopped working and not receiving the docs in response. Is there any outage on Microsoft side ? Regards, Tayyab928Views0likes0CommentsRest API - Fetch Data using POST method and CamlQuery and Lookup Column
Hello, I am trying to get Username(Display name) from YourName field which is Person type field. But When I get result, I get ID as YourNameId. How can I get name rather than Id with using following method because it's mendatory for me to use it. var restUrl = "https://contoso.sharepoint.com/_api/web/lists/GetByTitle('JourneyDetails')/GetItems"; var camlQuery = "<View><ViewFields><FieldRef Name='YourName' /></ViewFields></View>"; axios .post( restURL, { query: { __metadata: { type: "SP.CamlQuery" }, ViewXml: camlQuery } }); Update: 02-09-2018 I want to use filter as well I have 2 more fields. Where I need condition like below $filer= (SuprvisorResponse eq 'Approved') and ((DepartmenResponse ne 'Approved') or (DepartmenResponse ne 'Rejected')))Solved12KViews0likes4CommentsJSOM/REST Set List Item Property Bag Value
Hi all! Is there a way to set List Item Property Bag value using JavaScript Object Model or REST API? I've tried to use the approach that works fine for Web and List (Root folder) property bags: var ctx = SP.ClientContext.get_current(); var web = ctx.get_web(); var list = web.get_lists().getByTitle('import test'); var item = list.getItemById(1); ctx.load(item); ctx.executeQueryAsync(function() { var props = item.get_properties(); props.set_item('test', 'test'); item.update(); ctx.executeQueryAsync(); }); But if you then refresh the page and get list item's properties again, the new key-value won't be there. There are no errors in the response of executeQueryAsync...3.3KViews0likes0Comments