GET /tasks/{task_id}/articles/{article_id}
1 min
GET
https://api.cmp.optimizely.com/v3/tasks/{task_id}/articles/{article_id}
Path Parameters
- task_idstringrequiredExampleDescription
- article_idstringrequiredExampleDescription
Responses
200
- TaskArticle
- idstringrequiredExampleDescription
- titlestringrequiredExampleDescription
- created_atstring<date-time>requiredExampleDescriptionFormatdate-time
- modified_atstring<date-time>requiredExampleDescriptionFormatdate-time
- html_bodystringrequiredExampleDescription
- urlstringrequiredExampleDescription
- labelsResourceLabelResponse[]requiredDescription
- groupobjectrequiredDescription
- idstringrequiredExampleDescription
- namestringrequiredExampleDescription
- valuesobject[]requiredDescription
- idstringrequiredExampleDescription
- namestringrequiredExampleDescription
- library_asset_idstringExampleDescription
- linksobjectrequiredDescription
- selfstringrequiredExampleDescription
- taskstringrequiredExampleDescription
- draftsstringrequiredDescription
- web_urlsobjectrequiredDescription
- selfstringrequiredExampleDescription
- taskstringrequiredExampleDescription
- draftsstringrequiredDescription
400
- ErrorExample
{ "message": "Unsupported arguments: a,b,c" }Description- messagestringrequiredExampleDescription
- errorsmap<string, string>Description
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
404
- ErrorExample
{ "message": "Resource not found" }Description- messagestringrequiredExampleDescription
- errorsmap<string, string>Description
curl
curl --request GET \
--url https://api.cmp.optimizely.com/v3/tasks/{task_id}/articles/{article_id} \
--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/{task_id}/articles/{article_id}", 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/{task_id}/articles/{article_id}")
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/{task_id}/articles/{article_id}"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Fetched article
{
"id": "5d7f910551b00a722e0418830cee6631",
"title": "3 Ways Influencer Marketing Will Further Mature in 2020",
"created_at": "2019-10-06T13:15:30Z",
"modified_at": "2019-10-07T13:15:30Z",
"html_body": "<p>Article text</p>",
"url": "https://cmp.optimizely.com/new-article-published.html",
"labels": [
{
"group": {
"id": "2467e583a60e23fda2b89db81a453cd2",
"name": "Content Format"
},
"values": [
{
"id": "71c378f3fee3d822759d1bdc2aab628c",
"name": "Photos"
}
]
}
],
"library_asset_id": "6a8b2c3d4e5f6071829a3b4c",
"links": {
"self": "https://api.cmp.optimizely.com/v3/tasks/5f857f30e1c4a2038d6179e9/articles/5d7f910551b00a722e0418830cee6631",
"task": "https://api.cmp.optimizely.com/v3/tasks/5f857f30e1c4a2038d6179e9",
"drafts": "",
"web_urls": {
"self": "https://cmp.optimizely.com/cloud/taskv3/5f857f30e1c4a2038d6179e9?contentTabGuid=5d7f910551b00a722e0418830cee6631",
"task": "https://cmp.optimizely.com/cloud/taskv3/5f857f30e1c4a2038d6179e9",
"drafts": ""
}
}
}400
// Client error
{
"message": "Not found",
"errors": ""
}401
// Authorization error
{
"message": "Not found",
"errors": ""
}403
// Permission error
{
"message": "Not found",
"errors": ""
}404
// Not found error
{
"message": "Not found",
"errors": ""
}