# Operations (sample payloads)

## Main operations

### Create folder

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

```json
{
    "location": \{
        "site_id": "1234567890abcdef",
        "site_drive_id": "9876543210fedcba"
    \},
    "folder_name": "Project Documents"
}
```

**Sample Output**

```json
{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('9876543210fedcba')/items/$entity",
    "createdBy": {
        "application": \{
            "id": "45678901-2345-6789-0123-456789012345",
            "displayName": "Tray.io Connector"
        \},
        "user": \{
            "id": "12345678-9012-3456-7890-123456789012",
            "displayName": "John Doe"
        \}
    },
    "createdDateTime": "2023-05-15T10:30:45Z",
    "eTag": "\"1234567890ABCDEF1234567890ABCDEF\"",
    "id": "ABCDEF1234567890",
    "lastModifiedBy": {
        "application": \{
            "id": "45678901-2345-6789-0123-456789012345",
            "displayName": "Tray.io Connector"
        \},
        "user": \{
            "id": "12345678-9012-3456-7890-123456789012",
            "displayName": "John Doe"
        \}
    },
    "lastModifiedDateTime": "2023-05-15T10:30:45Z",
    "name": "Project Documents",
    "parentReference": \{
        "driveId": "9876543210fedcba",
        "driveType": "documentLibrary",
        "id": "0123456789ABCDEF",
        "path": "/drives/9876543210fedcba/root:"
    \},
    "webUrl": "https://contoso.sharepoint.com/sites/Marketing/Shared%20Documents/Project%20Documents",
    "cTag": "\"c:{1234567890ABCDEF1234567890ABCDEF},0\"",
    "fileSystemInfo": \{
        "createdDateTime": "2023-05-15T10:30:45Z",
        "lastModifiedDateTime": "2023-05-15T10:30:45Z"
    \},
    "folder": {
        "childCount": 0
    },
    "size": 0
}
```

### Create item

Creates an item in a list.
**Sample Input**

```json
{
    "site_id": "contoso.sharepoint.com,5a9f29a7-957f-4089-9a6a-79c3494b7f12,0ce51744-3f0d-4c0c-9a52-4f8c7c3b92a1",
    "list_id": "b5d3c1a2-d6e4-4f7b-8c9a-1e2f3d4a5b6c",
    "fields": {
        "text": [
            \{
                "name": "Title",
                "value": "Project Kickoff Meeting"
            \}
        ],
        "multiple_line_text": [
            \{
                "name": "Description",
                "value": [
                    "Discuss project goals and objectives",
                    "Assign roles and responsibilities",
                    "Set project timeline and milestones"
                ]
            \}
        ],
        "number": [
            \{
                "name": "EstimatedDuration",
                "value": 2.5
            \}
        ],
        "person_or_group": [
            \{
                "name": "ProjectManager",
                "value": "i:0#.f|membership|john.doe@contoso.com"
            \}
        ],
        "multiple_person_or_group": [
            \{
                "name": "Attendees",
                "value": [
                    "i:0#.f|membership|jane.smith@contoso.com",
                    "i:0#.f|membership|bob.johnson@contoso.com"
                ]
            \}
        ],
        "choice": [
            \{
                "name": "Status",
                "value": "Not Started"
            \}
        ],
        "date": [
            \{
                "name": "MeetingDate",
                "value": "2023-06-15T09:00:00Z"
            \}
        ]
    }
}
```

**Sample Output**

