Operations (sample payloads)

Main operations
Copy

Create folder
Copy

Create a new folder in a Drive with a specified parent item or path.

Sample Input

1
{
2
"location": {
3
"site_id": "1234567890abcdef",
4
"site_drive_id": "9876543210fedcba"
5
},
6
"folder_name": "Project Documents"
7
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('9876543210fedcba')/items/$entity",
3
"createdBy": {
4
"application": {
5
"id": "45678901-2345-6789-0123-456789012345",
6
"displayName": "Tray.io Connector"
7
},
8
"user": {
9
"id": "12345678-9012-3456-7890-123456789012",
10
"displayName": "John Doe"
11
}
12
},
13
"createdDateTime": "2023-05-15T10:30:45Z",
14
"eTag": "\"1234567890ABCDEF1234567890ABCDEF\"",
15
"id": "ABCDEF1234567890",
16
"lastModifiedBy": {
17
"application": {
18
"id": "45678901-2345-6789-0123-456789012345",
19
"displayName": "Tray.io Connector"
20
},
21
"user": {
22
"id": "12345678-9012-3456-7890-123456789012",
23
"displayName": "John Doe"
24
}
25
},
26
"lastModifiedDateTime": "2023-05-15T10:30:45Z",
27
"name": "Project Documents",
28
"parentReference": {
29
"driveId": "9876543210fedcba",
30
"driveType": "documentLibrary",
31
"id": "0123456789ABCDEF",
32
"path": "/drives/9876543210fedcba/root:"
33
},
34
"webUrl": "https://contoso.sharepoint.com/sites/Marketing/Shared%20Documents/Project%20Documents",
35
"cTag": "\"c:{1234567890ABCDEF1234567890ABCDEF},0\"",
36
"fileSystemInfo": {
37
"createdDateTime": "2023-05-15T10:30:45Z",
38
"lastModifiedDateTime": "2023-05-15T10:30:45Z"
39
},
40
"folder": {
41
"childCount": 0
42
},
43
"size": 0
44
}

Create item
Copy

Creates an item in a list.

Sample Input

1
{
2
"site_id": "contoso.sharepoint.com,5a9f29a7-957f-4089-9a6a-79c3494b7f12,0ce51744-3f0d-4c0c-9a52-4f8c7c3b92a1",
3
"list_id": "b5d3c1a2-d6e4-4f7b-8c9a-1e2f3d4a5b6c",
4
"fields": {
5
"text": [
6
{
7
"name": "Title",
8
"value": "Project Kickoff Meeting"
9
}
10
],
11
"multiple_line_text": [
12
{
13
"name": "Description",
14
"value": [
15
"Discuss project goals and objectives",
16
"Assign roles and responsibilities",
17
"Set project timeline and milestones"
18
]
19
}
20
],
21
"number": [
22
{
23
"name": "EstimatedDuration",
24
"value": 2.5
25
}
26
],
27
"person_or_group": [
28
{
29
"name": "ProjectManager",
30
"value": "i:0#.f|membership|john.doe@contoso.com"
31
}
32
],
33
"multiple_person_or_group": [
34
{
35
"name": "Attendees",
36
"value": [
37
"i:0#.f|membership|jane.smith@contoso.com",
38
"i:0#.f|membership|bob.johnson@contoso.com"
39
]
40
}
41
],
42
"choice": [
43
{
44
"name": "Status",
45
"value": "Not Started"
46
}
47
],
48
"date": [
49
{
50
"name": "MeetingDate",
51
"value": "2023-06-15T09:00:00Z"
52
}
53
]
54
}
55
}

Sample Output

