curl --request POST \
--url https://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"change_note": "Shorter push title"
}
'import requests
url = "https://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/publish"
payload = { "change_note": "Shorter push title" }
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({change_note: 'Shorter push title'})
};
fetch('https://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/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://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/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([
'change_note' => 'Shorter push title'
]),
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://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/publish"
payload := strings.NewReader("{\n \"change_note\": \"Shorter push title\"\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://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"change_note\": \"Shorter push title\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/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 \"change_note\": \"Shorter push title\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"status": "archived",
"base": {},
"metadata": {},
"translations": {
"es": {},
"en": {},
"pt": {},
"fr": {},
"it": {}
},
"languages": [
"es"
],
"change_note": "<string>",
"copied_from": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"published_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"published_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"message": "<string>",
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "UNPROCESSABLE_ENTITY",
"errors": [
{
"code": "unknown-variable",
"field": "title",
"language": "en",
"message": "Unknown variable onboarding.link",
"position": 12
}
],
"message": "Unprocessable Entity"
}
}Publish Template Version
Requires notification-template:publish, or
notification-template:publish-marketing for a marketing-category
template (any other category answers
403 template-category-not-allowed). Publishes the draft with a
change_note, archives the previous version (in one transaction) and
records who and when. Answers the published version.
422 lists every problem: change-note-required, es-required
(the es translation is mandatory), unknown-variable (a variable
not in the event payload schema or the implicit set, with field,
language and position), a contract issue of the base or a
translation, or invalid-content when a translation does not render
within the channel contract with the sample and the longest sample
payload. 409 version-not-draft when the version is not a draft.
curl --request POST \
--url https://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"change_note": "Shorter push title"
}
'import requests
url = "https://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/publish"
payload = { "change_note": "Shorter push title" }
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({change_note: 'Shorter push title'})
};
fetch('https://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/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://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/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([
'change_note' => 'Shorter push title'
]),
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://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/publish"
payload := strings.NewReader("{\n \"change_note\": \"Shorter push title\"\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://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/publish")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"change_note\": \"Shorter push title\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.bbrands.io/api/v3/notification/template/{document_id}/version/{version}/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 \"change_note\": \"Shorter push title\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": 123,
"status": "archived",
"base": {},
"metadata": {},
"translations": {
"es": {},
"en": {},
"pt": {},
"fr": {},
"it": {}
},
"languages": [
"es"
],
"change_note": "<string>",
"copied_from": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"published_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"published_at": "2023-11-07T05:31:56Z",
"archived_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"message": "<string>",
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "<string>",
"errors": [
"<unknown>"
],
"message": "<string>"
},
"meta": {
"correlation": "<string>",
"status": 123,
"timestamp": "2023-11-07T05:31:56Z",
"version": "<string>"
}
}{
"error": {
"code": "UNPROCESSABLE_ENTITY",
"errors": [
{
"code": "unknown-variable",
"field": "title",
"language": "en",
"message": "Unknown variable onboarding.link",
"position": 12
}
],
"message": "Unprocessable Entity"
}
}Authorizations
Path Parameters
Body
Was this page helpful?