```json
{
    "@odata.context": "https://contoso.sharepoint.com/sites/ProjectManagement/_api/v2.0/$metadata#items/$entity",
    "@odata.etag": "\"1\"",
    "createdBy": {
        "user": \{
            "email": "john.doe@contoso.com",
            "id": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
            "displayName": "John Doe"
        \}
    },
    "createdDateTime": "2023-06-10T14:30:00Z",
    "eTag": "\"1\"",
    "id": "1",
    "lastModifiedBy": {
        "user": \{
            "email": "john.doe@contoso.com",
            "id": "a1b2c3d4-e5f6-7890-a1b2-c3d4e5f67890",
            "displayName": "John Doe"
        \}
    },
    "lastModifiedDateTime": "2023-06-10T14:30:00Z",
    "parentReference": \{
        "listId": "b5d3c1a2-d6e4-4f7b-8c9a-1e2f3d4a5b6c",
        "siteId": "5a9f29a7-957f-4089-9a6a-79c3494b7f12"
    \},
    "webUrl": "https://contoso.sharepoint.com/sites/ProjectManagement/Lists/ProjectMeetings/1_.000",
    "contentType": \{
        "id": "0x01008765432109876543210987654321",
        "name": "Item"
    \},
    "fields@odata.navigationLink": "https://contoso.sharepoint.com/sites/ProjectManagement/_api/v2.0/lists/b5d3c1a2-d6e4-4f7b-8c9a-1e2f3d4a5b6c/items(1)/fields",
    "fields": \{
        "@odata.etag": "\"1\"",
        "ID": 1,
        "ContentType": "Item",
        "Title": "Project Kickoff Meeting",
        "Modified": "2023-06-10T14:30:00Z",
        "Created": "2023-06-10T14:30:00Z",
        "AuthorLookupId": "12",
        "EditorLookupId": "12",
        "_UIVersionString": "1.0",
        "Attachments": false,
        "Edit": "https://contoso.sharepoint.com/sites/ProjectManagement/Lists/ProjectMeetings/1_.000",
        "LinkTitleNoMenu": "Project Kickoff Meeting",
        "LinkTitle": "Project Kickoff Meeting",
        "ItemChildCount": "0",
        "FolderChildCount": "0",
        "_ComplianceFlags": "",
        "_ComplianceTag": "",
        "_ComplianceTagWrittenTime": "",
        "_ComplianceTagUserId": "",
        "AppAuthorLookupId": "12",
        "AppEditorLookupId": "12",
        "Description": "Discuss project goals and objectives\nAssign roles and responsibilities\nSet project timeline and milestones",
        "EstimatedDuration": 2.5,
        "ProjectManager": "12",
        "Attendees": "13;14",
        "Status": "Not Started",
        "MeetingDate": "2023-06-15T09:00:00Z"
    \}
}
```

### Delete drive item

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**
**Sample Output**

```json
{
    "success": true
}
```

### Download file

Download a file.
**Sample Input**

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

**Sample Output**

```json
{
    "file": \{
        "name": "Project_Report.docx",
        "url": "https://contoso.sharepoint.com/sites/Marketing/_layouts/15/download.aspx?UniqueId=01BZQOBTDQJZ7UEXLE5BGYP3RNLBHXKN5Y",
        "mime_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
        "expires": 1623456789
    \}
}
```

### Get item

Get an item in OneDrive or SharePoint.
**Sample Input**

```json
{
    "location": \{
        "site_id": "contoso.sharepoint.com,2a1f3-b87d-4328-9e2a-7d5b59b4a96f,5a1f3-b92d-4329-9e2a-7d5b59b4a123",
        "site_drive_item_id": "01ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    \}
}
```

**Sample Output**

```json
{
    "@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",
    "createdBy": {
        "user": \{
            "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
            "displayName": "John Doe"
        \}
    },
    "createdDateTime": "2023-04-15T09:30:45Z",
    "eTag": "\"2D39F0AF-F0C6-4D41-B2F2-B70E3D7C8E3A,1\"",
    "id": "01ABCDEFGHIJKLMNOPQRSTUVWXYZ",
    "lastModifiedBy": {
        "user": \{
            "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
            "displayName": "John Doe"
        \}
    },
    "lastModifiedDateTime": "2023-04-15T10:15:30Z",
    "name": "Project Proposal",
    "parentReference": \{
        "driveId": "b!-RIj2DuyvEyV1T9tKRWECDgBfGo_IKhHvxGkTJBB12MqNZ7HH-VBSIO7k1vXh_y4",
        "driveType": "documentLibrary",
        "id": "01ABCDEFGHIJKLMNOPQRSTUVWXY1",
        "path": "/drive/root:/Documents"
    \},
    "webUrl": "https://contoso.sharepoint.com/sites/Marketing/Shared%20Documents/Project%20Proposal",
    "cTag": "\"c:{2D39F0AF-F0C6-4D41-B2F2-B70E3D7C8E3A},0\"",
    "fileSystemInfo": \{
        "createdDateTime": "2023-04-15T09:30:45Z",
        "lastModifiedDateTime": "2023-04-15T10:15:30Z"
    \},
    "folder": {
        "childCount": 5
    },
    "size": 1024
}
```

