Operations (sample payloads)

Main operations
Copy

Create table
Copy

Create a new table in a worksheet.

Sample Input

1
{
2
"workbook_id": "1A2B3C4D5E6F7G8H",
3
"worksheet_information": "Sheet1",
4
"table_address": {
5
"beginning_cell": "A1",
6
"ending_cell": "D10"
7
},
8
"has_headers": true
9
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/worksheets('Sheet1')/tables/$entity",
3
"@odata.type": "#microsoft.graph.workbookTable",
4
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/worksheets('Sheet1')/tables('Table1')",
5
"id": "Table1",
6
"name": "Table1",
7
"showHeaders": true,
8
"showTotals": false,
9
"style": "TableStyleMedium2",
10
"highlightFirstColumn": false,
11
"highlightLastColumn": false,
12
"showBandedColumns": false,
13
"showBandedRows": true,
14
"showFilterButton": true,
15
"legacyId": "1"
16
}

Create table column
Copy

Create a new table column.

Sample Input

1
{
2
"workbook_id": "1A2B3C4D5E6F7G8H9I0J",
3
"table_information": "Sales2023",
4
"column_name": "Revenue",
5
"column_index": 3,
6
"column_value": [
7
[
8
"1000"
9
],
10
[
11
"1500"
12
],
13
[
14
"2000"
15
],
16
[
17
"1800"
18
],
19
[
20
"2200"
21
]
22
]
23
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#workbook/tables('Sales2023')/columns/$entity",
3
"@odata.id": "https://graph.microsoft.com/v1.0/me/drive/items/1A2B3C4D5E6F7G8H9I0J/workbook/tables('Sales2023')/columns('Revenue')",
4
"values": [
5
[
6
"Revenue"
7
],
8
[
9
"1000"
10
],
11
[
12
"1500"
13
],
14
[
15
"2000"
16
],
17
[
18
"1800"
19
],
20
[
21
"2200"
22
]
23
],
24
"id": "4",
25
"index": 3,
26
"name": "Revenue"
27
}

Create table row
Copy

Create a new table row.

Sample Input

1
{
2
"workbook_id": "1A2B3C4D5E6F7G8H9I0J",
3
"table_information": "Sales2023",
4
"row_index": 5,
5
"row_values": [
6
[
7
"2023-05-15",
8
"John Doe",
9
"Widget X",
10
100,
11
19.99,
12
1999
13
]
14
]
15
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#workbook/tables('Sales2023')/rows/$entity",
3
"@odata.type": "#microsoft.graph.workbookTableRow",
4
"@odata.id": "https://graph.microsoft.com/v1.0/me/drive/items/1A2B3C4D5E6F7G8H9I0J/workbook/tables('Sales2023')/rows/index(5)",
5
"index": 5,
6
"values": [
7
[
8
"2023-05-15",
9
"John Doe",
10
"Widget X",
11
100,
12
19.99,
13
1999
14
]
15
]
16
}

Create worksheet
Copy

Add a new worksheet to the workbook.

Sample Input

1
{
2
"workbook_id": "1A2B3C4D5E6F7G8H9I0J",
3
"worksheet_name": "Sales Report Q2"
4
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H9I0J')/workbook/worksheets/$entity",
3
"@odata.type": "#microsoft.graph.workbookWorksheet",
4
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H9I0J')/workbook/worksheets('Sales%20Report%20Q2')",
5
"id": "SalesReportQ2!A1:XFD1048576",
6
"name": "Sales Report Q2",
7
"position": 3,
8
"visibility": "Visible"
9
}

Get shared item
Copy

Retrieve a shared item by using a shared URL.

Sample Input

1
{
2
"shared_url": "https://company-my.sharepoint.com/:f:/p/johndoe/AbCdEfGhIjKlMnOpQrStUvWxYz123456?e=7890AB"
3
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#shares('u!aHR0cHM6Ly9jb21wYW55LW15LnNoYXJlcG9pbnQuY29tLzpmOi9wL2pvaG5kb2UvQWJDZEVmR2hJaktsTW5PcFFyU3RVdld4WXoxMjM0NTY_ZT03ODkwQUI=')/driveItem/$entity",
3
"name": "Project Documents"
4
}

List columns
Copy

Retrieve a list of table column objects.

Sample Input

1
{
2
"workbook_id": "1A2B3C4D5E6F7G8H",
3
"table_information": "Sales2023",
4
"page_size": 50,
5
"skip": 0
6
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Sales2023')/columns",
3
"value": [
4
{
5
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Sales2023')/columns('1')",
6
"values": [
7
[
8
"Date"
9
]
10
],
11
"id": "1",
12
"index": 0,
13
"name": "Date"
14
},
15
{
16
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Sales2023')/columns('2')",
17
"values": [
18
[
19
"Product"
20
]
21
],
22
"id": "2",
23
"index": 1,
24
"name": "Product"
25
},
26
{
27
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Sales2023')/columns('3')",
28
"values": [
29
[
30
"Quantity"
31
]
32
],
33
"id": "3",
34
"index": 2,
35
"name": "Quantity"
36
},
37
{
38
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Sales2023')/columns('4')",
39
"values": [
40
[
41
"Revenue"
42
]
43
],
44
"id": "4",
45
"index": 3,
46
"name": "Revenue"
47
}
48
]
49
}

List rows
Copy

Retrieve a list of table row objects.

Sample Input

