Skip to main content

Broadcasts

01. List broadcasts

Get a list of broadcasts, created by or shared with you. Items are return in reverse chronological order (newest first).

GET /int/v1/broadcast

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).

Query Parameters

NameTypeDescription
limitintoptional Maximum number of records to return. Default is 100. Maximium is 1000.Default value: 100
minLiveDateDateoptional Only return results with go-live later than specified date (ECMAScript Date Time String format).
maxLiveDateDateoptional Only return results with go-live earlier than specified date (ECMAScript Date Time String format).
previousLastIdStringoptional The last id value of previous return, use this to query more outside of limit
allStringoptional Return all platform broadcasts. Only works for Super Users. Mutually exclusive with onlyApi.
onlyApiStringoptional Only return broadcasts created by Public API. Mutually exclusive with all.

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-X GET https://<url>/int/v1/broadcast?limit=10

Javascript Example:

(async (url, token) => {

try{
const response = await(
const params = new URLSearchParams({
limit: 10
});
await fetch(
`${url}/int/v1/broadcast?${params}`,
{
method: "GET",
headers: {
"Authorization": `Bearer ${token}`
}
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN);

Parameters examples

json - Request Page:

{
"limit": 10
}

json - Request Next Page:

{
"limit": 10,
"previousLastId": "65dff01ac8072756ac1b7947"
}

json - Request All:

{
"all": "1",
"limit": 1000
}

json - Request Created by Public API:

{
"onlyApi": "1",
"limit": 100
}

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
dataArrayoptionalList of broadcast objects. Present when success is true.
messageStringoptionalError message. Present when success is false.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true,
"data":[
{
"_id":"65dff01ac8072756ac1b7947",
"status":"1",
"liveDate": "2024-07-14T23:50:18.554Z",
"sender":{
"_id":"60f4aeb09279e27183c0a9da",
"email":"john@communic8.com",
"firstName":"John",
"lastName":"Smith",
"displayName":"John Smith"
},
"sharedUsers":[
{
"_id":"60f4aeb09279e27183c0a9da",
"email":"john@communic8.com",
"firstName":"John",
"lastName":"Smith",
"displayName":"John Smith"
}
],
"adminIds":[
"60f4aeb09279e27183c0a9da"
],
"recipientAmount":1,
"broadcastUrl":"https://test.communic8.com/admin/web/#/broadcasts/all/view/65dff01ac8072756ac1b7947"
}
]
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"Illegal parameters"
}

02. Get a broadcast

Back to top

Get the details of an individual broadcast.

GET /int/v1/broadcast/:id

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).

Parameters - URL Parameters

NameTypeDescription
idStringBroadcast _id value.

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-X GET https://<url>/int/v1/broadcast/<id>

Javascript Example:

(async (url, token, id) => {

try{
const response = await(
await fetch(
`${url}/int/v1/broadcast/${id}`,
{
method: "GET",
headers: {
"Authorization": `Bearer ${token}`
}
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN, process.env.BROADCAST_ID);

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
dataObjectoptionalBroadcast object. Present when success is true.
messageStringoptionalError message. Present when success is false.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true,
"data":{
"_id":"65dff01ac8072756ac1b7947",
"status":"1",
"sender":{
"_id":"60f4aeb09279e27183c0a9da",
"email":"john@communic8.com",
"firstName":"John",
"lastName":"Smith",
"displayName":"John Smith"
},
"sharedUsers":[
{
"_id":"60f4aeb09279e27183c0a9da",
"email":"john@communic8.com",
"firstName":"John",
"lastName":"Smith",
"displayName":"John Smith"
}
],
"adminIds":[
"60f4aeb09279e27183c0a9da"
],
"recipientAmount":1,
"broadcastUrl":"https://test.communic8.com/admin/web/#/broadcasts/all/view/65dff01ac8072756ac1b7947"
}
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"Not Found."
}

03. Create (and send) a new broadcast

Back to top

Send a new broadcast message to one or more existing or new client recipients. Supply a list of email addresses or recipient group IDs to send to existing recipients. Supply a list of recipient objects to send to new recipients.

POST /int/v1/broadcast

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).

Request Body

NameTypeDescription
titleStringThe title of the broadcast.
messageStringThe message content of the broadcast.
statusStringoptional Broadcast status. By default the broadcast will be sent immediately (status "live"). If the value is "draft", the broadcast will not be sent immediately, but saved as draft.Default value: live
Allowed values: "live","draft"
scheduledTimeDateoptional scheduled go-live time for broadcast in ISO 8601 format (only used if status is not already 'live' or 'draft').
imageUrlStringoptional A public URL for an image to display on the broadcast.
emojiStringoptional The emoji used as an icon for the broadcast.Default value: 🔔
requiredConfirmBooleanoptional broadcast requires confirmation or not_Default value: false_
actionLinkStringoptional additonal link in broadcast
actionLinkTextStringoptional The text for the action link button which appears in the broadcast email, which users can click on to view more details.Default value: More Detail
contentInEmailBooleanoptional Will the broadcast content (message) appear in the email body?Default value: false
recipientEmailsString[]optional Array of recipient emails. Mutually exclusive with recipientGroups and recipients.
recipientGroupsString[]optional Array of recipient group IDs. Mutually exclusive with recipientEmails and recipients.
recipientsObject[]optional Array of recipient object. Mutually exclusive with recipientEmails and recipientGroups.
recipients.emailStringrecipient email
recipients.firstNameStringrecipient first name
recipients.lastNameStringrecipient last name

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-X POST https://<url>/int/v1/broadcast \
-d '{"title": "My new broadcast", "message": "Welcome to my broadcast", "recipientEmails": ["john@communic8.com"]}'

Javascript Example:

(async (url, token) => {

try{
const response = await(
await fetch(
`${url}/int/v1/broadcast`,
{
method: "POST",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify(
{
"title": "My new broadcast",
"message": "Welcome to my broadcast",
"recipientEmails": [
"john@communic8.com"
]
}
)
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN);

Parameters examples

json - Request Example:

{
"title": "New broadcast",
"message": "This is another new broadcast",
"imageUrl": "https://cf.communic8.com/dyzfiavco/image/upload/v1528258650/c8share/book.jpg",
"emoji": "📖",
"requiredConfirm": false,
"actionLink": "",
"actionLinkText": "More Detail",
"contentInEmail": false,
"recipientEmails": ["john@communic8.com"],
"recipientGroups": null,
"recipients": null
}

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
dataObjectoptionalSubset of data from newly created broadcast object (i.e. id value and URL). Present when success is true.
messageStringoptionalError message. Present when success is false.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true,
"data": {
"_id": "664163518ec4cb1c684b4b0c",
"broadcastUrl": "https://test.communic8.com/admin/web/#/broadcasts/all/view/664163518ec4cb1c684b4b0c"
}
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"Title is mandatory"
}

04. Update a broadcast

Back to top

Modify an existing broadcast.

PUT /int/v1/broadcast/:id

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).

Parameters - Parameter

NameTypeDescription
idStringBroadcast _id value.

Request Body

NameTypeDescription
statusStringBroadcast status is currently the only field that can be altered by this API. Modifying a scheduled broadcast to 'draft' status will cancel a scheduled send, returning the broadcast to a draft state.Allowed values: "draft"

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-X PUT https://<url>/int/v1/broadcast/<id> \
-d '{ "status": "draft" }'

Javascript Example:

(async (url, token, id) => {

try{
const response = await(
await fetch(
`${url}/int/v1/broadcast/${id}`,
{
method: "PUT",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
},
body: JSON.stringify({ "status": "draft" })
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN, process.env.BROADCAST_ID);

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
messageStringoptionalError message. Present when success is false.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true,
"data": {
"_id": "664163518ec4cb1c684b4b0c",
"status": "0",
"broadcastUrl": "https://test.communic8.com/admin/web/#/broadcasts/all/view/664163518ec4cb1c684b4b0c"
}
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"Invalid request parameters"
}

05. Delete a broadcast

Back to top

Delete a draft, scheduled or archived/closed broadcast.

DELETE /int/v1/broadcast/:id

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).

Parameters - URL Parameters

NameTypeDescription
idString(URL Query Parameter) Broadcast _id value.

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-X DELETE https://<url>/int/v1/broadcast/<id>

Javascript Example:

(async (url, token, id) => {

try{
const response = await(
await fetch(
`${url}/int/v1/broadcast/${id}`,
{
method: "DELETE",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
}
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN, process.env.BROADCAST_ID);

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
messageStringoptionalError message. Present when success is false.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"Broadcast not found"
}

06. Close a broadcast

Back to top

Close an existing broadcast so that is inaccessible to recipients.

PUT /int/v1/broadcast/:id/close

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).

Parameters - URL Parameters

NameTypeDescription
idString(URL Query Parameter) Broadcast _id value.

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-X PUT https://<url>/int/v1/broadcast/<id>/close

Javascript Example:

(async (url, token, id) => {

try{
const response = await(
await fetch(
`${url}/int/v1/broadcast/${id}/close`,
{
method: "PUT",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
}
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN, process.env.BROADCAST_ID);

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
messageStringoptionalError message. Present when success is false.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"Campaign already closed"
}

07. List broadcast files

Back to top

Get a list of files linked to a broadcast. Items are return in alphabetical order by name.

GET /int/v1/broadcast/:id/file

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).

Parameters - URL Parameters

NameTypeDescription
idStringBroadcast _id value.

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-X GET https://<url>/int/v1/broadcast/<id>/file

Javascript Example:

(async (url, token, id) => {

try{
const response = await(
await fetch(
`${url}/int/v1/broadcast/${id}/file`,
{
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
}
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN, process.env.BROADCAST_ID);

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
messageStringoptionalError message. Present when success is false.
dataArrayoptionalList of broadcast file objects. Present when success is true.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true,
"data": [
{
"_id": "664175738ec4cb1c684b5fb7",
"campaignId": "65dff01ac8072756ac1b7947",
"draftUsed": false,
"activeUsed": false,
"name": "Screenshot_2024-05-09_at_3.25.02 pm.png",
"type": "file",
"media": "image",
"ready": true,
"deleted": false,
"mime": "image/png",
"_type": "pb_c_campaign_file",
"size": 1121,
"width": 44,
"height": 42,
"format": "png",
"mDate": "2024-05-13T02:05:39.983Z",
"aDate": "2024-05-13T02:05:39.773Z",
"__v": 0,
"VersionId": "wxZ33s5PxQ9Z48eXsjEI4i6Vr.btVZ3M",
"lastVersionDate": "2024-05-13T02:05:39.972Z",
"storageId": "test/cmp/65dff01ac8072756ac1b7947/image/664175738ec4cb1c684b5fb7/Screenshot_2024-05-09_at_3.25.02 pm.png",
"url": "/file/664175738ec4cb1c684b5fb7/Screenshot_2024-05-09_at_3.25.02 pm.png"
}
]
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"campaign Id is required"
}

08. Read broadcast file details by file id

Back to top

Get the details of an individual broadcast file.

GET /int/v1/broadcast/:id/file/:fileId

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).

Parameters - URL Parameters

NameTypeDescription
idStringBroadcast _id value.
fileIdStringFile _id value.

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-X GET https://<url>/int/v1/broadcast/<id>/file/<fileId>

Javascript Example:

(async (url, token, id, fileId) => {

try{
const response = await(
await fetch(
`${url}/int/v1/broadcast/${id}/file/${fileId}`,
{
method: "GET",
headers: {
"Authorization": `Bearer ${token}`,
"Content-Type": "application/json"
}
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN, process.env.BROADCAST_ID, process.env.FILE_ID);

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
dataObjectoptionalThe broadcast file object. Present when success is true.
messageStringoptionalError message. Present when success is false.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true,
"data": {
"_id": "664175738ec4cb1c684b5fb7",
"campaignId": "65dff01ac8072756ac1b7947",
"draftUsed": false,
"activeUsed": false,
"name": "Screenshot_2024-05-09_at_3.25.02 pm.png",
"type": "file",
"media": "image",
"ready": true,
"deleted": false,
"mime": "image/png",
"_type": "pb_c_campaign_file",
"size": 1121,
"width": 44,
"height": 42,
"format": "png",
"mDate": "2024-05-13T02:05:39.983Z",
"aDate": "2024-05-13T02:05:39.773Z",
"__v": 0,
"VersionId": "wxZ33s5PxQ9Z48eXsjEI4i6Vr.btVZ3M",
"lastVersionDate": "2024-05-13T02:05:39.972Z",
"storageId": "test/cmp/65dff01ac8072756ac1b7947/image/664175738ec4cb1c684b5fb7/Screenshot_2024-05-09_at_3.25.02 pm.png",
"url": "/file/664175738ec4cb1c684b5fb7/Screenshot_2024-05-09_at_3.25.02 pm.png"
}
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"campaign Id is required"
}

09. Upload a new broadcast file

Back to top

Create a new file and link it to a broadcast.

POST /int/v1/broadcast/:id/file

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).
Content-TypeStringmultipart/form-data

Parameters - URL Parameters

NameTypeDescription
idStringBroadcast _id value.

Request Body

NameTypeDescription
fileFileNew file data.
mediaStringoptional Media type of new file_Default value: raw_
Allowed values: 'raw','image','video'

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-X POST https://<url>/int/v1/broadcast/<id>/file \
-F file=@image.png -F media=image

Javascript Example:

(async (url, token, id) => {
try{
const fs = require('fs/promises');
const fileName = "image.png";
const filePath = `./${fileName}`;
const body = new FormData();
const blob = new Blob([await fs.readFile(filePath)]);
body.set("media", "image");
body.set("file", blob, fileName);

const response = await(
await fetch(
`${url}/int/v1/broadcast/${id}/file`,
{
method: "POST",
headers: {
"Authorization": `Bearer ${token}`
},
body
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN, process.env.BROADCAST_ID);

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
dataObjectoptionalThe new file object. Present when success is true.
messageStringoptionalError message. Present when success is false.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true,
"data": {
"_id": "664175738ec4cb1c684b5fb7",
"campaignId": "65dff01ac8072756ac1b7947",
"draftUsed": false,
"activeUsed": false,
"name": "Screenshot_2024-05-09_at_3.25.02 pm.png",
"type": "file",
"media": "image",
"ready": true,
"deleted": false,
"mime": "image/png",
"_type": "pb_c_campaign_file",
"size": 1121,
"width": 44,
"height": 42,
"format": "png",
"mDate": "2024-05-13T02:05:39.983Z",
"aDate": "2024-05-13T02:05:39.773Z",
"__v": 0,
"VersionId": "wxZ33s5PxQ9Z48eXsjEI4i6Vr.btVZ3M",
"lastVersionDate": "2024-05-13T02:05:39.972Z",
"storageId": "test/cmp/65dff01ac8072756ac1b7947/image/664175738ec4cb1c684b5fb7/Screenshot_2024-05-09_at_3.25.02 pm.png",
"url": "/file/664175738ec4cb1c684b5fb7/Screenshot_2024-05-09_at_3.25.02 pm.png"
}
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"campaign Id is required"
}

10. Upload new version of existing broadcast file

Back to top

Upload and replace an existing broadcast file with a new version

POST /int/v1/broadcast/:id/file/:fileId

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).
Content-TypeString

Parameters - URL Parameters

NameTypeDescription
idStringBroadcast _id value.
fileIdStringFile _id value.

Request Body

NameTypeDescription
fileFileNew file data.
mediaStringoptional Media type of new file_Default value: raw_
Allowed values: 'raw','image','video'

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-X POST https://<url>/int/v1/campaign/<id>/file/<fileId> \
-F file=@image.png -F media=image

Javascript Example:

(async (url, token, id, fileId) => {
try{
const fs = require('fs/promises');
const fileName = "image.png";
const filePath = `./${fileName}`;
const body = new FormData();
const blob = new Blob([await fs.readFile(filePath)]);
body.set("media", "image");
body.set("file", blob, fileName);

const response = await(
await fetch(
`${url}/int/v1/broadcast/${id}/file/${fileId}`,
{
method: "POST",
headers: {
"Authorization": `Bearer ${token}`
},
body
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN, process.env.BROADCAST_ID, process.env.FILE_ID);

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
dataObjectoptionalThe updated file object. Present when success is true.
messageStringoptionalError message. Present when success is false.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true,
"data": {
"_id": "664175738ec4cb1c684b5fb7",
"campaignId": "65dff01ac8072756ac1b7947",
"draftUsed": false,
"activeUsed": false,
"name": "Screenshot_2024-05-09_at_3.25.02 pm.png",
"type": "file",
"media": "image",
"ready": true,
"deleted": false,
"mime": "image/png",
"_type": "pb_c_campaign_file",
"size": 1121,
"width": 44,
"height": 42,
"format": "png",
"mDate": "2024-05-13T02:05:39.983Z",
"aDate": "2024-05-13T02:05:39.773Z",
"__v": 0,
"VersionId": "wxZ33s5PxQ9Z48eXsjEI4i6Vr.btVZ3M",
"lastVersionDate": "2024-05-13T02:05:39.972Z",
"storageId": "test/cmp/65dff01ac8072756ac1b7947/image/664175738ec4cb1c684b5fb7/Screenshot_2024-05-09_at_3.25.02 pm.png",
"url": "/file/664175738ec4cb1c684b5fb7/Screenshot_2024-05-09_at_3.25.02 pm.png"
}
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"campaign Id is required"
}

11. Delete existing broadcast file

Back to top

Delete an existing broadcast file. If the file is in use, the operation will fail unless the deleteFileInUse query parameter is set to true.

DELETE /int/v1/broadcast/:id/file/:fileId

Headers - Header

NameTypeDescription
AuthorizationStringPrefix with "Bearer ". Token value (either Access Key from Admin Console or access_token via OAuth result).

Parameters - URL Parameters

NameTypeDescription
idStringBroadcast _id value.
fileIdStringFile _id value.

Parameters - URL Query Parameters

NameTypeDescription
deleteFileInUseStringoptional Delete the file even if it is in use.Default value: false

Examples

CURL Example:

curl -H "Authorization: Bearer <token>" \
-X DELETE https://<url>/int/v1/broadcast/<id>/file/<fileId>

Javascript Example:

(async (url, token, id, fileId) => {
try{
const response = await(
await fetch(
`${url}/int/v1/broadcast/${id}/file/${fileId}`,
{
method: "DELETE",
headers: {
"Authorization": `Bearer ${token}`
}
}
)
).json();
console.log("API response:", response);
}catch(error){
console.error("API error:", error);
}
})(process.env.URL, process.env.TOKEN, process.env.BROADCAST_ID, process.env.FILE_ID);

Success response

Success response - Success 200

NameTypeDescription
successBooleanIndicates whether the operation was successful.
messageStringoptionalError message. Present when success is false.

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success":true
}

Success response example - Error:

HTTP/1.1 200 OK
{
"success":false,
"message":"Please confirm delete for file used in campaign content."
}