### Get list item

Return information about an item.
**Sample Input**

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

**Sample Output**

```json
{
    "@odata.context": "https://contoso.sharepoint.com/sites/Marketing/_api/Web/Lists(guid'1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p')/Items(42)",
    "@odata.etag": "\"1\"",
    "createdBy": {
        "user": \{
            "email": "john.doe@contoso.com",
            "id": "12345678-90ab-cdef-1234-567890abcdef",
            "displayName": "John Doe"
        \}
    },
    "createdDateTime": "2023-06-15T10:30:00Z",
    "eTag": "\"1\"",
    "id": "42",
    "lastModifiedBy": {
        "user": \{
            "email": "jane.smith@contoso.com",
            "id": "98765432-10fe-dcba-9876-543210fedcba",
            "displayName": "Jane Smith"
        \}
    },
    "lastModifiedDateTime": "2023-06-15T14:45:00Z",
    "parentReference": \{
        "listId": "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
        "siteId": "contoso.sharepoint.com,2c1b4a3f-7a3e-4b9c-8d9a-5f9b7c1d3e5f,6a1b2c3d-4e5f-6g7h-8i9j-0k1l2m3n4o5p"
    \},
    "webUrl": "https://contoso.sharepoint.com/sites/Marketing/Lists/Events/42_.000",
    "contentType": \{
        "id": "0x0100123456789ABCDEF",
        "name": "Event"
    \},
    "fields@odata.navigationLink": "https://contoso.sharepoint.com/sites/Marketing/_api/Web/Lists(guid'1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p')/Items(42)/Fields",
    "fields": \{
        "@odata.etag": "\"1\"",
        "ID": 42,
        "ContentType": "Event",
        "Title": "Annual Company Picnic",
        "Modified": "2023-06-15T14:45:00Z",
        "Created": "2023-06-15T10:30:00Z",
        "AuthorLookupId": "12345678-90ab-cdef-1234-567890abcdef",
        "EditorLookupId": "98765432-10fe-dcba-9876-543210fedcba",
        "_UIVersionString": "1.0",
        "Attachments": false,
        "Edit": "https://contoso.sharepoint.com/sites/Marketing/Lists/Events/42_.000",
        "LinkTitleNoMenu": "Annual Company Picnic",
        "LinkTitle": "Annual Company Picnic",
        "ItemChildCount": "0",
        "FolderChildCount": "0",
        "_ComplianceFlags": "",
        "_ComplianceTag": "",
        "_ComplianceTagWrittenTime": "",
        "_ComplianceTagUserId": "",
        "AppAuthorLookupId": "12345678-90ab-cdef-1234-567890abcdef",
        "AppEditorLookupId": "98765432-10fe-dcba-9876-543210fedcba",
        "EventDate": "2023-07-15T11:00:00Z",
        "EndDate": "2023-07-15T16:00:00Z",
        "fRecurrence": false
    \}
}
```

### Get site

Return a site.
**Sample Input**

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

**Sample Output**

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

### List children

Return a collection of files and folders in the children relationship of a DriveItem.
**Sample Input**
**Sample Output**