1
{
2
"@odata.context": "https://contoso.sharepoint.com/sites/ProjectManagement/_api/v2.0/$metadata#items/$entity",
3
"@odata.etag": "\"1\"",
4
"createdBy": {
5
"user": {
6
"email": "john.doe@contoso.com",
7
"id": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
8
"displayName": "John Doe"
9
}
10
},
11
"createdDateTime": "2023-06-10T14:30:00Z",
12
"eTag": "\"1\"",
13
"id": "1",
14
"lastModifiedBy": {
15
"user": {
16
"email": "john.doe@contoso.com",
17
"id": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
18
"displayName": "John Doe"
19
}
20
},
21
"lastModifiedDateTime": "2023-06-10T14:30:00Z",
22
"parentReference": {
23
"listId": "b5d3c1a2-d6e4-4f7b-8c9a-1e2f3d4a5b6c",
24
"siteId": "5a9f29a7-957f-4089-9a6a-79c3494b7f12"
25
},
26
"webUrl": "https://contoso.sharepoint.com/sites/ProjectManagement/Lists/ProjectMeetings/1_.000",
27
"contentType": {
28
"id": "0x01008765432109876543210987654321",
29
"name": "Item"
30
},
31
"fields@odata.navigationLink": "https://contoso.sharepoint.com/sites/ProjectManagement/_api/v2.0/lists/b5d3c1a2-d6e4-4f7b-8c9a-1e2f3d4a5b6c/items(1)/fields",
32
"fields": {
33
"@odata.etag": "\"1\"",
34
"ID": 1,
35
"ContentType": "Item",
36
"Title": "Project Kickoff Meeting",
37
"Modified": "2023-06-10T14:30:00Z",
38
"Created": "2023-06-10T14:30:00Z",
39
"AuthorLookupId": "12",
40
"EditorLookupId": "12",
41
"_UIVersionString": "1.0",
42
"Attachments": false,
43
"Edit": "https://contoso.sharepoint.com/sites/ProjectManagement/Lists/ProjectMeetings/1_.000",
44
"LinkTitleNoMenu": "Project Kickoff Meeting",
45
"LinkTitle": "Project Kickoff Meeting",
46
"ItemChildCount": "0",
47
"FolderChildCount": "0",
48
"_ComplianceFlags": "",
49
"_ComplianceTag": "",
50
"_ComplianceTagWrittenTime": "",
51
"_ComplianceTagUserId": "",
52
"AppAuthorLookupId": "12",
53
"AppEditorLookupId": "12",
54
"Description": "Discuss project goals and objectives\nAssign roles and responsibilities\nSet project timeline and milestones",
55
"EstimatedDuration": 2.5,
56
"ProjectManager": "12",
57
"Attendees": "13;14",
58
"Status": "Not Started",
59
"MeetingDate": "2023-06-15T09:00:00Z"
60
}
61
}

Delete drive item
Copy

Delete a DriveItem by using its ID or path. Note that deleting items using this method will move the items to the recycle bin instead of permanently deleting the item.

Sample Input

1
{
2
"location": {
3
"site_id": "sites/contoso.sharepoint.com,5a58bb09-1fba-41c1-8125-69da264370a0,9f2ec1da-0be4-4a74-9254-973f0add78fd",
4
"site_drive_item_id": "01ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789"
5
}
6
}

Sample Output

1
{
2
"success": true
3
}

Download file
Copy

Download a file.

Sample Input

1
{
2
"location": {
3
"site_id": "sites/contoso.sharepoint.com,5a58bb09-1fba-41c1-8125-69da264370a0,7b20c3f5-7f0f-45a4-9f2b-5e8892a1d0d7",
4
"site_drive_item_id": "01BZQOBTDQJZ7UEXLE5BGYP3RNLBHXKN5Y"
5
}
6
}

Sample Output

1
{
2
"file": {
3
"name": "Project_Report.docx",
4
"url": "https://contoso.sharepoint.com/sites/Marketing/_layouts/15/download.aspx?UniqueId=01BZQOBTDQJZ7UEXLE5BGYP3RNLBHXKN5Y",
5
"mime_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
6
"expires": 1623456789
7
}
8
}

Get item
Copy

Get an item in OneDrive or SharePoint.

Sample Input

1
{
2
"location": {
3
"site_id": "contoso.sharepoint.com,2a1f3-b87d-4328-9e2a-7d5b59b4a96f,5a1f3-b92d-4329-9e2a-7d5b59b4a123",
4
"site_drive_item_id": "01ABCDEFGHIJKLMNOPQRSTUVWXYZ"
5
}
6
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('contoso.sharepoint.com%2C2a1f3-b87d-4328-9e2a-7d5b59b4a96f%2C5a1f3-b92d-4329-9e2a-7d5b59b4a123')/drive/items/$entity",
3
"createdBy": {
4
"user": {
5
"id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
6
"displayName": "John Doe"
7
}
8
},
9
"createdDateTime": "2023-04-15T09:30:45Z",
10
"eTag": "\"2D39F0AF-F0C6-4D41-B2F2-B70E3D7C8E3A,1\"",
11
"id": "01ABCDEFGHIJKLMNOPQRSTUVWXYZ",
12
"lastModifiedBy": {
13
"user": {
14
"id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
15
"displayName": "John Doe"
16
}
17
},
18
"lastModifiedDateTime": "2023-04-15T10:15:30Z",
19
"name": "Project Proposal",
20
"parentReference": {
21
"driveId": "b!-RIj2DuyvEyV1T9tKRWECDgBfGo_IKhHvxGkTJBB12MqNZ7HH-VBSIO7k1vXh_y4",
22
"driveType": "documentLibrary",
23
"id": "01ABCDEFGHIJKLMNOPQRSTUVWXY1",
24
"path": "/drive/root:/Documents"
25
},
26
"webUrl": "https://contoso.sharepoint.com/sites/Marketing/Shared%20Documents/Project%20Proposal",
27
"cTag": "\"c:{2D39F0AF-F0C6-4D41-B2F2-B70E3D7C8E3A},0\"",
28
"fileSystemInfo": {
29
"createdDateTime": "2023-04-15T09:30:45Z",
30
"lastModifiedDateTime": "2023-04-15T10:15:30Z"
31
},
32
"folder": {
33
"childCount": 5
34
},
35
"size": 1024
36
}

