Update an article's content
curl --request PUT \
--url https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"content": "<string>",
"expected_updated_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}"
payload = {
"content": "<string>",
"expected_updated_at": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '<string>', expected_updated_at: '2023-11-07T05:31:56Z'})
};
fetch('https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'expected_updated_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"expected_updated_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"expected_updated_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"expected_updated_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content_brief_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"state": "new",
"progress_pct": 123,
"content": "<string>",
"rewrite_source": {
"url": "<string>",
"title": "<string>",
"body_text": "<string>"
},
"word_count": 123,
"ai_model": "<string>",
"generation_duration_ms": 123,
"generation_error": "<string>",
"generated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}ContentStudio
Update an article's content
PUT
/
api
/
v2
/
brands
/
{brand_id}
/
content_studio
/
articles
/
{id}
Update an article's content
curl --request PUT \
--url https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id} \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"content": "<string>",
"expected_updated_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}"
payload = {
"content": "<string>",
"expected_updated_at": "2023-11-07T05:31:56Z"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '<string>', expected_updated_at: '2023-11-07T05:31:56Z'})
};
fetch('https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'expected_updated_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}"
payload := strings.NewReader("{\n \"content\": \"<string>\",\n \"expected_updated_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"expected_updated_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.cognizo.ai/api/v2/brands/{brand_id}/content_studio/articles/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"expected_updated_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content_brief_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"metadata": {},
"state": "new",
"progress_pct": 123,
"content": "<string>",
"rewrite_source": {
"url": "<string>",
"title": "<string>",
"body_text": "<string>"
},
"word_count": 123,
"ai_model": "<string>",
"generation_duration_ms": 123,
"generation_error": "<string>",
"generated_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}Authorizations
Body
application/json
Response
saved
Show child attributes
Show child attributes