```json
{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b%21eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA')/root/children",
    "value": [
        {
            "createdBy": {
                "user": \{
                    "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
                    "displayName": "John Doe"
                \}
            },
            "createdDateTime": "2023-05-15T09:30:00Z",
            "eTag": "\"{13A28C1A-E2F7-4FEA-B4BD-5396F4FE0D99},1\"",
            "id": "01NKDM6LCBXHBVKLRWQBHZLXS4UH3DBMKJ",
            "lastModifiedBy": {
                "user": \{
                    "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
                    "displayName": "John Doe"
                \}
            },
            "lastModifiedDateTime": "2023-05-15T09:30:00Z",
            "name": "Project Documents",
            "parentReference": \{
                "driveId": "b!eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA",
                "driveType": "documentLibrary",
                "id": "01NKDM6LCBXHBVKLRWQBHZLXS4UH3DBMKJ",
                "path": "/drives/b!eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA/root:"
            \},
            "webUrl": "https://contoso.sharepoint.com/sites/ProjectX/Shared%20Documents/Project%20Documents",
            "cTag": "\"c:{13A28C1A-E2F7-4FEA-B4BD-5396F4FE0D99},0\"",
            "fileSystemInfo": \{
                "createdDateTime": "2023-05-15T09:30:00Z",
                "lastModifiedDateTime": "2023-05-15T09:30:00Z"
            \},
            "folder": {
                "childCount": 3
            },
            "size": 0
        },
        {
            "createdBy": {
                "user": \{
                    "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
                    "displayName": "John Doe"
                \}
            },
            "createdDateTime": "2023-05-15T10:15:00Z",
            "eTag": "\"{A1B2C3D4-E5F6-4A5B-8C7D-9E0F1A2B3C4D},1\"",
            "id": "01NKDM6LCPVJK2LTPEB5CZ2NSGTCQSJM3Y",
            "lastModifiedBy": {
                "user": \{
                    "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
                    "displayName": "John Doe"
                \}
            },
            "lastModifiedDateTime": "2023-05-15T10:15:00Z",
            "name": "Project_Plan.xlsx",
            "parentReference": \{
                "driveId": "b!eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA",
                "driveType": "documentLibrary",
                "id": "01NKDM6LCBXHBVKLRWQBHZLXS4UH3DBMKJ",
                "path": "/drives/b!eUswOTItNzA4NS00YzY5LTkwOWItNDM2NTk0YzNjNTU2IUFCQzEyMzQ1Njc4OTAxMjM0NTY3ODkwMTIzNDU2Nzg5MA/root:"
            \},
            "webUrl": "https://contoso.sharepoint.com/sites/ProjectX/Shared%20Documents/Project_Plan.xlsx",
            "cTag": "\"c:{A1B2C3D4-E5F6-4A5B-8C7D-9E0F1A2B3C4D},0\"",
            "fileSystemInfo": \{
                "createdDateTime": "2023-05-15T10:15:00Z",
                "lastModifiedDateTime": "2023-05-15T10:15:00Z"
            \},
            "size": 25600
        }
    ]
}
```

### List list items

Return the items of a list.
**Sample Input**

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

**Sample Output**

```json
{
    "@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",
    "value": [
        {
            "@odata.etag": "\"6789abcd-1234-5678-90ab-cd1234567890,2\"",
            "createdBy": {
                "user": \{
                    "email": "john.doe@contoso.com",
                    "id": "12345678-90ab-cdef-1234-567890abcdef",
                    "displayName": "John Doe"
                \}
            },
            "createdDateTime": "2023-05-15T10:30:45Z",
            "eTag": "\"6789abcd-1234-5678-90ab-cd1234567890,2\"",
            "id": "1",
            "lastModifiedBy": {
                "user": \{
                    "email": "jane.smith@contoso.com",
                    "id": "98765432-10fe-dcba-9876-543210fedcba",
                    "displayName": "Jane Smith"
                \}
            },
            "lastModifiedDateTime": "2023-05-16T14:20:30Z",
            "parentReference": \{
                "listId": "b7c84cb7-1234-5678-90ab-cd1234567890",
                "siteId": "contoso.sharepoint.com,2a1b9a3b-1234-5678-90ab-cd1234567890,3f3a9a2b-9876-5432-10fe-dc9876543210"
            \},
            "webUrl": "https://contoso.sharepoint.com/sites/ProjectX/Lists/Tasks/1_.000",
            "contentType": \{
                "id": "0x0100123456789ABCDEF0123456789ABCDEF01",
                "name": "Item"
            \}
        }
    ]
}
```

