Microsoft Graph API Sharepoint
100 min
the microsoft graph api sharepoint connector facilitates interaction with sharepoint resources such as sites, lists, and documents, enabling comprehensive data management and workflow automation microsoft graph api sharepoint connector allows swimlane turbine users to manage content, collaborate on documents, and control document versions within sharepoint by leveraging this integration, users can automate file uploads, updates, and management tasks, create and organize lists and folders, and maintain strict version control through check in and check out functionalities this connector streamlines sharepoint operations, enhances team collaboration, and ensures data is organized and secure, all within the swimlane turbine platform the microsoft graph api sharepoint connector allows swimlane to ingest crud operations for lists, list items, sites and files in sharepoint sites prerequisites to utilize the microsoft graph api sharepoint connector in swimlane, ensure you have the following prerequisites oauth 2 0 client credentials authentication with these parameters url endpoint url for microsoft graph api client id application id registered in azure ad to represent the application client secret a secret string that the application uses to prove its identity when requesting a token token url url to obtain the access token from azure ad scope permissions the application requires delegated user flow authentication with these parameters url endpoint url for microsoft graph api tenant id directory id of the azure ad tenant username the username of the user on behalf of whom the application is authenticating password the password of the user on behalf of whom the application is authenticating client id application id registered in azure ad to represent the application client secret a secret string that the application uses to prove its identity when requesting a token capabilities the microsoft graph api sharepoint connector provides the below capabilities add or update file create folder create list column create list item create list delete folder delete list column delete list item drive item checkin drive item checkout get file get list columns get list content types get list item get list items and so on asset setup client credential flow authentication authentication uses azure application oauth2 you will need an admin account in azure to create the application recommended application permissions (feel free use custom permissions if you only use certain actions) user readwrite all directory readwrite all directory accessasuser all securityevents read all securityevents readwrite all mail readwrite mail send sites readwrite all files readwrite all sites readwrite all is needed by sharepoint actions only in order to set up the asset, you need the following azure application client id azure application client secret azure tenant id steps to create the azure app go to the app registration page https //portal azure com/#blade/microsoft aad registeredapps/applicationslistblade in the azure portal click new registration enter a name for your new application and choose accounts in this organizational directory only, then click register at the bottom navigate to the api permissions tab on the left navigation menu select add a permission select microsoft graph select application permissions, then mark all the permissions you need for the actions you are using (see suggested permissions at the top of the asset setup section) click the add permissions button at the bottom of the page select grant admin consent for your organization, then your permissions should look as below navigate to the certificates & secrets tab and select new client secret fill out the description and expiration, then click the add button at the bottom the value of the secret you just created is the client secret needed for the swimlane asset navigate to the overview tab on the left menu the client id and tenant id needed in the asset are shown on this page the client id , tenant id , and client secret described in the steps above are the credentials you need for the asset password flow (delegated auth) use delegated permissions, instead of application permissions, and generate client id , tenant id , and client secret as described in the above client credential flow authentication we also need an username and a password for this authentication sites get site all the sites actions require the site id to be executed the site id can be obtained using the action sites get site, in order to run the action the site hostname and site name are needed this two values can be found in a site url https //{site hostname} sharepoint com/sites/{site name} for example if our site url is https //swimlaneintegrations sharepoint com/sites/integrationssite we should use site hostname swimlaneintegrations site name integrationssite after the action execution you can find the site id on the id output field sites create list in order to create a list with its columns, use the input columns you can find all the possible values with its configuration in the official column definition table https //docs microsoft com/en us/graph/api/resources/columndefinition?view=graph rest 1 0#properties create list column refer to the link https //docs microsoft com/en us/graph/api/resources/columndefinition?view=graph rest 1 0#properties to get the type properties and column type input the type properties are documented within the links in the type column get list items in order to use the filter input please refer to the odata filters #odata filters section the column used to filter the output must be indexed, see the microsoft documentation https //support microsoft com/en us/office/add an index to a list or library column f3f00554 b7dc 44d1 a2ed d477eac463b0?ui=en us\&rs=en us\&ad=us to add an index to a list limitations when using $filter and $orderby in the same query to get messages, make sure to specify properties in the following ways properties that appear in $orderby must also appear in $filter properties that appear in $orderby are in the same order as in $filter properties that are present in $orderby appear in $filter before any properties that aren't failing to do this results in the following error error code inefficientfilter error message the restriction or sort order is too complex for this operation configurations password grant (delegated authentication) authenticates on behalf of a user using oauth 2 0 credentials configuration parameters parameter description type required url a url to the target host string required login url string optional tenant id string required oauth username the username for authentication string required oauth password the password for authentication string required oauth client id the client id string required oauth client secret the client secret string required scope permission scopes for this action array optional verify ssl verify ssl certificate boolean optional http proxy a proxy to route requests through string optional ms graph sharepoint oauth 2 0 client credentials authenticates sharepoint using oauth 2 0 client credentials configuration parameters parameter description type required url a url to the target host string required token url must start with https //login microsoftonline com/ https //login microsoftonline com/ and then continue with the tenant id, and then be prepended with /oauth2/v2 0/token string required client id the client id string required client secret the client secret string required scope list of permission scopes for this action array required verify ssl verify ssl certificate boolean optional http proxy a proxy to route requests through string optional actions add or update file add a new file or update an existing one within sharepoint, supporting files up to 250 mb requires 'drive id', 'item id', and file contents endpoint url /v1 0/drives/{{drive id}}/items/{{item id}}/content method put input argument name type required description drive id string required unique identifier item id string required unique identifier file array required parameter for add or update file file name string required name of the resource file string required parameter for add or update file output parameter type description status code number http status code of the response reason string response reason phrase audio object output field audio bundle object output field bundle content object response content ctag string output field ctag deleted object output field deleted description string output field description file object output field file filesysteminfo object output field filesysteminfo folder object output field folder image object output field image location object output field location malware object output field malware package object output field package pendingoperations object output field pendingoperations photo object output field photo publication object output field publication remoteitem object output field remoteitem root object output field root searchresult object result of the operation shared object output field shared sharepointids object unique identifier size number output field size specialfolder object output field specialfolder example \[ { "status code" 200, "response headers" { "content type" "application/json", "date" "thu, 01 jan 2024 00 00 00 gmt" }, "reason" "ok", "json body" { "audio" {}, "bundle" {}, "content" {}, "ctag" "string", "deleted" {}, "description" "string", "file" {}, "filesysteminfo" {}, "folder" {}, "image" {}, "location" {}, "malware" {}, "package" {}, "pendingoperations" {}, "photo" {} } } ] create folder creates a new folder within a sharepoint document library, requiring ' metadata' and 'serverrelativeurl' endpoint url / api/web/folders method post input argument name type required description metadata object required response data type string required type of the resource serverrelativeurl string required url endpoint for the request output parameter type description status code number http status code of the response reason string response reason phrase example \[ { "status code" 201, "response headers" { "content type" "application/json;odata=verbose" }, "reason" "created", "json body" { "d" {} } } ] create list creates a new list within a specified site in microsoft graph api sharepoint, requiring the site's unique id endpoint url /v1 0/sites/{{site id}}/lists method post input argument name type required description site id string required unique identifier createdby object optional parameter for create list createddatetime string optional time value description string optional parameter for create list displayname string optional name of the resource etag string optional parameter for create list id string optional unique identifier lastmodifiedby object optional parameter for create list lastmodifieddatetime string optional time value list object optional parameter for create list name string optional name of the resource parentreference object optional parameter for create list sharepointids object optional unique identifier system boolean optional parameter for create list weburl string optional url endpoint for the request output parameter type description status code number http status code of the response reason string response reason phrase createdby object output field createdby createddatetime string time value description string output field description displayname string name of the resource etag string output field etag id string unique identifier lastmodifiedby object output field lastmodifiedby lastmodifieddatetime string time value list object output field list name string name of the resource parentreference object output field parentreference sharepointids object unique identifier system boolean output field system weburl string url endpoint for the request example \[ { "status code" 201, "response headers" { "cache control" "no store, no cache", "strict transport security" "max age=31536000", "request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "client request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "date" "thu, 08 feb 2024 07 26 16 gmt" }, "reason" "created", "json body" { "createdby" {}, "createddatetime" "2021 09 22t14 50 55z", "description" "string", "displayname" "string", "etag" "string", "id" "string", "lastmodifiedby" {}, "lastmodifieddatetime" "2021 09 22t14 50 55z", "list" {}, "name" "string", "parentreference" {}, "sharepointids" {}, "system" false, "weburl" "string" } } ] create list column creates a new column in a specified sharepoint list using the microsoft graph api, requiring site id and list id as path parameters endpoint url /v1 0/sites/{{site id}}/lists/{{list id}}/columns method post input argument name type required description site id string required unique identifier list id string required unique identifier boolean object optional parameter for create list column calculated object optional parameter for create list column choice object optional parameter for create list column columngroup string optional parameter for create list column contentapprovalstatus object optional status value currency object optional parameter for create list column datetime object optional time value defaultvalue object optional value for the parameter description string optional parameter for create list column displayname string optional name of the resource enforceuniquevalues boolean optional value for the parameter geolocation object optional parameter for create list column hidden boolean optional unique identifier hyperlinkorpicture object optional parameter for create list column id string optional unique identifier indexed boolean optional parameter for create list column isdeletable boolean optional parameter for create list column isreorderable boolean optional parameter for create list column issealed boolean optional parameter for create list column lookup object optional parameter for create list column name string optional name of the resource number object optional parameter for create list column personorgroup object optional parameter for create list column output parameter type description status code number http status code of the response reason string response reason phrase boolean object output field boolean calculated object output field calculated choice object output field choice columngroup string output field columngroup contentapprovalstatus object status value currency object output field currency datetime object time value defaultvalue object value for the parameter description string output field description displayname string name of the resource enforceuniquevalues boolean value for the parameter geolocation object output field geolocation hidden boolean unique identifier hyperlinkorpicture object output field hyperlinkorpicture id string unique identifier indexed boolean output field indexed isdeletable boolean output field isdeletable isreorderable boolean output field isreorderable issealed boolean output field issealed lookup object output field lookup name string name of the resource number object output field number personorgroup object output field personorgroup example \[ { "status code" 200, "response headers" { "content type" "application/json", "date" "thu, 01 jan 2024 00 00 00 gmt" }, "reason" "ok", "json body" { "boolean" {}, "calculated" {}, "choice" {}, "columngroup" "string", "contentapprovalstatus" {}, "currency" {}, "datetime" {}, "defaultvalue" {}, "description" "string", "displayname" "example name", "enforceuniquevalues" true, "geolocation" {}, "hidden" true, "hyperlinkorpicture" {}, "id" "12345678 1234 1234 1234 123456789abc" } } ] create list item creates a new item within a specified sharepoint list, requiring both 'site id' and 'list id' as path parameters endpoint url /v1 0/sites/{{site id}}/lists/{{list id}}/items method post input argument name type required description site id string required unique identifier list id string required unique identifier contenttype object optional type of the resource fields object optional parameter for create list item sharepointids object optional unique identifier activities array optional parameter for create list item analytics object optional parameter for create list item documentsetversions array optional parameter for create list item driveitem object optional parameter for create list item versions array optional parameter for create list item id string optional unique identifier name string optional name of the resource createdby object optional parameter for create list item createddatetime string optional time value description string optional parameter for create list item etag string optional parameter for create list item lastmodifiedby object optional parameter for create list item lastmodifieddatetime string optional time value parentreference object optional parameter for create list item weburl string optional url endpoint for the request output parameter type description status code number http status code of the response reason string response reason phrase id string unique identifier createddatetime string time value createdby object output field createdby user object output field user displayname string name of the resource id string unique identifier lastmodifieddatetime string time value lastmodifiedby object output field lastmodifiedby user object output field user displayname string name of the resource id string unique identifier example \[ { "status code" 201, "response headers" { "cache control" "no store, no cache", "strict transport security" "max age=31536000", "request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "client request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "date" "thu, 08 feb 2024 07 26 16 gmt" }, "reason" "created", "json body" { "id" "20", "createddatetime" "2016 08 30t08 26 00z", "createdby" {}, "lastmodifieddatetime" "2016 08 30t08 26 00z", "lastmodifiedby" {} } } ] delete folder remove a specified folder from a sharepoint document library using the server relative url endpoint url / api/web/getfolderbyserverrelativeurl('{{server relative url}}') method delete input argument name type required description server relative url string required url endpoint for the request output parameter type description status code number http status code of the response reason string response reason phrase example \[ { "status code" 204, "response headers" { "content type" "application/json;odata=verbose" }, "reason" "no content", "json body" {} } ] delete list column removes a specified column from a sharepoint list using the site id, list id, and column id as path parameters endpoint url /v1 0/sites/{{site id}}/lists/{{list id}}/columns/{{column id}} method delete input argument name type required description site id string required unique identifier list id string required unique identifier column id string required unique identifier output parameter type description status code number http status code of the response reason string response reason phrase response text string output field response text example \[ { "status code" 204, "response headers" { "cache control" "no store, no cache", "strict transport security" "max age=31536000", "request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "client request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "date" "thu, 08 feb 2024 07 26 16 gmt" }, "reason" "no content", "response text" "" } ] delete list item removes a specified item from a sharepoint list using the site id, list id, and item id endpoint url /v1 0/sites/{{site id}}/lists/{{list id}}/items/{{item id}} method delete input argument name type required description site id string required unique identifier list id string required unique identifier item id string required unique identifier output parameter type description status code number http status code of the response reason string response reason phrase response text string output field response text example \[ { "status code" 204, "response headers" { "cache control" "no store, no cache", "strict transport security" "max age=31536000", "request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "client request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "date" "thu, 08 feb 2024 07 26 16 gmt" }, "reason" "no content", "response text" "" } ] drive item checkin checks in a drive item on microsoft graph api sharepoint, making the document's version available to others requires 'driveid' and 'itemid' endpoint url /v1 0/drives/{{driveid}}/items/{{itemid}}/checkin method post input argument name type required description driveid string required unique identifier itemid string required unique identifier checkinas string optional the status of the document after the check in operation is complete can be published or unspecified comment string optional a check in comment that is associated with the version output parameter type description status code number http status code of the response reason string response reason phrase response text string output field response text example \[ { "status code" 204, "response headers" { "cache control" "no store, no cache", "strict transport security" "max age=31536000", "request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "client request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "date" "thu, 08 feb 2024 07 26 16 gmt" }, "reason" "no content", "response text" "" } ] drive item checkout check out a driveitem in sharepoint to lock the document for editing and keep changes private until check in requires 'driveid' and 'itemid' endpoint url /v1 0/drives/{{driveid}}/items/{{itemid}}/checkout method post input argument name type required description driveid string required unique identifier itemid string required unique identifier output parameter type description status code number http status code of the response reason string response reason phrase response text string output field response text example \[ { "status code" 204, "response headers" { "cache control" "no store, no cache", "strict transport security" "max age=31536000", "request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "client request id" "29eecc90 ff91 4911 a77f f383dbda7d6f", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "date" "thu, 08 feb 2024 07 26 16 gmt" }, "reason" "no content", "response text" "" } ] get file downloads the primary stream (file) of a specified driveitem from microsoft graph api sharepoint, requiring 'drive id' and 'item id' endpoint url /v1 0/drives/{{drive id}}/items/{{item id}}/content method get input argument name type required description drive id string required unique identifier item id string required unique identifier output parameter type description status code number http status code of the response reason string response reason phrase location string output field location example \[ { "status code" 302, "response headers" { "cache control" "no store, no cache", "transfer encoding" "chunked", "content type" "application/json;odata metadata=minimal;odata streaming=true;ieee754compatible=f ", "content encoding" "gzip", "vary" "accept encoding", "strict transport security" "max age=31536000", "request id" "f71ff5a5 835c 427e 8883 c2a7e4939d53", "client request id" "f71ff5a5 835c 427e 8883 c2a7e4939d53", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "odata version" "4 0", "date" "thu, 08 feb 2024 06 10 16 gmt" }, "reason" "found", "json body" { "location" "https //b0mpua by3301 files 1drv com/y23vmagahszhxzlcvhasdhasghasodfi" } } ] get list columns retrieve the collection of columndefinition resources for specified 'site id' and 'list id' in microsoft graph api sharepoint endpoint url /v1 0/sites/{{site id}}/lists/{{list id}}/columns method get input argument name type required description site id string required unique identifier list id string required unique identifier count boolean optional count value expand string optional parameter for get list columns filter string optional parameter for get list columns format string optional parameter for get list columns orderby string optional parameter for get list columns search string optional parameter for get list columns select string optional parameter for get list columns skip number optional parameter for get list columns top number optional parameter for get list columns output parameter type description status code number http status code of the response reason string response reason phrase @odata context string response data value array value for the parameter columngroup string output field columngroup description string output field description displayname string name of the resource enforceuniquevalues boolean value for the parameter hidden boolean unique identifier id string unique identifier indexed boolean output field indexed name string name of the resource readonly boolean output field readonly required boolean output field required example \[ { "status code" 200, "response headers" { "cache control" "no store, no cache", "transfer encoding" "chunked", "content type" "application/json;odata metadata=minimal;odata streaming=true;ieee754compatible=f ", "content encoding" "gzip", "vary" "accept encoding", "strict transport security" "max age=31536000", "request id" "0da6c0d2 49ca 4b4f 8f89 bffe60826baf", "client request id" "0da6c0d2 49ca 4b4f 8f89 bffe60826baf", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "odata version" "4 0", "date" "thu, 08 feb 2024 06 25 20 gmt" }, "reason" "ok", "json body" { "@odata context" "https //graph microsoft com/v1 0/$metadata#sites('ea1e61eb 9941 4e3e 8155 5f4c48 ", "value" \[] } } ] get list content types retrieve the collection of content type resources from a specified list in microsoft graph api sharepoint, requiring 'site id' and 'list id' endpoint url /v1 0/sites/{{site id}}/lists/{{list id}}/contenttypes method get input argument name type required description site id string required unique identifier list id string required unique identifier count boolean optional retrieves the total count of matching resources expand string optional retrieves related resources filter string optional filters results (rows) format string optional returns the results in the specified media format orderby string optional orders results search string optional returns results based on search criteria select string optional filters properties (columns) skip number optional indexes into a result set top number optional sets the page size of results output parameter type description status code number http status code of the response reason string response reason phrase @odata context string response data value array value for the parameter @odata etag string response data id string unique identifier description string output field description group string output field group hidden boolean unique identifier name string name of the resource parentid string unique identifier readonly boolean output field readonly sealed boolean output field sealed base object output field base id string unique identifier description string output field description group string output field group hidden boolean unique identifier name string name of the resource readonly boolean output field readonly sealed boolean output field sealed example \[ { "status code" 200, "response headers" { "cache control" "no store, no cache", "transfer encoding" "chunked", "content type" "application/json;odata metadata=minimal;odata streaming=true;ieee754compatible=f ", "content encoding" "gzip", "vary" "accept encoding", "strict transport security" "max age=31536000", "request id" "cc478c80 5fcc 4301 9ea0 626ebeafc1d7", "client request id" "cc478c80 5fcc 4301 9ea0 626ebeafc1d7", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "odata version" "4 0", "date" "wed, 14 feb 2024 14 36 11 gmt" }, "reason" "ok", "json body" { "@odata context" "https //graph microsoft com/v1 0/$metadata#sites('ea1e61eb 9941 4e3e 8155 5f4c48 ", "value" \[] } } ] get list item retrieves metadata for a specified item from a list in microsoft graph api sharepoint, requiring site id, list id, and item id endpoint url /v1 0/sites/{{site id}}/lists/{{list id}}/items/{{item id}} method get input argument name type required description site id string required unique identifier list id string required unique identifier item id string required unique identifier count boolean optional retrieves the total count of matching resources expand string optional retrieves related resources filter string optional filters results (rows) format string optional returns the results in the specified media format orderby string optional orders results search string optional returns results based on search criteria select string optional filters properties (columns) skip number optional indexes into a result set top number optional sets the page size of results output parameter type description status code number http status code of the response reason string response reason phrase error object error message if any code string output field code message string response message innererror object error message if any date string date value request id string unique identifier client request id string unique identifier example \[ { "status code" 400, "response headers" { "cache control" "max age=0, private", "transfer encoding" "chunked", "content type" "application/json", "content encoding" "gzip", "vary" "accept encoding", "strict transport security" "max age=31536000", "request id" "937766e5 deb9 4c1d a23e d196e9b3df2c", "client request id" "937766e5 deb9 4c1d a23e d196e9b3df2c", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "date" "wed, 14 feb 2024 13 46 38 gmt" }, "reason" "bad request", "json body" { "error" {} } } ] get list items retrieve a collection of items from a specified list in microsoft graph api sharepoint using 'site id' and 'list id' endpoint url /v1 0/sites/{{site id}}/lists/{{list id}}/items method get input argument name type required description site id string required unique identifier list id string required unique identifier expand string optional retrieves related resources output parameter type description status code number http status code of the response reason string response reason phrase @odata context string response data value array value for the parameter @odata etag string response data createddatetime string time value etag string output field etag id string unique identifier lastmodifieddatetime string time value weburl string url endpoint for the request createdby object output field createdby user object output field user displayname string name of the resource lastmodifiedby object output field lastmodifiedby application object output field application id string unique identifier displayname string name of the resource user object output field user displayname string name of the resource parentreference object output field parentreference id string unique identifier siteid string unique identifier contenttype object type of the resource id string unique identifier name string name of the resource example \[ { "status code" 200, "response headers" { "cache control" "no store, no cache", "transfer encoding" "chunked", "content type" "application/json;odata metadata=minimal;odata streaming=true;ieee754compatible=f ", "content encoding" "gzip", "vary" "accept encoding", "strict transport security" "max age=31536000", "request id" "3fe9f673 6979 4082 853b e3b27c150193", "client request id" "3fe9f673 6979 4082 853b e3b27c150193", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "odata version" "4 0", "date" "wed, 14 feb 2024 13 58 58 gmt" }, "reason" "ok", "json body" { "@odata context" "https //graph microsoft com/v1 0/$metadata#sites('ea1e61eb 9941 4e3e 8155 5f4c48 ", "value" \[] } } ] get lists retrieves a collection of lists from a specified site in microsoft graph api sharepoint, requiring the 'site id' as a path parameter endpoint url /v1 0/sites/{{site id}}/lists method get input argument name type required description site id string required unique identifier output parameter type description status code number http status code of the response reason string response reason phrase @odata context string response data value array value for the parameter @odata etag string response data createddatetime string time value description string output field description etag string output field etag id string unique identifier lastmodifieddatetime string time value name string name of the resource weburl string url endpoint for the request displayname string name of the resource createdby object output field createdby user object output field user email string output field email id string unique identifier displayname string name of the resource lastmodifiedby object output field lastmodifiedby user object output field user email string output field email id string unique identifier displayname string name of the resource parentreference object output field parentreference siteid string unique identifier example \[ { "status code" 200, "response headers" { "cache control" "no store, no cache", "transfer encoding" "chunked", "content type" "application/json;odata metadata=minimal;odata streaming=true;ieee754compatible=f ", "content encoding" "gzip", "vary" "accept encoding", "strict transport security" "max age=31536000", "request id" "af55c5ad 270b 4d94 a6ef 90369771b43c", "client request id" "af55c5ad 270b 4d94 a6ef 90369771b43c", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "odata version" "4 0", "date" "thu, 08 feb 2024 06 13 57 gmt" }, "reason" "ok", "json body" { "@odata context" "https //graph microsoft com/v1 0/$metadata#sites('ea1e61eb 9941 4e3e 8155 5f4c48 ", "value" \[] } } ] get site retrieve details of a specific sharepoint site by using the unique site id provided as a path parameter endpoint url /v1 0/sites/{{site id}} method get input argument name type required description site id string required unique identifier output parameter type description status code number http status code of the response reason string response reason phrase @odata context string response data createddatetime string time value description string output field description id string unique identifier lastmodifieddatetime string time value name string name of the resource weburl string url endpoint for the request displayname string name of the resource root object output field root sitecollection object output field sitecollection hostname string name of the resource example \[ { "status code" 200, "response headers" { "cache control" "no store, no cache", "transfer encoding" "chunked", "content type" "application/json;odata metadata=minimal;odata streaming=true;ieee754compatible=f ", "content encoding" "gzip", "vary" "accept encoding", "strict transport security" "max age=31536000", "request id" "f71ff5a5 835c 427e 8883 c2a7e4939d53", "client request id" "f71ff5a5 835c 427e 8883 c2a7e4939d53", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "odata version" "4 0", "date" "thu, 08 feb 2024 06 10 16 gmt" }, "reason" "ok", "json body" { "@odata context" "https //graph microsoft com/v1 0/$metadata#sites/$entity", "createddatetime" "2018 11 14t17 40 29 47z", "description" "", "id" "swimlaneintegrations sharepoint com,ea1e61eb 9941 4e3e 8155 5f4c484d7afd,c377bca ", "lastmodifieddatetime" "2024 02 06t15 45 18z", "name" "", "weburl" "https //swimlaneintegrations sharepoint com", "displayname" "swimlane team site", "root" {}, "sitecollection" {} } } ] list column definitions retrieve a collection of columndefinition resources from a specified list in microsoft graph api sharepoint, requiring site id and list id endpoint url /v1 0/sites/{{site id}}/lists/{{list id}}/columns method get input argument name type required description site id string required unique identifier list id string required unique identifier count boolean optional retrieves the total count of matching resources expand string optional retrieves related resources filter string optional filters results (rows) format string optional returns the results in the specified media format orderby string optional orders results search string optional returns results based on search criteria select string optional filters properties (columns) skip number optional indexes into a result set top number optional sets the page size of results output parameter type description status code number http status code of the response reason string response reason phrase @odata context string response data value array value for the parameter columngroup string output field columngroup description string output field description displayname string name of the resource enforceuniquevalues boolean value for the parameter hidden boolean unique identifier id string unique identifier indexed boolean output field indexed name string name of the resource readonly boolean output field readonly required boolean output field required example \[ { "status code" 200, "response headers" { "cache control" "no store, no cache", "transfer encoding" "chunked", "content type" "application/json;odata metadata=minimal;odata streaming=true;ieee754compatible=f ", "content encoding" "gzip", "vary" "accept encoding", "strict transport security" "max age=31536000", "request id" "63ebb3e2 926f 4116 a1ab 52a732e7906b", "client request id" "63ebb3e2 926f 4116 a1ab 52a732e7906b", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "odata version" "4 0", "date" "wed, 14 feb 2024 14 47 46 gmt" }, "reason" "ok", "json body" { "@odata context" "https //graph microsoft com/v1 0/$metadata#sites('ea1e61eb 9941 4e3e 8155 5f4c48 ", "value" \[] } } ] rename folder renames a folder within a sharepoint document library by updating its server relative url endpoint url / api/web/getfolderbyserverrelativeurl('{{old server relative url}}')/moveto(newurl='{{new server relative url}}',flags=1) method post input argument name type required description old server relative url string required url endpoint for the request new server relative url string required url endpoint for the request output parameter type description status code number http status code of the response reason string response reason phrase example \[ { "status code" 200, "response headers" { "content type" "application/json;odata=verbose" }, "reason" "ok", "json body" {} } ] update list item updates a specified list item's properties in microsoft graph api sharepoint using site id, list id, and item id endpoint url /v1 0/sites/{{site id}}/lists/{{list id}}/items/{{item id}}/fields method patch input argument name type required description site id string required unique identifier list id string required unique identifier item id string required unique identifier headers object optional http headers for the request if match string optional etag if this request header is included and the etag provided does not match the current etag on the item, a 412 precondition failed response is returned and the item will not be updated author string optional parameter for update list item authorlookupid string optional unique identifier color string optional parameter for update list item name string optional name of the resource quantity number optional parameter for update list item output parameter type description status code number http status code of the response reason string response reason phrase name string name of the resource color string output field color quantity number output field quantity example \[ { "status code" 200, "response headers" { "cache control" "no store, no cache", "transfer encoding" "chunked", "content type" "application/json;odata metadata=minimal;odata streaming=true;ieee754compatible=f ", "content encoding" "gzip", "vary" "accept encoding", "strict transport security" "max age=31536000", "request id" "f71ff5a5 835c 427e 8883 c2a7e4939d53", "client request id" "f71ff5a5 835c 427e 8883 c2a7e4939d53", "x ms ags diagnostic" "{\\"serverinfo\\" {\\"datacenter\\" \\"south india\\",\\"slice\\" \\"e\\",\\"ring\\" \\"2\\",\\"scaleunit\\" \\"00 ", "odata version" "4 0", "date" "thu, 08 feb 2024 06 10 16 gmt" }, "reason" "ok", "json body" { "name" "widget", "color" "fuchsia", "quantity" 934 } } ] upload file uploads a file to a specified sharepoint document library folder using the server relative url and file name endpoint url / api/web/getfolderbyserverrelativeurl('{{folder server relative url}}')/files/add(overwrite=true,url='{{file name}}') method post input argument name type required description folder server relative url string required url endpoint for the request file name string required name of the resource files object required file to be analysed file string optional parameter for upload file file name string optional name of the resource output parameter type description status code number http status code of the response reason string response reason phrase example \[ { "status code" 201, "response headers" { "content type" "application/json;odata=verbose" }, "reason" "created", "json body" { "d" {} } } ] response headers header description example cache control directives for caching mechanisms max age=0, private client request id http response header client request id 3fe9f673 6979 4082 853b e3b27c150193 content encoding http response header content encoding gzip content type the media type of the resource application/json;odata=verbose date the date and time at which the message was originated thu, 08 feb 2024 07 26 16 gmt odata version http response header odata version 4 0 request id http response header request id 3fe9f673 6979 4082 853b e3b27c150193 strict transport security http response header strict transport security max age=31536000 transfer encoding http response header transfer encoding chunked vary http response header vary accept encoding x ms ags diagnostic http response header x ms ags diagnostic {"serverinfo" {"datacenter" "south india","slice" "e","ring" "2","scaleunit" "000","roleinstance" "ma1pepf000030fe"}} notes microsoft graph api sharepoint api documentation https //learn microsoft com/en us/graph/api/resources/sharepoint?view=graph rest 1 0azure ad oauth2 flow https //docs microsoft com/en us/azure/active directory/develop/v1 protocols oauth codequery parameters documentation odata v4 https //docs microsoft com/en us/graph/query parametersoauthlib legacy application client https //requests oauthlib readthedocs io/en/latest/oauth2 workflow\ html#legacy application flow , this is sort of a hack to bypass manual login (typically required)