Get list item
Copy

Return information about an item.

Sample Input

1
{
2
"site_id": "contoso.sharepoint.com,2c1b4a3f-7a3e-4b9c-8d9a-5f9b7c1d3e5f,6a1b2c3d-4e5f-6g7h-8i9j-0k1l2m3n4o5p",
3
"list_id": "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
4
"item_id": "42"
5
}

Sample Output

1
{
2
"@odata.context": "https://contoso.sharepoint.com/sites/Marketing/_api/Web/Lists(guid'1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p')/Items(42)",
3
"@odata.etag": "\"1\"",
4
"createdBy": {
5
"user": {
6
"email": "john.doe@contoso.com",
7
"id": "12345678-90ab-cdef-1234-567890abcdef",
8
"displayName": "John Doe"
9
}
10
},
11
"createdDateTime": "2023-06-15T10:30:00Z",
12
"eTag": "\"1\"",
13
"id": "42",
14
"lastModifiedBy": {
15
"user": {
16
"email": "jane.smith@contoso.com",
17
"id": "98765432-10fe-dcba-9876-543210fedcba",
18
"displayName": "Jane Smith"
19
}
20
},
21
"lastModifiedDateTime": "2023-06-15T14:45:00Z",
22
"parentReference": {
23
"listId": "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
24
"siteId": "contoso.sharepoint.com,2c1b4a3f-7a3e-4b9c-8d9a-5f9b7c1d3e5f,6a1b2c3d-4e5f-6g7h-8i9j-0k1l2m3n4o5p"
25
},
26
"webUrl": "https://contoso.sharepoint.com/sites/Marketing/Lists/Events/42_.000",
27
"contentType": {
28
"id": "0x0100123456789ABCDEF",
29
"name": "Event"
30
},
31
"fields@odata.navigationLink": "https://contoso.sharepoint.com/sites/Marketing/_api/Web/Lists(guid'1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p')/Items(42)/Fields",
32
"fields": {
33
"@odata.etag": "\"1\"",
34
"ID": 42,
35
"ContentType": "Event",
36
"Title": "Annual Company Picnic",
37
"Modified": "2023-06-15T14:45:00Z",
38
"Created": "2023-06-15T10:30:00Z",
39
"AuthorLookupId": "12345678-90ab-cdef-1234-567890abcdef",
40
"EditorLookupId": "98765432-10fe-dcba-9876-543210fedcba",
41
"_UIVersionString": "1.0",
42
"Attachments": false,
43
"Edit": "https://contoso.sharepoint.com/sites/Marketing/Lists/Events/42_.000",
44
"LinkTitleNoMenu": "Annual Company Picnic",
45
"LinkTitle": "Annual Company Picnic",
46
"ItemChildCount": "0",
47
"FolderChildCount": "0",
48
"_ComplianceFlags": "",
49
"_ComplianceTag": "",
50
"_ComplianceTagWrittenTime": "",
51
"_ComplianceTagUserId": "",
52
"AppAuthorLookupId": "12345678-90ab-cdef-1234-567890abcdef",
53
"AppEditorLookupId": "98765432-10fe-dcba-9876-543210fedcba",
54
"EventDate": "2023-07-15T11:00:00Z",
55
"EndDate": "2023-07-15T16:00:00Z",
56
"fRecurrence": false
57
}
58
}

Get site
Copy

Return a site.

Sample Input

1
{
2
"site_id": "contoso.sharepoint.com,2a1f0035-1234-5678-9abc-def012345678,3a2f0036-9876-5432-1abc-fed098765432"
3
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites/$entity",
3
"createdDateTime": "2023-05-15T10:30:45Z",
4
"description": "This is the main site for Contoso Corporation",
5
"id": "contoso.sharepoint.com,2a1f0035-1234-5678-9abc-def012345678,3a2f0036-9876-5432-1abc-fed098765432",
6
"lastModifiedDateTime": "2023-06-20T14:22:18Z",
7
"name": "Contoso Main Site",
8
"webUrl": "https://contoso.sharepoint.com/sites/main",
9
"root": {},
10
"sensitivityLabel": {
11
"name": "Confidential"
12
},
13
"siteCollection": {
14
"hostName": "contoso.sharepoint.com"
15
},
16
"template": {
17
"definitionName": "STS#0",
18
"id": 1,
19
"name": "Team Site"
20
},
21
"title": "Contoso Corporation Main Site"
22
}

