Updates a piece of copy in a content plan
Pass your API Key as a Bearer Token.
This endpoint has no request query parameters.
The request body for this endpoint is a JSON payload with the following keys:
Key | Description | Type | Example |
---|---|---|---|
line1 | Line 1 of copyrequired | String | "I'm changing the copy now" |
line2 | Line 2 of copy | String | "It's so easy!" |
Here's an example of the body parameters represented as a JSON object.
{
"line1": "I'm changing the copy now",
"line2": "It's so easy!"
}
Command Line (curl)
curl -X PUT "https://nichesss.com/api/content-plans/<CONTENT_PLAN_ID>/<CONTENT_ID>" -H "Content-type: application/json" -H "Authorization: Bearer <YOUR_API_KEY>" -d "{\"line1\":\"I'm changing the copy now\",\"line2\":\"It's so easy!\"}"
JavaScript
fetch('https://nichesss.com/api/content-plans/<CONTENT_PLAN_ID>/<CONTENT_ID>', {
method: 'PUT',
headers: {
'Content-type': 'application/json',
'Authorization': 'Bearer <YOUR_API_KEY>',
},
body: JSON.stringify({"line1":"I'm changing the copy now","line2":"It's so easy!"})
})
.then((response) => response.json())
.then((data) => console.log(data));
Python
import requests
url = 'https://nichesss.com/api/content-plans/<CONTENT_PLAN_ID>/<CONTENT_ID>'
payload = {"line1":"I'm changing the copy now","line2":"It's so easy!"}
headers = {'Content-type': 'application/json', 'Authorization': 'Bearer <YOUR_API_KEY>'}
response = requests.put(url, json=payload, headers=headers)
data = response.json()
print(data)
PHP
$api_key = '<YOUR_API_KEY>';
$request_url = 'https://nichesss.com/api/content-plans/<CONTENT_PLAN_ID>/<CONTENT_ID>';
$request_options = array(
'http' => array(
'method' => 'PUT',
'header' => 'Content-type: application/json' . "\r\n" .
'Authorization: Bearer ' . $api_key . "\r\n",
'content' => '{"line1":"I\'m changing the copy now","line2":"It\'s so easy!"}'
)
);
$request_context = stream_context_create($request_options);
$request_result = file_get_contents($request_url, false, $request_context);
$data = json_decode($request_result);
echo $data;
Ruby
require 'net/http'
require 'json'
uri = URI('https://nichesss.com/api/content-plans/<CONTENT_PLAN_ID>/<CONTENT_ID>')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Put.new(uri.request_uri)
request['Content-type'] = 'application/json'
request['Authorization'] = 'Bearer <YOUR_API_KEY>'
request.body = {"line1":"I'm changing the copy now","line2":"It's so easy!"}.to_json
response = http.request(request)
puts JSON.parse(response.body)
All responses from the API are JSON. You won't get the copy back immediately. We recommended you use webhooks to get your copy back, or follow the queue uri and wait.
{
"success": true,
"message": "Successfully updated your content.",
"content_plan_id": "DfXVp4dXz",
"content_id": "2165"
}