1
{
2
"workbook_id": "1A2B3C4D5E6F7G8H",
3
"table_information": "Employees",
4
"page_size": 50,
5
"skip": 0
6
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Employees')/rows",
3
"value": [
4
{
5
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Employees')/rows(0)",
6
"index": 0,
7
"values": [
8
[
9
"John",
10
"Doe",
11
"Sales",
12
50000
13
]
14
]
15
},
16
{
17
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Employees')/rows(1)",
18
"index": 1,
19
"values": [
20
[
21
"Jane",
22
"Smith",
23
"Marketing",
24
55000
25
]
26
]
27
},
28
{
29
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Employees')/rows(2)",
30
"index": 2,
31
"values": [
32
[
33
"Bob",
34
"Johnson",
35
"IT",
36
60000
37
]
38
]
39
}
40
]
41
}

List tables
Copy

Retrieve a list of table objects.

Sample Input

1
{
2
"workbook_id": "1A2B3C4D5E6F7G8H",
3
"page_size": 50,
4
"skip": 0
5
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables",
3
"value": [
4
{
5
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Table1')",
6
"style": "TableStyleMedium2",
7
"name": "Sales Data",
8
"showFilterButton": true,
9
"id": "Table1",
10
"highlightLastColumn": false,
11
"highlightFirstColumn": true,
12
"legacyId": "1",
13
"showBandedColumns": false,
14
"showBandedRows": true,
15
"showHeaders": true,
16
"showTotals": false
17
},
18
{
19
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H')/workbook/tables('Table2')",
20
"style": "TableStyleLight1",
21
"name": "Inventory",
22
"showFilterButton": false,
23
"id": "Table2",
24
"highlightLastColumn": false,
25
"highlightFirstColumn": false,
26
"legacyId": "2",
27
"showBandedColumns": true,
28
"showBandedRows": false,
29
"showHeaders": true,
30
"showTotals": true
31
}
32
]
33
}

List worksheets
Copy

Retrieve a list of worksheet objects.

Sample Input

1
{
2
"workbook_id": "1A2B3C4D5E6F7G8H9I0J",
3
"page_size": 50,
4
"skip": 0
5
}

Sample Output

1
{
2
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H9I0J')/workbook/worksheets",
3
"value": [
4
{
5
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H9I0J')/workbook/worksheets('Sheet1')",
6
"id": "Sheet1",
7
"name": "Sheet1",
8
"position": 0,
9
"visibility": "Visible"
10
},
11
{
12
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H9I0J')/workbook/worksheets('Sheet2')",
13
"id": "Sheet2",
14
"name": "Sheet2",
15
"position": 1,
16
"visibility": "Visible"
17
},
18
{
19
"@odata.id": "/users('user@example.com')/drive/items('1A2B3C4D5E6F7G8H9I0J')/workbook/worksheets('Sheet3')",
20
"id": "Sheet3",
21
"name": "Sheet3",
22
"position": 2,
23
"visibility": "Hidden"
24
}
25
]
26
}

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": "/users"
5
},
6
"headers": [
7
{
8
"key": "Accept",
9
"value": "application/json"
10
}
11
],
12
"query_parameters": [
13
{
14
"key": "top",
15
"value": "10"
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": "87d349ed-44d7-43e1-9a83-5f2406dee5bd",
12
"displayName": "Adele Vance",
13
"userPrincipalName": "AdeleV@contoso.com",
14
"jobTitle": "Product Marketing Manager",
15
"mail": "AdeleV@contoso.com",
16
"mobilePhone": "+1 425 555 0109",
17
"officeLocation": "18/2111"
18
},
19
{
20
"id": "1e3d0f1a-8db3-47f3-85ac-9e6a8a980d4f",
21
"displayName": "Alex Wilber",
22
"userPrincipalName": "AlexW@contoso.com",
23
"jobTitle": "Marketing Assistant",
24
"mail": "AlexW@contoso.com",
25
"mobilePhone": "+1 425 555 0105",
26
"officeLocation": "131/1105"
27
}
28
]
29
}
30
}
31
}

DDL operations
Copy

List tables (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
"tableName": "Employees",
4
"ddl": "CREATE TABLE Employees (\n EmployeeID INT PRIMARY KEY,\n FirstName VARCHAR(50),\n LastName VARCHAR(50),\n Email VARCHAR(100),\n HireDate DATE,\n DepartmentID INT\n);"
5
},
6
{
7
"tableName": "Departments",
8
"ddl": "CREATE TABLE Departments (\n DepartmentID INT PRIMARY KEY,\n DepartmentName VARCHAR(100),\n ManagerID INT\n);"
9
},
10
{
11
"tableName": "Projects",
12
"ddl": "CREATE TABLE Projects (\n ProjectID INT PRIMARY KEY,\n ProjectName VARCHAR(100),\n StartDate DATE,\n EndDate DATE,\n Budget DECIMAL(10, 2)\n);"
13
}
14
]

List worksheets (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
"worksheets": [
3
{
4
"id": "Sheet1!A1:XFD1048576",
5
"name": "Sheet1",
6
"position": 0,
7
"visibility": "Visible"
8
},
9
{
10
"id": "Sheet2!A1:XFD1048576",
11
"name": "Sheet2",
12
"position": 1,
13
"visibility": "Visible"
14
},
15
{
16
"id": "Sheet3!A1:XFD1048576",
17
"name": "Sheet3",
18
"position": 2,
19
"visibility": "Hidden"
20
}
21
]
22
}