List children
Copy

Return a collection of files and folders in the children relationship of a DriveItem.

Sample Input

1
{
2
"location": {
3
"site_id": "sites.contoso.com,2a1f0035-1234-5678-9012-3456789abcde,7a1f0035-9876-5432-1098-7654321fedcb",
4
"site_drive_id": "b!eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA"
5
}
6
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA')/root/children",
3
"value": [
4
{
5
"createdBy": {
6
"user": {
7
"id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
8
"displayName": "John Doe"
9
}
10
},
11
"createdDateTime": "2023-05-15T09:30:00Z",
12
"eTag": "\"{13A28C1A-E2F7-4FEA-B4BD-5396F4FE0D99},1\"",
13
"id": "01NKDM6LCBXHBVKLRWQBHZLXS4UH3DBMKJ",
14
"lastModifiedBy": {
15
"user": {
16
"id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
17
"displayName": "John Doe"
18
}
19
},
20
"lastModifiedDateTime": "2023-05-15T09:30:00Z",
21
"name": "Project Documents",
22
"parentReference": {
23
"driveId": "b!eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA",
24
"driveType": "documentLibrary",
25
"id": "01NKDM6LCBXHBVKLRWQBHZLXS4UH3DBMKJ",
26
"path": "/drives/b!eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA/root:"
27
},
28
"webUrl": "https://contoso.sharepoint.com/sites/ProjectX/Shared%20Documents/Project%20Documents",
29
"cTag": "\"c:{13A28C1A-E2F7-4FEA-B4BD-5396F4FE0D99},0\"",
30
"fileSystemInfo": {
31
"createdDateTime": "2023-05-15T09:30:00Z",
32
"lastModifiedDateTime": "2023-05-15T09:30:00Z"
33
},
34
"folder": {
35
"childCount": 3
36
},
37
"size": 0
38
},
39
{
40
"createdBy": {
41
"user": {
42
"id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
43
"displayName": "John Doe"
44
}
45
},
46
"createdDateTime": "2023-05-15T10:15:00Z",
47
"eTag": "\"{A1B2C3D4-E5F6-4A5B-8C7D-9E0F1A2B3C4D},1\"",
48
"id": "01NKDM6LCPVJK2LTPEB5CZ2NSGTCQSJM3Y",
49
"lastModifiedBy": {
50
"user": {
51
"id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
52
"displayName": "John Doe"
53
}
54
},
55
"lastModifiedDateTime": "2023-05-15T10:15:00Z",
56
"name": "Project_Plan.xlsx",
57
"parentReference": {
58
"driveId": "b!eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA",
59
"driveType": "documentLibrary",
60
"id": "01NKDM6LCBXHBVKLRWQBHZLXS4UH3DBMKJ",
61
"path": "/drives/b!eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA/root:"
62
},
63
"webUrl": "https://contoso.sharepoint.com/sites/ProjectX/Shared%20Documents/Project_Plan.xlsx",
64
"cTag": "\"c:{A1B2C3D4-E5F6-4A5B-8C7D-9E0F1A2B3C4D},0\"",
65
"fileSystemInfo": {
66
"createdDateTime": "2023-05-15T10:15:00Z",
67
"lastModifiedDateTime": "2023-05-15T10:15:00Z"
68
},
69
"size": 25600
70
}
71
]
72
}

List list items
Copy

Return the items of a list.

Sample Input

1
{
2
"site_id": "contoso.sharepoint.com,2a1b9a3b-1234-5678-90ab-cd1234567890,3f3a9a2b-9876-5432-10fe-dc9876543210",
3
"list_id": "b7c84cb7-1234-5678-90ab-cd1234567890"
4
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('contoso.sharepoint.com%2C2a1b9a3b-1234-5678-90ab-cd1234567890%2C3f3a9a2b-9876-5432-10fe-dc9876543210')/lists('b7c84cb7-1234-5678-90ab-cd1234567890')/items",
3
"value": [
4
{
5
"@odata.etag": "\"6789abcd-1234-5678-90ab-cd1234567890,2\"",
6
"createdBy": {
7
"user": {
8
"email": "john.doe@contoso.com",
9
"id": "12345678-90ab-cdef-1234-567890abcdef",
10
"displayName": "John Doe"
11
}
12
},
13
"createdDateTime": "2023-05-15T10:30:45Z",
14
"eTag": "\"6789abcd-1234-5678-90ab-cd1234567890,2\"",
15
"id": "1",
16
"lastModifiedBy": {
17
"user": {
18
"email": "jane.smith@contoso.com",
19
"id": "98765432-10fe-dcba-9876-543210fedcba",
20
"displayName": "Jane Smith"
21
}
22
},
23
"lastModifiedDateTime": "2023-05-16T14:20:30Z",
24
"parentReference": {
25
"listId": "b7c84cb7-1234-5678-90ab-cd1234567890",
26
"siteId": "contoso.sharepoint.com,2a1b9a3b-1234-5678-90ab-cd1234567890,3f3a9a2b-9876-5432-10fe-dc9876543210"
27
},
28
"webUrl": "https://contoso.sharepoint.com/sites/ProjectX/Lists/Tasks/1_.000",
29
"contentType": {
30
"id": "0x0100123456789ABCDEF0123456789ABCDEF01",
31
"name": "Item"
32
}
33
}
34
]
35
}

