Skip to content

Commit 79af1b3

Browse files
jorwoodsclaude
andcommitted
docs: add tasks.create method to api-ref.md
Documents the tasks.create method for creating extract refresh tasks, added in REST API version 3.19, which was not previously documented. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9162447 commit 79af1b3

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

docs/api-ref.md

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4793,8 +4793,50 @@ Error | Description
47934793

47944794
```
47954795

4796-
<br>
4797-
<br>
4796+
<br>
4797+
<br>
4798+
4799+
#### tasks.create
4800+
4801+
```py
4802+
tasks.create(extract_item)
4803+
```
4804+
4805+
Creates a new extract refresh task on the site.
4806+
4807+
**Parameters**
4808+
4809+
Name | Description
4810+
:--- | :---
4811+
`extract_item` | The `TaskItem` specifying the extract refresh task to create. The task item must have the target workbook or datasource set.
4812+
4813+
**Exceptions**
4814+
4815+
Error | Description
4816+
:--- | :---
4817+
`ValueError` | Raises an exception if no extract item is provided.
4818+
4819+
**Returns**
4820+
4821+
Returns the created `TaskItem`.
4822+
4823+
**Version**
4824+
4825+
Version 3.19 and later. See [REST API versions](https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_concepts_versions.htm).
4826+
4827+
**Example**
4828+
4829+
```py
4830+
import tableauserverclient as TSC
4831+
4832+
task_item = TSC.TaskItem(TSC.TaskItem.Type.ExtractRefresh)
4833+
task_item.target = TSC.Target(datasource_id, 'datasource')
4834+
new_task = server.tasks.create(task_item)
4835+
print("Created task ID: {}".format(new_task.id))
4836+
```
4837+
4838+
<br>
4839+
<br>
47984840

47994841

48004842
---

0 commit comments

Comments
 (0)