List tables
-
Article
-
- 2 minutes to read
-
Namespace: microsoft.graph
Retrieve a list of table objects.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type |
Permissions (from least to most privileged) |
Delegated (work or school account) |
Files.Read |
Delegated (personal Microsoft account) |
Not supported. |
Application |
Not supported. |
HTTP request
GET /me/drive/items/{id}/workbook/tables
GET /me/drive/root:/{item-path}:/workbook/tables
Optional query parameters
This method supports the OData Query Parameters to help customize the response.
Name |
Description |
Authorization |
Bearer {token}. Required. |
Workbook-Session-Id |
Workbook session Id that determines if changes are persisted or not. Optional. |
Request body
Do not supply a request body for this method.
Response
If successful, this method returns a 200 OK
response code and collection of WorkbookTable objects in the response body.
Example
Request
Here is an example of the request.
GET https://graph.microsoft.com/v1.0/me/drive/items/{id}/workbook/tables
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var tables = await graphClient.Me.Drive.Items["{driveItem-id}"].Workbook.Tables
.Request()
.GetAsync();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
const options = {
authProvider,
};
const client = Client.init(options);
let tables = await client.api('/me/drive/items/{id}/workbook/tables')
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
MSHTTPClient *httpClient = [MSClientFactory createHTTPClientWithAuthenticationProvider:authenticationProvider];
NSString *MSGraphBaseURL = @"https://graph.microsoft.com/v1.0/";
NSMutableURLRequest *urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[MSGraphBaseURL stringByAppendingString:@"/me/drive/items/{id}/workbook/tables"]]];
[urlRequest setHTTPMethod:@"GET"];
MSURLSessionDataTask *meDataTask = [httpClient dataTaskWithRequest:urlRequest
completionHandler: ^(NSData *data, NSURLResponse *response, NSError *nserror) {
NSError *jsonError = nil;
MSCollection *collection = [[MSCollection alloc] initWithData:data error:&jsonError];
MSGraphWorkbookTable *workbookTable = [[MSGraphWorkbookTable alloc] initWithDictionary:[[collection value] objectAtIndex: 0] error:&nserror];
}];
[meDataTask execute];
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
WorkbookTableCollectionPage tables = graphClient.me().drive().items("{id}").workbook().tables()
.buildRequest()
.get();
For details about how to add the SDK to your project and create an authProvider instance, see the SDK documentation.
Response
Here is an example of the response. Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-type: application/json
{
"value": [
{
"id": "99",
"name": "name-value",
"showHeaders": true,
"showTotals": true,
"style": "style-value"
}
]
}