All URIs are relative to https://api.pipedrive.com/api/v2.
| Method | HTTP request | Description |
|---|---|---|
| addTask() | POST /tasks | Add a task |
| deleteTask() | DELETE /tasks/{id} | Delete a task |
| getTask() | GET /tasks/{id} | Get details of a task |
| getTasks() | GET /tasks | Get all tasks |
| updateTask() | PATCH /tasks/{id} | Update a task |
addTask($task_post_request): \Pipedrive\versions\v2\Model\AddTaskResponseAdd a task
Adds a new task.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('x-api-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('x-api-token', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Pipedrive\versions\v2\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$task_post_request = new \Pipedrive\versions\v2\Model\TaskPostRequest(); // \Pipedrive\versions\v2\Model\TaskPostRequest
try {
$result = $apiInstance->addTask($task_post_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TasksApi->addTask: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| task_post_request | \Pipedrive\versions\v2\Model\TaskPostRequest |
\Pipedrive\versions\v2\Model\AddTaskResponse
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteTask($id): \Pipedrive\versions\v2\Model\DeleteTaskResponseDelete a task
Marks a task as deleted. If the task has subtasks, those will also be deleted.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('x-api-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('x-api-token', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Pipedrive\versions\v2\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 56; // int | The ID of the task
try {
$result = $apiInstance->deleteTask($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TasksApi->deleteTask: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | The ID of the task |
\Pipedrive\versions\v2\Model\DeleteTaskResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getTask($id): \Pipedrive\versions\v2\Model\GetTaskResponseGet details of a task
Returns the details of a specific task.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('x-api-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('x-api-token', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Pipedrive\versions\v2\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 56; // int | The ID of the task
try {
$result = $apiInstance->getTask($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TasksApi->getTask: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | The ID of the task |
\Pipedrive\versions\v2\Model\GetTaskResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getTasks($cursor, $limit, $is_done, $is_milestone, $assignee_id, $project_id, $parent_task_id): \Pipedrive\versions\v2\Model\GetTasksResponseGet all tasks
Returns all tasks.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('x-api-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('x-api-token', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Pipedrive\versions\v2\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$cursor = 'cursor_example'; // string | For pagination, the marker (an opaque string value) representing the first item on the next page
$limit = 100; // int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
$is_done = True; // bool | Whether the task is done or not. If omitted, both done and not done tasks are returned.
$is_milestone = True; // bool | Whether the task is a milestone or not. If omitted, both milestone and non-milestone tasks are returned.
$assignee_id = 56; // int | If supplied, only tasks assigned to this user are returned
$project_id = 56; // int | If supplied, only tasks belonging to this project are returned
$parent_task_id = 'parent_task_id_example'; // string | If `null` is supplied, only root-level tasks (without a parent) are returned. If an integer is supplied, only subtasks of that specific task are returned. By default all tasks are returned.
try {
$result = $apiInstance->getTasks($cursor, $limit, $is_done, $is_milestone, $assignee_id, $project_id, $parent_task_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TasksApi->getTasks: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| cursor | string | For pagination, the marker (an opaque string value) representing the first item on the next page | [optional] |
| limit | int | For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed. | [optional] |
| is_done | bool | Whether the task is done or not. If omitted, both done and not done tasks are returned. | [optional] |
| is_milestone | bool | Whether the task is a milestone or not. If omitted, both milestone and non-milestone tasks are returned. | [optional] |
| assignee_id | int | If supplied, only tasks assigned to this user are returned | [optional] |
| project_id | int | If supplied, only tasks belonging to this project are returned | [optional] |
| parent_task_id | string | If `null` is supplied, only root-level tasks (without a parent) are returned. If an integer is supplied, only subtasks of that specific task are returned. By default all tasks are returned. | [optional] |
\Pipedrive\versions\v2\Model\GetTasksResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateTask($id, $task_patch_request): \Pipedrive\versions\v2\Model\UpdateTaskResponseUpdate a task
Updates a task.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: api_key
$config = (new Pipedrive\versions\v2\Configuration())->setApiKey('x-api-token', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = (new Pipedrive\versions\v2\Configuration())->setApiKeyPrefix('x-api-token', 'Bearer');
// Configure OAuth2 access token for authorization: oauth2
$config = (new Pipedrive\versions\v2\Configuration())->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new Pipedrive\versions\v2\Api\TasksApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$id = 56; // int | The ID of the task
$task_patch_request = new \Pipedrive\versions\v2\Model\TaskPatchRequest(); // \Pipedrive\versions\v2\Model\TaskPatchRequest
try {
$result = $apiInstance->updateTask($id, $task_patch_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TasksApi->updateTask: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| id | int | The ID of the task | |
| task_patch_request | \Pipedrive\versions\v2\Model\TaskPatchRequest | [optional] |
\Pipedrive\versions\v2\Model\UpdateTaskResponse
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]