Publish Template
curl --request PATCH \
--url 'https://api.trysiren.io/api/v1/public/template/{{template_id}}/publish' \
--header 'Authorization: <authorization>'import requests
url = "https://api.trysiren.io/api/v1/public/template/{{template_id}}/publish"
headers = {"Authorization": "<authorization>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: '<authorization>'}};
fetch('https://api.trysiren.io/api/v1/public/template/{{template_id}}/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.trysiren.io/api/v1/public/template/{{template_id}}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trysiren.io/api/v1/public/template/{{template_id}}/publish"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.trysiren.io/api/v1/public/template/{{template_id}}/publish")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trysiren.io/api/v1/public/template/{{template_id}}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"description": "string",
"variables": [
{
"name": "string",
"defaultValue": "string"
}
],
"tags": [
"string"
],
"draftVersion": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"version": 0,
"status": "PUBLISHED_LATEST",
"publishedAt": "2024-08-30T07:39:49.292Z"
},
"publishedVersion": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"version": 0,
"status": "PUBLISHED_LATEST",
"publishedAt": "2024-08-30T07:39:49.292Z"
},
"templateVersions": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"version": 0,
"status": "PUBLISHED_LATEST",
"publishedAt": "2024-08-30T07:39:49.292Z"
}
]
},
"error": null,
"errors": null,
"meta": null
}
{
"data": null,
"error": {
"errorCode": "BAD_REQUEST",
"message": "Bad request"
},
"errors": [
{
"errorCode": "BAD_REQUEST",
"message": "Bad request"
}
],
"meta": null
}
Template APIs
Publish Template
Publish draft version of a template
PATCH
/
api
/
v1
/
public
/
template
/
{template_id}
/
publish
Publish Template
curl --request PATCH \
--url 'https://api.trysiren.io/api/v1/public/template/{{template_id}}/publish' \
--header 'Authorization: <authorization>'import requests
url = "https://api.trysiren.io/api/v1/public/template/{{template_id}}/publish"
headers = {"Authorization": "<authorization>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: '<authorization>'}};
fetch('https://api.trysiren.io/api/v1/public/template/{{template_id}}/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.trysiren.io/api/v1/public/template/{{template_id}}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.trysiren.io/api/v1/public/template/{{template_id}}/publish"
req, _ := http.NewRequest("PATCH", url, nil)
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.trysiren.io/api/v1/public/template/{{template_id}}/publish")
.header("Authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.trysiren.io/api/v1/public/template/{{template_id}}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"description": "string",
"variables": [
{
"name": "string",
"defaultValue": "string"
}
],
"tags": [
"string"
],
"draftVersion": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"version": 0,
"status": "PUBLISHED_LATEST",
"publishedAt": "2024-08-30T07:39:49.292Z"
},
"publishedVersion": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"version": 0,
"status": "PUBLISHED_LATEST",
"publishedAt": "2024-08-30T07:39:49.292Z"
},
"templateVersions": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"version": 0,
"status": "PUBLISHED_LATEST",
"publishedAt": "2024-08-30T07:39:49.292Z"
}
]
},
"error": null,
"errors": null,
"meta": null
}
{
"data": null,
"error": {
"errorCode": "BAD_REQUEST",
"message": "Bad request"
},
"errors": [
{
"errorCode": "BAD_REQUEST",
"message": "Bad request"
}
],
"meta": null
}
Header
string
required
Bearer token for API authentication. Format:
Bearer {{apiToken}}Query Parameters
UUID
required
The ID of the template to publish.
Response
object
UUID
Template ID.
string
Template name.
string
Template description.
array
List of template tags.
object
object
{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "string",
"description": "string",
"variables": [
{
"name": "string",
"defaultValue": "string"
}
],
"tags": [
"string"
],
"draftVersion": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"version": 0,
"status": "PUBLISHED_LATEST",
"publishedAt": "2024-08-30T07:39:49.292Z"
},
"publishedVersion": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"version": 0,
"status": "PUBLISHED_LATEST",
"publishedAt": "2024-08-30T07:39:49.292Z"
},
"templateVersions": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"version": 0,
"status": "PUBLISHED_LATEST",
"publishedAt": "2024-08-30T07:39:49.292Z"
}
]
},
"error": null,
"errors": null,
"meta": null
}
{
"data": null,
"error": {
"errorCode": "BAD_REQUEST",
"message": "Bad request"
},
"errors": [
{
"errorCode": "BAD_REQUEST",
"message": "Bad request"
}
],
"meta": null
}
Status Codes
200- OK400- BAD REQUEST401- UNAUTHORISED404- NOT FOUND
Was this page helpful?
⌘I