List site drives
Copy

Return a list of drives for a site.

Sample Input

1
{
2
"site_id": "contoso.sharepoint.com,2a1eca0f-4960-4084-9641-e5a412b4116d,75439e4e-2c7c-4542-9d6f-3e15e81c9982"
3
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
3
"value": [
4
{
5
"createdBy": {
6
"user": {
7
"displayName": "John Doe"
8
}
9
},
10
"createdDateTime": "2023-05-15T10:30:45Z",
11
"description": "Documents for Marketing Team",
12
"id": "b!eIGlvxoGg0aYnkOcgnVk9plxs_bRlkFNl1wo_0K4E1pDj_ZmDYdEQJmHuTZ-zUFg",
13
"lastModifiedBy": {
14
"user": {
15
"email": "johndoe@contoso.com",
16
"id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
17
"displayName": "John Doe"
18
}
19
},
20
"lastModifiedDateTime": "2023-05-20T14:22:10Z",
21
"name": "Marketing Documents",
22
"webUrl": "https://contoso.sharepoint.com/sites/MarketingTeam/Shared%20Documents",
23
"driveType": "documentLibrary",
24
"owner": {
25
"group": {
26
"id": "1c1110dd-49d3-49fd-8627-ce82b33f2b20",
27
"displayName": "Marketing Team"
28
}
29
},
30
"quota": {
31
"deleted": 205824,
32
"fileCount": 128,
33
"remaining": 27487790694,
34
"state": "normal",
35
"total": 27487790694,
36
"used": 205824
37
}
38
}
39
]
40
}

List site lists
Copy

Return a list of lists for a site.

Sample Input

1
{
2
"site_id": "contoso.sharepoint.com,2a1b9eab-4927-4b75-8f80-8e0c2a642082,3a1b9eab-5927-4b75-8f80-8e0c2a642083"
3
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('contoso.sharepoint.com%2C2a1b9eab-4927-4b75-8f80-8e0c2a642082%2C3a1b9eab-5927-4b75-8f80-8e0c2a642083')/lists",
3
"value": [
4
{
5
"@odata.etag": "\"4f32a981-9359-4cc6-a91b-f2c8551a1f22,2\"",
6
"createdBy": {
7
"user": {
8
"displayName": "John Doe"
9
}
10
},
11
"createdDateTime": "2023-05-15T10:30:15Z",
12
"description": "This list contains all project documents",
13
"eTag": "\"4f32a981-9359-4cc6-a91b-f2c8551a1f22,2\"",
14
"id": "b!eKkw9tEGUEiM_mNhHRkDVmklSWVBvkNBn3ckJee3a1b9eab-4927-4b75-8f80-8e0c2a642084",
15
"lastModifiedBy": {
16
"user": {
17
"email": "jane.smith@contoso.com",
18
"id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
19
"displayName": "Jane Smith"
20
}
21
},
22
"lastModifiedDateTime": "2023-05-20T14:45:30Z",
23
"name": "Project Documents",
24
"parentReference": {
25
"siteId": "contoso.sharepoint.com,2a1b9eab-4927-4b75-8f80-8e0c2a642082,3a1b9eab-5927-4b75-8f80-8e0c2a642083"
26
},
27
"webUrl": "https://contoso.sharepoint.com/sites/ProjectX/Lists/ProjectDocuments",
28
"color": "blue",
29
"displayName": "Project Documents",
30
"icon": "documentLibrary",
31
"list": {
32
"contentTypesEnabled": true,
33
"hidden": false,
34
"template": "documentLibrary",
35
"type": "library"
36
}
37
}
38
]
39
}

List sites
Copy

Return a list of sites.

Sample Input