### List site drives

Return a list of drives for a site.
**Sample Input**

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

**Sample Output**

```json
{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives",
    "value": [
        {
            "createdBy": {
                "user": {
                    "displayName": "John Doe"
                }
            },
            "createdDateTime": "2023-05-15T10:30:45Z",
            "description": "Documents for Marketing Team",
            "id": "b!eIGlvxoGg0aYnkOcgnVk9plxs_bRlkFNl1wo_0K4E1pDj_ZmDYdEQJmHuTZ-zUFg",
            "lastModifiedBy": {
                "user": \{
                    "email": "johndoe@contoso.com",
                    "id": "48d31887-5fad-4d73-a9f5-3c356e68a038",
                    "displayName": "John Doe"
                \}
            },
            "lastModifiedDateTime": "2023-05-20T14:22:10Z",
            "name": "Marketing Documents",
            "webUrl": "https://contoso.sharepoint.com/sites/MarketingTeam/Shared%20Documents",
            "driveType": "documentLibrary",
            "owner": {
                "group": \{
                    "id": "1c1110dd-49d3-49fd-8627-ce82b33f2b20",
                    "displayName": "Marketing Team"
                \}
            },
            "quota": \{
                "deleted": 205824,
                "fileCount": 128,
                "remaining": 27487790694,
                "state": "normal",
                "total": 27487790694,
                "used": 205824
            \}
        }
    ]
}
```

### List site lists

Return a list of lists for a site.
**Sample Input**

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

**Sample Output**

```json
{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('contoso.sharepoint.com%2C2a1b9eab-4927-4b75-8f80-8e0c2a642082%2C3a1b9eab-5927-4b75-8f80-8e0c2a642083')/lists",
    "value": [
        {
            "@odata.etag": "\"4f32a981-9359-4cc6-a91b-f2c8551a1f22,2\"",
            "createdBy": {
                "user": {
                    "displayName": "John Doe"
                }
            },
            "createdDateTime": "2023-05-15T10:30:15Z",
            "description": "This list contains all project documents",
            "eTag": "\"4f32a981-9359-4cc6-a91b-f2c8551a1f22,2\"",
            "id": "b!eKkw9tEGUEiM_mNhHRkDVmklSWVBvkNBn3ckJee3a1b9eab-4927-4b75-8f80-8e0c2a642084",
            "lastModifiedBy": {
                "user": \{
                    "email": "jane.smith@contoso.com",
                    "id": "a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6",
                    "displayName": "Jane Smith"
                \}
            },
            "lastModifiedDateTime": "2023-05-20T14:45:30Z",
            "name": "Project Documents",
            "parentReference": \{
                "siteId": "contoso.sharepoint.com,2a1b9eab-4927-4b75-8f80-8e0c2a642082,3a1b9eab-5927-4b75-8f80-8e0c2a642083"
            \},
            "webUrl": "https://contoso.sharepoint.com/sites/ProjectX/Lists/ProjectDocuments",
            "color": "blue",
            "displayName": "Project Documents",
            "icon": "documentLibrary",
            "list": \{
                "contentTypesEnabled": true,
                "hidden": false,
                "template": "documentLibrary",
                "type": "library"
            \}
        }
    ]
}
```

### List sites

Return a list of sites.
**Sample Input**

```json
{
    "search": "Project X"
}
```

**Sample Output**

