Start Live Activities on user devices.
curl --request POST \
--url https://api.clix.so/api/v1/live-activities:start \
--header 'Content-Type: application/json' \
--header 'X-Clix-API-Key: <api-key>' \
--header 'X-Clix-Project-ID: <api-key>' \
--data '
{
"live_activities": [
{
"target": {
"project_user_id": "<string>"
},
"attributes_type": "<string>",
"attributes": {},
"content_state": {}
}
]
}
'import requests
url = "https://api.clix.so/api/v1/live-activities:start"
payload = { "live_activities": [
{
"target": { "project_user_id": "<string>" },
"attributes_type": "<string>",
"attributes": {},
"content_state": {}
}
] }
headers = {
"X-Clix-Project-ID": "<api-key>",
"X-Clix-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Clix-Project-ID': '<api-key>',
'X-Clix-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
live_activities: [
{
target: {project_user_id: '<string>'},
attributes_type: '<string>',
attributes: {},
content_state: {}
}
]
})
};
fetch('https://api.clix.so/api/v1/live-activities:start', 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.clix.so/api/v1/live-activities:start",
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([
'live_activities' => [
[
'target' => [
'project_user_id' => '<string>'
],
'attributes_type' => '<string>',
'attributes' => [
],
'content_state' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Clix-API-Key: <api-key>",
"X-Clix-Project-ID: <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://api.clix.so/api/v1/live-activities:start"
payload := strings.NewReader("{\n \"live_activities\": [\n {\n \"target\": {\n \"project_user_id\": \"<string>\"\n },\n \"attributes_type\": \"<string>\",\n \"attributes\": {},\n \"content_state\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Clix-Project-ID", "<api-key>")
req.Header.Add("X-Clix-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.post("https://api.clix.so/api/v1/live-activities:start")
.header("X-Clix-Project-ID", "<api-key>")
.header("X-Clix-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"live_activities\": [\n {\n \"target\": {\n \"project_user_id\": \"<string>\"\n },\n \"attributes_type\": \"<string>\",\n \"attributes\": {},\n \"content_state\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clix.so/api/v1/live-activities:start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Clix-Project-ID"] = '<api-key>'
request["X-Clix-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"live_activities\": [\n {\n \"target\": {\n \"project_user_id\": \"<string>\"\n },\n \"attributes_type\": \"<string>\",\n \"attributes\": {},\n \"content_state\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"delivery_results": [
{
"message_id": "<string>",
"status": "DELIVERY_RESULT_STATUS_SUCCEED",
"additional_params": {
"device_id": "<string>",
"fcm_message_id": "<string>",
"failure_reason": "<string>"
}
}
]
}Invalid live activity parametersLive Activities
Start Live Activities
This endpoint starts iOS Live Activities on one or more user devices using Push to Start.
POST
/
api
/
v1
/
live-activities:start
Start Live Activities on user devices.
curl --request POST \
--url https://api.clix.so/api/v1/live-activities:start \
--header 'Content-Type: application/json' \
--header 'X-Clix-API-Key: <api-key>' \
--header 'X-Clix-Project-ID: <api-key>' \
--data '
{
"live_activities": [
{
"target": {
"project_user_id": "<string>"
},
"attributes_type": "<string>",
"attributes": {},
"content_state": {}
}
]
}
'import requests
url = "https://api.clix.so/api/v1/live-activities:start"
payload = { "live_activities": [
{
"target": { "project_user_id": "<string>" },
"attributes_type": "<string>",
"attributes": {},
"content_state": {}
}
] }
headers = {
"X-Clix-Project-ID": "<api-key>",
"X-Clix-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Clix-Project-ID': '<api-key>',
'X-Clix-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
live_activities: [
{
target: {project_user_id: '<string>'},
attributes_type: '<string>',
attributes: {},
content_state: {}
}
]
})
};
fetch('https://api.clix.so/api/v1/live-activities:start', 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.clix.so/api/v1/live-activities:start",
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([
'live_activities' => [
[
'target' => [
'project_user_id' => '<string>'
],
'attributes_type' => '<string>',
'attributes' => [
],
'content_state' => [
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Clix-API-Key: <api-key>",
"X-Clix-Project-ID: <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://api.clix.so/api/v1/live-activities:start"
payload := strings.NewReader("{\n \"live_activities\": [\n {\n \"target\": {\n \"project_user_id\": \"<string>\"\n },\n \"attributes_type\": \"<string>\",\n \"attributes\": {},\n \"content_state\": {}\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Clix-Project-ID", "<api-key>")
req.Header.Add("X-Clix-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.post("https://api.clix.so/api/v1/live-activities:start")
.header("X-Clix-Project-ID", "<api-key>")
.header("X-Clix-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"live_activities\": [\n {\n \"target\": {\n \"project_user_id\": \"<string>\"\n },\n \"attributes_type\": \"<string>\",\n \"attributes\": {},\n \"content_state\": {}\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.clix.so/api/v1/live-activities:start")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Clix-Project-ID"] = '<api-key>'
request["X-Clix-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"live_activities\": [\n {\n \"target\": {\n \"project_user_id\": \"<string>\"\n },\n \"attributes_type\": \"<string>\",\n \"attributes\": {},\n \"content_state\": {}\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"delivery_results": [
{
"message_id": "<string>",
"status": "DELIVERY_RESULT_STATUS_SUCCEED",
"additional_params": {
"device_id": "<string>",
"fcm_message_id": "<string>",
"failure_reason": "<string>"
}
}
]
}Invalid live activity parametersError Responses
400 Bad Request
Returned when the request contains invalid live activity parameters. Returns a plain text error message:Invalid live activity parameters
401 Unauthorized
Authentication failed or invalid API key.Authorizations
Body
application/json
Request body containing the live activities to start.
Was this page helpful?