1
{
2
"search": "Project X"
3
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
3
"value": [
4
{
5
"createdDateTime": "2023-05-15T09:30:00Z",
6
"description": "Collaboration space for Project X team",
7
"id": "contoso.sharepoint.com,2c1b3c5d-e1f2-4a5b-8c9d-0e1f2a3b4c5d,6a7b8c9d-0e1f-2a3b-4c5d-6e7f8a9b0c1d",
8
"lastModifiedDateTime": "2023-06-01T14:45:00Z",
9
"name": "Project X",
10
"webUrl": "https://contoso.sharepoint.com/sites/ProjectX",
11
"root": {},
12
"sensitivityLabel": {},
13
"siteCollection": {
14
"hostName": "contoso.sharepoint.com"
15
},
16
"title": "Project X Team Site"
17
},
18
{
19
"createdDateTime": "2023-05-20T11:00:00Z",
20
"description": "Document repository for Project X",
21
"id": "contoso.sharepoint.com,3d4e5f6g-7h8i-9j0k-1l2m-3n4o5p6q7r8s",
22
"lastModifiedDateTime": "2023-05-31T16:20:00Z",
23
"name": "Project X Docs",
24
"webUrl": "https://contoso.sharepoint.com/sites/ProjectXDocs",
25
"root": {},
26
"sensitivityLabel": {},
27
"siteCollection": {
28
"hostName": "contoso.sharepoint.com"
29
},
30
"title": "Project X Document Library"
31
}
32
]
33
}

Move item
Copy

Move an item to a different folder.

Sample Input

1
{
2
"location": {
3
"site_id": "contoso.sharepoint.com,2a1f0035-1234-5678-9012-3456789abcde,7a1f0035-9876-5432-1098-7654321fedcb",
4
"site_drive_item_id": "01ABCDEFGHIJKLMNOPQRSTUVWXYZ"
5
},
6
"new_folder_id": "01ZYXWVUTSRQPONMLKJIHGFEDCBA",
7
"name": "Quarterly Report Q2 2023.docx"
8
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b!eYzQQp_N3UKyVNMul8KJI8PkQJN9hE1AjsMQhHYu3qM_bWUeu52CRbgalLMuI_QD')/items/$entity",
3
"createdBy": {
4
"application": {
5
"id": "89ea5c94-7736-4e25-95ad-3fa95f62b66e",
6
"displayName": "Tray.io Connector"
7
},
8
"user": {
9
"id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
10
"displayName": "John Doe"
11
}
12
},
13
"createdDateTime": "2023-06-15T14:30:45Z",
14
"eTag": "\"{13AFDA89-1234-5678-90AB-CDEF01234567},1\"",
15
"id": "01ABCDEFGHIJKLMNOPQRSTUVWXYZ",
16
"lastModifiedBy": {
17
"application": {
18
"id": "89ea5c94-7736-4e25-95ad-3fa95f62b66e",
19
"displayName": "Tray.io Connector"
20
},
21
"user": {
22
"id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
23
"displayName": "John Doe"
24
}
25
},
26
"lastModifiedDateTime": "2023-06-15T14:30:45Z",
27
"name": "Quarterly Report Q2 2023.docx",
28
"parentReference": {
29
"driveId": "b!eYzQQp_N3UKyVNMul8KJI8PkQJN9hE1AjsMQhHYu3qM_bWUeu52CRbgalLMuI_QD",
30
"driveType": "documentLibrary",
31
"id": "01ZYXWVUTSRQPONMLKJIHGFEDCBA",
32
"path": "/drives/b!eYzQQp_N3UKyVNMul8KJI8PkQJN9hE1AjsMQhHYu3qM_bWUeu52CRbgalLMuI_QD/root:/Folder1/Subfolder"
33
},
34
"webUrl": "https://contoso.sharepoint.com/sites/Marketing/Shared%20Documents/Folder1/Subfolder/Quarterly%20Report%20Q2%202023.docx",
35
"cTag": "\"c:{13AFDA89-1234-5678-90AB-CDEF01234567},1\"",
36
"fileSystemInfo": {
37
"createdDateTime": "2023-06-15T14:30:45Z",
38
"lastModifiedDateTime": "2023-06-15T14:30:45Z"
39
},
40
"size": 2048000
41
}

Raw HTTP request (advanced)
Copy

Perform a raw HTTP request with some pre-configuration and processing by the connector, such as authentication.

Sample Input

1
{
2
"method": "GET",
3
"url": {
4
"endpoint": "/sites/marketing/lists/employees"
5
},
6
"headers": [
7
{
8
"key": "Accept",
9
"value": "application/json"
10
}
11
],
12
"query_parameters": [
13
{
14
"key": "expand",
15
"value": "fields"
16
}
17
],
18
"body": {
19
"none": null
20
},
21
"include_raw_body": false,
22
"parse_response": "true"
23
}

Sample Output

