Publish a blog post
curl --request POST \
--url https://{notifuseDomain}/api/blogPosts.publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "1b4e28ba-2fa1-11d2-883f-0016d3cca427",
"published_at": "2024-03-12T08:00:00Z"
}
'import requests
url = "https://{notifuseDomain}/api/blogPosts.publish"
payload = {
"id": "1b4e28ba-2fa1-11d2-883f-0016d3cca427",
"published_at": "2024-03-12T08:00:00Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '1b4e28ba-2fa1-11d2-883f-0016d3cca427',
published_at: '2024-03-12T08:00:00Z'
})
};
fetch('https://{notifuseDomain}/api/blogPosts.publish', 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://{notifuseDomain}/api/blogPosts.publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '1b4e28ba-2fa1-11d2-883f-0016d3cca427',
'published_at' => '2024-03-12T08:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{notifuseDomain}/api/blogPosts.publish"
payload := strings.NewReader("{\n \"id\": \"1b4e28ba-2fa1-11d2-883f-0016d3cca427\",\n \"published_at\": \"2024-03-12T08:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://{notifuseDomain}/api/blogPosts.publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"1b4e28ba-2fa1-11d2-883f-0016d3cca427\",\n \"published_at\": \"2024-03-12T08:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/blogPosts.publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"1b4e28ba-2fa1-11d2-883f-0016d3cca427\",\n \"published_at\": \"2024-03-12T08:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "failed to publish post: blog post not found or already published"
}{
"error": "<string>"
}{
"error": "Insufficient permissions: write access to blog required",
"resource": "blog",
"permission": "write"
}Blog
Publish a blog post
Publishes a draft: it appears on the blog’s home and category pages, at its own URL, and in the RSS and JSON feeds. Publishing a post that is already published is refused; unpublish it first to change its date. Requires the blog write permission.
POST
/
api
/
blogPosts.publish
Publish a blog post
curl --request POST \
--url https://{notifuseDomain}/api/blogPosts.publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "1b4e28ba-2fa1-11d2-883f-0016d3cca427",
"published_at": "2024-03-12T08:00:00Z"
}
'import requests
url = "https://{notifuseDomain}/api/blogPosts.publish"
payload = {
"id": "1b4e28ba-2fa1-11d2-883f-0016d3cca427",
"published_at": "2024-03-12T08:00:00Z"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
id: '1b4e28ba-2fa1-11d2-883f-0016d3cca427',
published_at: '2024-03-12T08:00:00Z'
})
};
fetch('https://{notifuseDomain}/api/blogPosts.publish', 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://{notifuseDomain}/api/blogPosts.publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '1b4e28ba-2fa1-11d2-883f-0016d3cca427',
'published_at' => '2024-03-12T08:00:00Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://{notifuseDomain}/api/blogPosts.publish"
payload := strings.NewReader("{\n \"id\": \"1b4e28ba-2fa1-11d2-883f-0016d3cca427\",\n \"published_at\": \"2024-03-12T08:00:00Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.post("https://{notifuseDomain}/api/blogPosts.publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"1b4e28ba-2fa1-11d2-883f-0016d3cca427\",\n \"published_at\": \"2024-03-12T08:00:00Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{notifuseDomain}/api/blogPosts.publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"1b4e28ba-2fa1-11d2-883f-0016d3cca427\",\n \"published_at\": \"2024-03-12T08:00:00Z\"\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"error": "failed to publish post: blog post not found or already published"
}{
"error": "<string>"
}{
"error": "Insufficient permissions: write access to blog required",
"resource": "blog",
"permission": "write"
}Authorizations
API token for authentication
Query Parameters
The ID of the workspace. Passed in the query string, not the body.
Body
application/json
Example:
"1b4e28ba-2fa1-11d2-883f-0016d3cca427"
The publication date to record, defaulting to now. Use it to backdate posts you import. A future date does not schedule the post: it goes live on the blog immediately, and only its appearance in the RSS and JSON feeds waits for the date.
Example:
"2024-03-12T08:00:00Z"
Response
Post published
Example:
true