```json
{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites",
    "value": [
        {
            "createdDateTime": "2023-05-15T09:30:00Z",
            "description": "Collaboration space for Project X team",
            "id": "contoso.sharepoint.com,2c1b3c5d-e1f2-4a5b-8c9d-0e1f2a3b4c5d,6a7b8c9d-0e1f-2a3b-4c5d-6e7f8a9b0c1d",
            "lastModifiedDateTime": "2023-06-01T14:45:00Z",
            "name": "Project X",
            "webUrl": "https://contoso.sharepoint.com/sites/ProjectX",
            "root": {},
            "sensitivityLabel": {},
            "siteCollection": {
                "hostName": "contoso.sharepoint.com"
            },
            "title": "Project X Team Site"
        },
        {
            "createdDateTime": "2023-05-20T11:00:00Z",
            "description": "Document repository for Project X",
            "id": "contoso.sharepoint.com,3d4e5f6g-7h8i-9j0k-1l2m-3n4o5p6q7r8s",
            "lastModifiedDateTime": "2023-05-31T16:20:00Z",
            "name": "Project X Docs",
            "webUrl": "https://contoso.sharepoint.com/sites/ProjectXDocs",
            "root": {},
            "sensitivityLabel": {},
            "siteCollection": {
                "hostName": "contoso.sharepoint.com"
            },
            "title": "Project X Document Library"
        }
    ]
}
```

### Move item

Move an item to a different folder.
**Sample Input**
**Sample Output**

```json
{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('b!eYzQQp_N3UKyVNMul8KJI8PkQJN9hE1AjsMQhHYu3qM_bWUeu52CRbgalLMuI_QD')/items/$entity",
    "createdBy": {
        "application": \{
            "id": "89ea5c94-7736-4e25-95ad-3fa95f62b66e",
            "displayName": "Tray.io Connector"
        \},
        "user": \{
            "id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
            "displayName": "John Doe"
        \}
    },
    "createdDateTime": "2023-06-15T14:30:45Z",
    "eTag": "\"{13AFDA89-1234-5678-90AB-CDEF01234567},1\"",
    "id": "01ABCDEFGHIJKLMNOPQRSTUVWXYZ",
    "lastModifiedBy": {
        "application": \{
            "id": "89ea5c94-7736-4e25-95ad-3fa95f62b66e",
            "displayName": "Tray.io Connector"
        \},
        "user": \{
            "id": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
            "displayName": "John Doe"
        \}
    },
    "lastModifiedDateTime": "2023-06-15T14:30:45Z",
    "name": "Quarterly Report Q2 2023.docx",
    "parentReference": \{
        "driveId": "b!eYzQQp_N3UKyVNMul8KJI8PkQJN9hE1AjsMQhHYu3qM_bWUeu52CRbgalLMuI_QD",
        "driveType": "documentLibrary",
        "id": "01ZYXWVUTSRQPONMLKJIHGFEDCBA",
        "path": "/drives/b!eYzQQp_N3UKyVNMul8KJI8PkQJN9hE1AjsMQhHYu3qM_bWUeu52CRbgalLMuI_QD/root:/Folder1/Subfolder"
    \},
    "webUrl": "https://contoso.sharepoint.com/sites/Marketing/Shared%20Documents/Folder1/Subfolder/Quarterly%20Report%20Q2%202023.docx",
    "cTag": "\"c:{13AFDA89-1234-5678-90AB-CDEF01234567},1\"",
    "fileSystemInfo": \{
        "createdDateTime": "2023-06-15T14:30:45Z",
        "lastModifiedDateTime": "2023-06-15T14:30:45Z"
    \},
    "size": 2048000
}
```

### Raw HTTP request (advanced)

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

```json
{
    "method": "GET",
    "url": {
        "endpoint": "/sites/marketing/lists/employees"
    },
    "headers": [
        \{
            "key": "Accept",
            "value": "application/json"
        \}
    ],
    "query_parameters": [
        \{
            "key": "expand",
            "value": "fields"
        \}
    ],
    "body": {
        "none": null
    },
    "include_raw_body": false,
    "parse_response": "true"
}
```

