GET /tasks
1 min
GET
https://api.cmp.optimizely.com/v3/tasks
Query Parameters
- search_keystringExampleDescription
- campaignstringExampleDescription
- workflowstringExampleDescription
- milestonestringExampleDescription
- start_datestringExampleDescription
- due_datestringExampleDescription
- start_date__fromstring<date-time>ExampleDescriptionFormatdate-time
- start_date__tostring<date-time>ExampleDescriptionFormatdate-time
- due_date__fromstring<date-time>ExampleDescriptionFormatdate-time
- due_date__tostring<date-time>ExampleDescriptionFormatdate-time
- statusstring[]Example
[ "In Progress", "Not Started" ]
Description - offsetintegerExampleDescriptionDefault0Minimum0
- page_sizeintegerExampleDescriptionDefault10Minimum1Maximum100
Responses
200
- object
- dataTaskListResponseItem[]requiredDescription
- idstringrequiredExampleDescription
- titlestringrequiredExampleDescription
- start_atstringrequiredExampleDescription
- due_atstringrequiredExampleDescription
- modified_atstringrequiredExampleDescription
- reference_idstringrequiredExampleDescription
- is_completedbooleanrequiredDescription
- is_archivedbooleanrequiredDescription
- campaign_idstringrequiredExampleDescription
- workflow_idstringrequiredExampleDescription
- milestone_idstringrequiredExampleDescription
- statusstring<Archived | Completed | Overdue | Not Started | In Progress | On Hold>requiredExampleDescriptionAllowedArchivedCompletedOverdueNot StartedIn ProgressOn Hold
- linksobjectrequiredDescription
- selfstringrequiredExampleDescription
- campaignstringrequiredExampleDescription
- workflowstringrequiredExampleDescription
- milestonestringrequiredExampleDescription
- web_urlsobjectrequiredDescription
- selfstringrequiredExampleDescription
- paginationobjectrequired
- Pagination
- nextstringrequiredExampleDescription
- previousstringrequiredDescription
- object
- nextstringExample
401
- ErrorExample
{ "message": "Unauthorized" }Description- messagestringrequiredExampleDescription
- errorsmap<string, string>Description
403
- ErrorExample
{ "message": "You do not have the permission to perform this operation" }Description- messagestringrequiredExampleDescription
- errorsmap<string, string>Description
curl
curl --request GET \
--url 'https://api.cmp.optimizely.com/v3/tasks?offset=5&page_size=10' \
--header 'accept: application/json'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.cmp.optimizely.com/v3/tasks?offset=5&page_size=10", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.cmp.optimizely.com/v3/tasks?offset=5&page_size=10")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.cmp.optimizely.com/v3/tasks?offset=5&page_size=10"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// List of fetched tasks
{
"data": [
{
"id": "837f910551b00a722e0418830cee6612",
"title": "The awesome task",
"start_at": "2024-06-01T06:00:00Z",
"due_at": "2024-06-01T06:00:00Z",
"modified_at": "2024-06-01T06:00:00Z",
"reference_id": "TSK-1589",
"is_completed": false,
"is_archived": false,
"campaign_id": "8n7f910o51b00b722o0418n30cie8211",
"workflow_id": "8n7f910o51b00b722o0418n30cie8211",
"milestone_id": "8n7f910o51b00b722o0418n30cie8211",
"status": "Not Started",
"links": {
"self": "https://api.cmp.optimizely.com/v3/tasks/5d7f910551b00a722e0418830cee5534",
"campaign": "https://api.cmp.optimizely.com/v3/campaigns/2e7f9107351b00a722e0412230cee5534",
"workflow": "https://api.cmp.optimizely.com/v3/workflows/63f1c2b675be4132854d2741",
"milestone": "https://api.cmp.optimizely.com/v3/milestones/63f1c2b675be4132854d2741",
"web_urls": {
"self": "https://cmp.optimizely.com/cloud/taskv3/5c52cc153db27d0e5141146f"
}
}
}
],
"pagination": {}
}401
// Authorization error
{
"message": "Not found",
"errors": ""
}403
// Permission error
{
"message": "Not found",
"errors": ""
}