1
{
2
"response": {
3
"status_code": 200,
4
"headers": {
5
"Content-Type": "application/json",
6
"Cache-Control": "no-cache"
7
},
8
"body": {
9
"value": [
10
{
11
"id": "1",
12
"fields": {
13
"Title": "John Doe",
14
"Email": "john.doe@example.com",
15
"Department": "Marketing",
16
"Position": "Manager"
17
}
18
},
19
{
20
"id": "2",
21
"fields": {
22
"Title": "Jane Smith",
23
"Email": "jane.smith@example.com",
24
"Department": "Marketing",
25
"Position": "Specialist"
26
}
27
}
28
]
29
}
30
}
31
}

Upload file
Copy

Upload a file to a drive.

Sample Input

1
{
2
"conflict_behavior": "rename",
3
"location": {
4
"site_id": "1234567890",
5
"site_drive_id": "ABCDEFGHIJ"
6
},
7
"file": {
8
"name": "example.docx",
9
"content": "base64_encoded_file_content_here"
10
},
11
"file_path": "/documents/projects/"
12
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('ABCDEFGHIJ')/root/children/$entity",
3
"@content.downloadUrl": "https://contoso.sharepoint.com/sites/Project/_layouts/15/download.aspx?UniqueId=1234567890abcdef&Translate=false&tempauth=eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvY29udG9zby5zaGFyZXBvaW50LmNvbUAxMjM0NTY3OC05MTIzLTRhYmMtOTg3Ni1hYmNkZWYxMjM0NTYiLCJpc3MiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAiLCJuYmYiOiIxNjE3MjA1MjAwIiwiZXhwIjoiMTYxNzIwODgwMCIsImVuZHBvaW50dXJsIjoiL3NpdGVzL1Byb2plY3QvX2xheW91dHMvMTUvZG93bmxvYWQuYXNweCJ9.&ApiVersion=2.0",
4
"createdBy": {
5
"user": {
6
"id": "1234567890",
7
"displayName": "John Doe"
8
}
9
},
10
"createdDateTime": "2023-05-01T10:30:15Z",
11
"eTag": "\"1234567890ABCDEF1234567890ABCDEF\"",
12
"id": "1234567890ABCDEF1234567890ABCDEF!1234",
13
"lastModifiedBy": {
14
"application": {
15
"id": "12345678-1234-1234-1234-1234567890AB",
16
"displayName": "Tray.io"
17
},
18
"user": {
19
"id": "1234567890",
20
"displayName": "John Doe"
21
}
22
},
23
"lastModifiedDateTime": "2023-05-01T10:30:15Z",
24
"name": "example.docx",
25
"parentReference": {
26
"driveId": "ABCDEFGHIJ",
27
"driveType": "documentLibrary",
28
"id": "1234567890ABCDEF1234567890ABCDEF!1000",
29
"path": "/drives/ABCDEFGHIJ/root:/documents/projects"
30
},
31
"webUrl": "https://contoso.sharepoint.com/sites/Project/Shared%20Documents/documents/projects/example.docx",
32
"cTag": "\"c:{1234567890ABCDEF-1234-1234-1234-1234567890ABCDEF},1\"",
33
"file": {
34
"hashes": {
35
"quickXorHash": "1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF=="
36
},
37
"irmEnabled": false,
38
"mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
39
},
40
"fileSystemInfo": {
41
"createdDateTime": "2023-05-01T10:30:15Z",
42
"lastModifiedDateTime": "2023-05-01T10:30:15Z"
43
},
44
"size": 12345
45
}

DDL operations
Copy

List list items fields (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"fields": [
3
{
4
"name": "Title",
5
"type": "Text",
6
"required": true
7
},
8
{
9
"name": "Description",
10
"type": "Note",
11
"required": false
12
},
13
{
14
"name": "DueDate",
15
"type": "DateTime",
16
"required": false
17
},
18
{
19
"name": "Status",
20
"type": "Choice",
21
"required": true,
22
"choices": [
23
"Not Started",
24
"In Progress",
25
"Completed"
26
]
27
},
28
{
29
"name": "AssignedTo",
30
"type": "Person",
31
"required": false
32
},
33
{
34
"name": "Priority",
35
"type": "Choice",
36
"required": false,
37
"choices": [
38
"Low",
39
"Medium",
40
"High"
41
]
42
},
43
{
44
"name": "Attachments",
45
"type": "Attachments",
46
"required": false
47
},
48
{
49
"name": "Created",
50
"type": "DateTime",
51
"required": true
52
},
53
{
54
"name": "Modified",
55
"type": "DateTime",
56
"required": true
57
}
58
]
59
}