**Sample Output**

```json
{
    "response": {
        "status_code": 200,
        "headers": \{
            "Content-Type": "application/json",
            "Cache-Control": "no-cache"
        \},
        "body": {
            "value": [
                {
                    "id": "1",
                    "fields": \{
                        "Title": "John Doe",
                        "Email": "john.doe@example.com",
                        "Department": "Marketing",
                        "Position": "Manager"
                    \}
                },
                {
                    "id": "2",
                    "fields": \{
                        "Title": "Jane Smith",
                        "Email": "jane.smith@example.com",
                        "Department": "Marketing",
                        "Position": "Specialist"
                    \}
                }
            ]
        }
    }
}
```

### Upload file

Upload a file to a drive.
**Sample Input**
**Sample Output**

```json
{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#drives('ABCDEFGHIJ')/root/children/$entity",
    "@content.downloadUrl": "https://contoso.sharepoint.com/sites/Project/_layouts/15/download.aspx?UniqueId=1234567890abcdef&Translate=false&tempauth=eyJ0eXAiOiJKV1QiLCJhbGciOiJub25lIn0.eyJhdWQiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAvY29udG9zby5zaGFyZXBvaW50LmNvbUAxMjM0NTY3OC05MTIzLTRhYmMtOTg3Ni1hYmNkZWYxMjM0NTYiLCJpc3MiOiIwMDAwMDAwMy0wMDAwLTBmZjEtY2UwMC0wMDAwMDAwMDAwMDAiLCJuYmYiOiIxNjE3MjA1MjAwIiwiZXhwIjoiMTYxNzIwODgwMCIsImVuZHBvaW50dXJsIjoiL3NpdGVzL1Byb2plY3QvX2xheW91dHMvMTUvZG93bmxvYWQuYXNweCJ9.&ApiVersion=2.0",
    "createdBy": {
        "user": \{
            "id": "1234567890",
            "displayName": "John Doe"
        \}
    },
    "createdDateTime": "2023-05-01T10:30:15Z",
    "eTag": "\"1234567890ABCDEF1234567890ABCDEF\"",
    "id": "1234567890ABCDEF1234567890ABCDEF!1234",
    "lastModifiedBy": {
        "application": \{
            "id": "12345678-1234-1234-1234-1234567890AB",
            "displayName": "Tray.io"
        \},
        "user": \{
            "id": "1234567890",
            "displayName": "John Doe"
        \}
    },
    "lastModifiedDateTime": "2023-05-01T10:30:15Z",
    "name": "example.docx",
    "parentReference": \{
        "driveId": "ABCDEFGHIJ",
        "driveType": "documentLibrary",
        "id": "1234567890ABCDEF1234567890ABCDEF!1000",
        "path": "/drives/ABCDEFGHIJ/root:/documents/projects"
    \},
    "webUrl": "https://contoso.sharepoint.com/sites/Project/Shared%20Documents/documents/projects/example.docx",
    "cTag": "\"c:{1234567890ABCDEF-1234-1234-1234-1234567890ABCDEF},1\"",
    "file": {
        "hashes": {
            "quickXorHash": "1234567890ABCDEF1234567890ABCDEF1234567890ABCDEF=="
        },
        "irmEnabled": false,
        "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
    },
    "fileSystemInfo": \{
        "createdDateTime": "2023-05-01T10:30:15Z",
        "lastModifiedDateTime": "2023-05-01T10:30:15Z"
    \},
    "size": 12345
}
```

## DDL operations

### List list items fields (DDL)

> **Warning:** 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**

```json
{}
```

**Sample Output**

```json
{
    "fields": [
        \{
            "name": "Title",
            "type": "Text",
            "required": true
        \},
        \{
            "name": "Description",
            "type": "Note",
            "required": false
        \},
        \{
            "name": "DueDate",
            "type": "DateTime",
            "required": false
        \},
        \{
            "name": "Status",
            "type": "Choice",
            "required": true,
            "choices": [
                "Not Started",
                "In Progress",
                "Completed"
            ]
        \},
        \{
            "name": "AssignedTo",
            "type": "Person",
            "required": false
        \},
        \{
            "name": "Priority",
            "type": "Choice",
            "required": false,
            "choices": [
                "Low",
                "Medium",
                "High"
            ]
        \},
        \{
            "name": "Attachments",
            "type": "Attachments",
            "required": false
        \},
        \{
            "name": "Created",
            "type": "DateTime",
            "required": true
        \},
        \{
            "name": "Modified",
            "type": "DateTime",
            "required": true
        \}
    ]
}
```

### List site drives (DDL)

> **Warning:** 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**

```json
{}
```

**Sample Output**

```json
{
    "drives": [
        {
            "id": "b!3qFcYaS-EEGDrHinjvd7VZJHjDOsInRDnkqUT9T_ozd1U-WGDaz8S4mz7UlEQcp5",
            "driveType": "documentLibrary",
            "name": "Documents",
            "webUrl": "https://contoso.sharepoint.com/sites/Marketing/Shared%20Documents",
            "description": "Default document library for the Marketing site",
            "createdDateTime": "2023-03-15T09:30:45Z",
            "lastModifiedDateTime": "2023-06-22T14:22:18Z",
            "quota": \{
                "total": 1099511627776,
                "used": 2147483648,
                "remaining": 1097364144128,
                "deleted": 0,
                "state": "normal"
            \}
        },
        {
            "id": "b!3qFcYaS-EEGDrHinjvd7VZJHjDOsInRDnkqUT9T_ozd1U-WGDaz8S4mz7UlEQcp6",
            "driveType": "documentLibrary",
            "name": "Project Files",
            "webUrl": "https://contoso.sharepoint.com/sites/Marketing/Project%20Files",
            "description": "Library for storing project-related documents",
            "createdDateTime": "2023-04-02T11:15:30Z",
            "lastModifiedDateTime": "2023-06-21T16:45:22Z",
            "quota": \{
                "total": 1099511627776,
                "used": 5368709120,
                "remaining": 1094142918656,
                "deleted": 0,
                "state": "normal"
            \}
        }
    ]
}
```

### List site lists (DDL)

> **Warning:** 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**

```json
{}
```

**Sample Output**

```json
[
    {
        "id": "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
        "name": "Documents",
        "description": "Use this library to store documents for the team.",
        "createdDateTime": "2023-05-15T10:30:45Z",
        "lastModifiedDateTime": "2023-06-01T14:22:33Z",
        "webUrl": "https://contoso.sharepoint.com/sites/Marketing/Documents",
        "list": \{
            "contentTypesEnabled": true,
            "hidden": false,
            "template": "documentLibrary"
        \}
    },
    {
        "id": "2b3c4d5e-6f7g-8h9i-0j1k-2l3m4n5o6p7q",
        "name": "Tasks",
        "description": "Track team tasks and their progress.",
        "createdDateTime": "2023-05-16T09:15:30Z",
        "lastModifiedDateTime": "2023-05-31T16:45:12Z",
        "webUrl": "https://contoso.sharepoint.com/sites/Marketing/Tasks",
        "list": \{
            "contentTypesEnabled": true,
            "hidden": false,
            "template": "tasks"
        \}
    },
    {
        "id": "3c4d5e6f-7g8h-9i0j-1k2l-3m4n5o6p7q8r",
        "name": "Calendar",
        "description": "Team events and schedules.",
        "createdDateTime": "2023-05-17T11:20:00Z",
        "lastModifiedDateTime": "2023-06-02T08:10:55Z",
        "webUrl": "https://contoso.sharepoint.com/sites/Marketing/Calendar",
        "list": \{
            "contentTypesEnabled": false,
            "hidden": false,
            "template": "events"
        \}
    }
]
```

### List sites (DDL)

> **Warning:** 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**
**Sample Output**

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