List site drives (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"drives": [
3
{
4
"id": "b!3qFcYaS-EEGDrHinjvd7VZJHjDOsInRDnkqUT9T_ozd1U-WGDaz8S4mz7UlEQcp5",
5
"driveType": "documentLibrary",
6
"name": "Documents",
7
"webUrl": "https://contoso.sharepoint.com/sites/Marketing/Shared%20Documents",
8
"description": "Default document library for the Marketing site",
9
"createdDateTime": "2023-03-15T09:30:45Z",
10
"lastModifiedDateTime": "2023-06-22T14:22:18Z",
11
"quota": {
12
"total": 1099511627776,
13
"used": 2147483648,
14
"remaining": 1097364144128,
15
"deleted": 0,
16
"state": "normal"
17
}
18
},
19
{
20
"id": "b!3qFcYaS-EEGDrHinjvd7VZJHjDOsInRDnkqUT9T_ozd1U-WGDaz8S4mz7UlEQcp6",
21
"driveType": "documentLibrary",
22
"name": "Project Files",
23
"webUrl": "https://contoso.sharepoint.com/sites/Marketing/Project%20Files",
24
"description": "Library for storing project-related documents",
25
"createdDateTime": "2023-04-02T11:15:30Z",
26
"lastModifiedDateTime": "2023-06-21T16:45:22Z",
27
"quota": {
28
"total": 1099511627776,
29
"used": 5368709120,
30
"remaining": 1094142918656,
31
"deleted": 0,
32
"state": "normal"
33
}
34
}
35
]
36
}

List site lists (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
[
2
{
3
"id": "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
4
"name": "Documents",
5
"description": "Use this library to store documents for the team.",
6
"createdDateTime": "2023-05-15T10:30:45Z",
7
"lastModifiedDateTime": "2023-06-01T14:22:33Z",
8
"webUrl": "https://contoso.sharepoint.com/sites/Marketing/Documents",
9
"list": {
10
"contentTypesEnabled": true,
11
"hidden": false,
12
"template": "documentLibrary"
13
}
14
},
15
{
16
"id": "2b3c4d5e-6f7g-8h9i-0j1k-2l3m4n5o6p7q",
17
"name": "Tasks",
18
"description": "Track team tasks and their progress.",
19
"createdDateTime": "2023-05-16T09:15:30Z",
20
"lastModifiedDateTime": "2023-05-31T16:45:12Z",
21
"webUrl": "https://contoso.sharepoint.com/sites/Marketing/Tasks",
22
"list": {
23
"contentTypesEnabled": true,
24
"hidden": false,
25
"template": "tasks"
26
}
27
},
28
{
29
"id": "3c4d5e6f-7g8h-9i0j-1k2l-3m4n5o6p7q8r",
30
"name": "Calendar",
31
"description": "Team events and schedules.",
32
"createdDateTime": "2023-05-17T11:20:00Z",
33
"lastModifiedDateTime": "2023-06-02T08:10:55Z",
34
"webUrl": "https://contoso.sharepoint.com/sites/Marketing/Calendar",
35
"list": {
36
"contentTypesEnabled": false,
37
"hidden": false,
38
"template": "events"
39
}
40
}
41
]

List sites (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"sites": [
3
{
4
"id": "contoso.sharepoint.com,2c1b3c5d-e1f2-4a5b-9c8d-7e6f5a4b3c2d,1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d",
5
"name": "Marketing Team Site",
6
"displayName": "Marketing Team",
7
"webUrl": "https://contoso.sharepoint.com/sites/marketing",
8
"createdDateTime": "2023-05-15T09:30:00Z",
9
"lastModifiedDateTime": "2023-06-01T14:45:00Z",
10
"description": "Collaboration site for the Marketing team"
11
},
12
{
13
"id": "contoso.sharepoint.com,3d4e5f6a-7b8c-9d0e-1f2a-3b4c5d6e7f8a,2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e",
14
"name": "HR Portal",
15
"displayName": "Human Resources",
16
"webUrl": "https://contoso.sharepoint.com/sites/hr",
17
"createdDateTime": "2023-04-01T10:00:00Z",
18
"lastModifiedDateTime": "2023-05-30T16:20:00Z",
19
"description": "Central hub for HR policies and resources"
20
},
21
{
22
"id": "contoso.sharepoint.com,4e5f6a7b-8c9d-0e1f-2a3b-4c5d6e7f8a9b,3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f",
23
"name": "Project X",
24
"displayName": "Project X Collaboration",
25
"webUrl": "https://contoso.sharepoint.com/sites/projectx",
26
"createdDateTime": "2023-06-10T08:15:00Z",
27
"lastModifiedDateTime": "2023-06-15T11:30:00Z",
28
"description": "Confidential project collaboration site"
29
}
30
]
31
}