Skip to main content

Channels

01. List channels

Get a list of channels accessible to the token user. Items are return in reverse chronological order (newest first).

GET /int/v1/channel

Headers - Header

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

Examples

CURL Example:

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

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const options = {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`
}
};
const response = await fetch(`https://${url}/int/v1/channel`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

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": "65ae09d15b7abfedfcf32162",
"aDate": "2024-01-22T06:23:13.535Z",
"mDate": "2024-02-16T05:49:56.874Z",
"status": "1",
"name": "My channel",
"description": "My channel",
"title": "My channel",
"paused": false,
"sharedUsers": [
{
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"email": "john@communic8.com"
}
],
"sharedGroups": [],
"defaults": {
"enableEmail": true,
"enablePushNotification": true
},
"ownerId": {
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"firstName": "John",
"lastName": "Smith",
"email": "john@communic8.com"
}
}
],
"total": 1
}

Success response example - Error:

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

02. Get a channel

Back to top

Get the details of an individual channel.

GET /int/v1/channel/:id

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Examples

CURL Example:

curl --request GET \
--url https://<url>/int/v1/channel/<id> \
--header 'Authorization: Bearer <token>'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID
const options = {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`
}
};
const response = await fetch(`https://${url}/int/v1/channel/${id}`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success": true,
"data": {
"_id": "661cab3b1dfc1d70512685cc",
"aDate": "2024-04-15T04:21:15.120Z",
"mDate": "2024-06-21T02:03:33.595Z",
"status": "3",
"name": "My channel",
"description": "My channel",
"title": "My channel",
"paused": false,
"pinned": false,
"sharedUsers": [
{
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"email": "john@communic8.com"
}
],
"sharedGroups": [],
"defaults": {
"enableEmail": true,
"enablePushNotification": false,
"enableComments": false,
"commentVisibility": "1"
},
"ownerId": {
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"firstName": "John",
"lastName": "Smith",
"email": "john@communic8.com"
}
}
}

Success response example - Error:

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

03. Create a channel

Back to top

Create a new channel.

POST /int/v1/channel

Headers - Header

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

Request Body

NameTypeDescription
nameStringoptional channel name
titleStringoptional channel title
descriptionStringoptional channel description
defaultsObjectoptional default settings for campaigns and broadcasts created in this channel
defaults.templateStringoptional The default template record ID for campaigns created in this channel
defaults.enableEmailBooleanoptional New campaigns and broadcasts created in this channel will default to email sending enabled_Default value: true_
defaults.enableSmsBooleanoptional New campaigns and broadcasts created in this channel will default to SMS sending enabled_Default value: true_
defaults.enableAppNotificationBooleanoptional New campaigns and broadcasts created in this channel will default to mobile app notifications enabled_Default value: true_
defaults.enableCommentBooleanoptional New campaigns and broadcasts created in this channel will default to comments enabled_Default value: false_
defaults.commentVisibilityStringoptional New campaigns and broadcasts created in this channel will default to comments visible to all users (when comments enabled).
"0" for comments only visible to campaign team, "1" for comments also visible to other recipeints in the campaign_Default value: 1_
Allowed values: "0","1"

Examples

CURL Example:

curl --request POST \
--url https://<url>/int/v1/channel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "My channel name",
"title": "My channel title",
"description": "My channel description",
"defaults": {
"template": "62a7b72187ce0b222948d465",
"enableEmail": true,
"enablePushNotification": true,
"enableComments": true,
"commentVisibility": "1"
}
}'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "My channel name",
"title": "My channel title",
"description": "My channel description",
"defaults": {
"template": "62a7b72187ce0b222948d465",
"enableEmail": true,
"enablePushNotification": true,
"enableComments": true,
"commentVisibility": "1"
}
})
};
const response = await fetch(`https://${url}/int/v1/channel/661cab3b1dfc1d70512685cc`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success": true,
"data": {
"_id": "667a5eb0913081c045d6fcd8",
"aDate": "2024-06-25T05:46:57.402Z",
"mDate": "2024-06-25T05:46:57.402Z",
"status": "1",
"sharedUsers": [
{
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"email": "john@communic8.com"
}
],
"adminIds": [
"615e4b9c2afe5dface7d619b"
],
"name": "My channel name",
"description": "My channel description",
"title": "My channel name",
"paused": false,
"pinned": false,
"sharedGroups": [],
"defaults": {
"template": "62a7b72187ce0b222948d465",
"enableEmail": true,
"enablePushNotification": true,
"enableComments": true,
"commentVisibility": "1"
},
"ownerId": {
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"firstName": "John",
"lastName": "Smith",
"email": "john@communic8.com"
}
}
}

Success response example - Error:

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

04. Restore an archived channel

Back to top

Restore an archived channel.

POST /int/v1/channel/:id/restore

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Examples

CURL Example:

curl --request POST \
--url https://<url>/int/v1/channel/<id>/restore \
--header 'Authorization: Bearer <token>'
}'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`
}
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/restore`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success": true,
"data": {
"_id": "667a5eb0913081c045d6fcd8",
"aDate": "2024-06-25T05:46:57.402Z",
"mDate": "2024-06-25T05:46:57.402Z",
"status": "1",
"sharedUsers": [
{
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"email": "john@communic8.com"
}
],
"adminIds": [
"615e4b9c2afe5dface7d619b"
],
"name": "My channel name",
"description": "My channel description",
"title": "My channel name",
"paused": true,
"pinned": false,
"sharedGroups": [],
"defaults": {
"template": "62a7b72187ce0b222948d465",
"enableEmail": true,
"enablePushNotification": true,
"enableComments": true,
"commentVisibility": "1"
},
"ownerId": {
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"firstName": "John",
"lastName": "Smith",
"email": "john@communic8.com"
}
}
}

Success response example - Error:

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

05. Update a channel

Back to top

Update an existing channel.

PUT /int/v1/channel/:id

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Request Body

NameTypeDescription
nameStringoptional channel name
titleStringoptional channel title
descriptionStringoptional channel description
defaultsObjectoptional default settings for campaigns and broadcasts created in this channel
defaults.templateStringoptional The default template record ID for campaigns created in this channel
defaults.enableEmailBooleanoptional New campaigns and broadcasts created in this channel will default to email sending enabled_Default value: true_
defaults.enableSmsBooleanoptional New campaigns and broadcasts created in this channel will default to SMS sending enabled_Default value: true_
defaults.enableAppNotificationBooleanoptional New campaigns and broadcasts created in this channel will default to mobile app notifications enabled_Default value: true_
defaults.enableCommentBooleanoptional New campaigns and broadcasts created in this channel will default to comments enabled_Default value: false_
defaults.commentVisibilityStringoptional New campaigns and broadcasts created in this channel will default to comments visible to all users (when comments enabled).
"0" for comments only visible to campaign team, "1" for comments also visible to other recipeints in the campaign_Default value: 1_
Allowed values: "0","1"

Examples

CURL Example:

curl --request PUT \
--url https://<url>/int/v1/channel<id> \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "My updated channel name",
"defaults": {
"enableEmail": false
}
}'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const options = {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "My updated channel name",
"defaults": {
"enableEmail": false
}
})
};
const response = await fetch(`https://${url}/int/v1/channel/${id}`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success": true,
"data": {
"_id": "667a5eb0913081c045d6fcd8",
"aDate": "2024-06-25T06:07:45.673Z",
"mDate": "2024-06-25T06:24:13.418Z",
"status": "1",
"sharedUsers": [
{
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"email": "john@communic8.com"
}
],
"adminIds": [
"615e4b9c2afe5dface7d619b"
],
"name": "My updated channel name",
"description": "My channel description",
"title": "My channel name",
"paused": false,
"pinned": false,
"sharedGroups": [],
"defaults": {
"template": "62a7b72187ce0b222948d465",
"enableEmail": false,
"enablePushNotification": true,
"enableComments": true,
"commentVisibility": "1"
},
"ownerId": {
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"firstName": "John",
"lastName": "Smith",
"email": "john@communic8.com"
}
}
}

Success response example - Error:

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

06. Archive a channel

Back to top

Archive a channel.

POST /int/v1/channel/:id/archive

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Examples

CURL Example:

curl --request POST \
--url https://<url>/int/v1/channel/<id>/archive \
--header 'Authorization: Bearer <token>'
}'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`
}
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/archive`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success": true,
"data": {
"_id": "667a5eb0913081c045d6fcd8",
"aDate": "2024-06-25T05:46:57.402Z",
"mDate": "2024-06-25T05:46:57.402Z",
"status": "3",
"sharedUsers": [
{
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"email": "john@communic8.com"
}
],
"adminIds": [
"615e4b9c2afe5dface7d619b"
],
"name": "My channel name",
"description": "My channel description",
"title": "My channel name",
"paused": true,
"pinned": false,
"sharedGroups": [],
"defaults": {
"template": "62a7b72187ce0b222948d465",
"enableEmail": true,
"enablePushNotification": true,
"enableComments": true,
"commentVisibility": "1"
},
"ownerId": {
"_id": "615e4b9c2afe5dface7d619b",
"displayName": "John Smith",
"firstName": "John",
"lastName": "Smith",
"email": "john@communic8.com"
}
}
}

Success response example - Error:

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

07. List channel managers

Back to top

List channel managers.

GET /int/v1/channel/:id/manager

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Query Parameters

NameTypeDescription
conditionsObjectoptional User filter conditions
limitNumberoptional Limit results
skipNumberoptional Skip results

Examples

CURL Example:

curl --request GET \
--url https://<url>/int/v1/channel/<id>/manager \
--header 'Authorization: Bearer <token>'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID
const options = {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`
}
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/manager`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success": true,
"data": [
{
"_id": "615e4b9c2afe5dface7d619b",
"active": true,
"activeConsole": true,
"displayName": "John Smith",
"email": "john@communic8.com"
"lastName": "Smith",
"permissions": [
"channel_admin"
]
},
{
"_id": "63b35a2336c6bafd6d922204",
"active": false,
"activeConsole": true,
"displayName": "Mary Jones",
"email": "mary@communic8.com"
"lastName": "Jones",
"permissions": [
"channel_recipient_add",
"channel_recipient_edit"
]
}
],
"total": 2
}

Success response example - Error:

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

08. Update channel manager permissions

Back to top

Update channel manager permissions.

PUT /int/v1/channel/:id/manager

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Request Body

NameTypeDescription
userStringmanager user account reference (record ID, email, Successfactors Id or username)
permissionsString[]permission list

Examples

CURL Example:

curl --request PUT \
--url https://<url>/int/v1/channel/<id>/manager \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"user": "mary@communic8.com",
"permissions": [
"channel_recipient_add",
"channel_recipient_edit"
]
}'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const options = {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"user": "mary@communic8.com",
"permissions": [
"channel_recipient_add",
"channel_recipient_edit"
]
})
}
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/manager`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

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": "Invalid parameters"
}

09. Remove channel manager

Back to top

Remove channel manager.

DELETE /int/v1/channel/:id/manager

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Request Body

NameTypeDescription
userStringmanager user account reference (record ID, email, Successfactors Id or username)

Examples

CURL Example:

curl --request DELETE \
--url https://<url>/int/v1/channel/<id>/manager \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "user": "mary@communic8.com" }'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const options = {
method: 'DELETE',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ "user": "mary@communic8.com" })
}
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/manager`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

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": "Invalid parameters"
}

Success response example - Error:

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

10. Get channel manager groups

Back to top

Get channel manager groups

GET /int/v1/channel/:id/managerGroup

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Query Parameters

NameTypeDescription
conditionsObjectoptional Group filter conditions
limitNumberoptional Limit results
skipNumberoptional Skip results

Examples

CURL Example:

curl --request GET \
--url https://<url>/int/v1/channel/<id>/managerGroup \
--header 'Authorization: Bearer <token>'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID
const options = {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`
}
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/managerGroup`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success": true,
"data": [
{
"_id": "667a68171d4c9afba78150bf",
"name": "Team leaders",
"desc": "Team leaders and area managers",
"deleted": false,
"default": false,
"roles": [
"57f8a806a52505ae26730941"
],
"mDate": "2024-06-25T06:47:51.886Z",
"aDate": "2024-06-25T06:47:51.886Z",
"permissions": []
}
],
"total": 1
}

Success response example - Error:

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

11. Update channel manager groups

Back to top

Update channel manager groups

PUT /int/v1/channel/:id/managerGroup

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Request Body

NameTypeDescription
groupIdStringconsole user group record ID
permissionsString[]permission list

Examples

CURL Example:

curl --request PUT \
--url https://<url>/int/v1/channel/<id>/managerGroup \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"groupId": <groupId>,
"permissions": [
"channel_recipient_add",
"channel_recipient_edit"
]
}'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const groupId = process.env.GROUP_ID
const options = {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"groupId": `${groupId}`,
"permissions": [
"channel_recipient_add",
"channel_recipient_edit"
]
})
}
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/manager`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

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": "Invalid parameters"
}

12. Remove manager group from channel

Back to top

Remove manager group from channel

DELETE /int/v1/channel/:id/managerGroup/:groupId

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID
groupIdStringManager group record ID

Examples

CURL Example:

curl --request DELETE \
--url https://<url>/int/v1/channel/<id>/managerGroup/<groupId> \
--header 'Authorization: Bearer <token>'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const groupId = process.env.GROUP_ID
const options = {
method: 'DELETE',
headers: {
Authorization: `Bearer ${token}`
}
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/manager/${groupId}`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

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": "Invalid parameters"
}

13. List channel recipients

Back to top

List channel recipients.

GET /int/v1/channel/:id/recipient

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Query Parameters

NameTypeDescription
conditionsObjectoptional Recipient filter conditions
limitNumberoptional Limit results
skipNumberoptional Skip results

Examples

CURL Example:

curl --request GET \
--url https://<url>/int/v1/channel/<id>/recipient?conditions=<conditions> \
--header 'Authorization: Bearer <token>'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const conditions = process.env.RECIPIENT_CONDITIONS;
const options = {
method: 'GET',
headers: {
Authorization: `Bearer ${token}`
}
};
const queryString = (conditions) ? `?conditions=${encodeURIComponent(conditions)}` : "";
const response = await fetch(`https://${url}/int/v1/channel/${id}/recipient${queryString}`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success": true,
"data": [
{
"_id": "615e4b9c2afe5dface7d619b",
"active": true,
"activeConsole": true,
"displayName": "John Smith",
"email": "john@communic8.com"
"lastName": "Smith",
"oppo": {
"_id": "66723d2c2a9bc16fb41fe272",
"pitchStatus": "live",
"ceUserId": "615e4b9c2afe5dface7d619b",
"_type": "pb_c_campaign_item"
},
"pitchStatus": "live"
},
{
"_id": "615e4b9c2afe5dface7d619b",
"active": true,
"activeConsole": true,
"displayName": "Matthew Smith",
"email": "matthew@communic8.com"
"lastName": "Smith",
"oppo": {
"_id": "66723d2c2a9bc16fb41fe272",
"pitchStatus": "live",
"ceUserId": "615e4b9c2afe5dface7d619b",
"_type": "pb_c_campaign_item"
},
"pitchStatus": "live"
}
],
"total": 2
}

Success response example - Error:

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

14. Add recipients to a channel

Back to top

Add recipients to a channel.

POST /int/v1/channel/:id/recipient

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Request Body

NameTypeDescription
recipientsString[]optional Recipients to add to the channel (supported recipient references: email, user record ID, Successfactors ID or Successfactors username)
listsString[]optional recipient group record IDs to add the group's users to the channel
conditionsString[]optional recipient filter conditions to add matching active users to the channel

Examples

CURL Example:

curl --request POST \
--url https://<url>/int/v1/channel/<id>/recipient \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"recipients": ["john@communic8.com", "mary@communic8.com", "matthew@communic8.com"]
}'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"recipients": ["john@communic8.com", "mary@communic8.com", "matthew@communic8.com"]
})
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/recipient`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

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": "Invalid parameters"
}

15. Remove recipients from a channel

Back to top

Remove recipients from a channel.

POST /int/v1/channel/:id/recipient/remove

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Request Body

NameTypeDescription
recipientsString[]optional Recipients to remove the channel (supported recipient references: email, user record ID, Successfactors ID or Successfactors username)
listsString[]optional recipient group record IDs to remove the group's users from the channel
conditionsString[]optional recipient filter conditions to remove matching users from the channel

Examples

CURL Example:

curl --request POST \
--url https://<url>/int/v1/channel/<id>/recipient/remove \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"recipients": ["john@communic8.com", "mary@communic8.com", "matthew@communic8.com"]
}'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"recipients": ["john@communic8.com", "mary@communic8.com", "matthew@communic8.com"]
})
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/recipient/remove`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

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": "Invalid parameters"
}

16. Create (and optionally send) a new campaign in the channel

Back to top

Create (and send) a new campaign in the channel

POST /int/v1/channel/:id/campaign

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Request Body

NameTypeDescription
nameStringThe campaign name
titleStringoptional The campaign title. Used in email/mobile notifications. If not provided, the value of name will be used.
descriptionStringThe campaign description. Used in email/mobile notifications.
statusStringoptional Campaign status. By default the campaign will be sent (status "live"). If the value is "draft", the campaign will not be sent, and be saved as draft_Default value: live_
Allowed values: "live","draft"
scheduledTimeDateoptional scheduled go-live time for campaign in ISO 8601 format (only used if status is not already 'live' or 'draft')
templateIdStringoptional campaign template id
templateDataStringoptional the json data to render the template page by EJS syntax
categoriesStringoptional campaign category array, case sensitive. If not provided, the categories will come from the template
imageUrlStringoptional image url link of the campaign, by default it is from template. The image will be used in email and mobile app.
enableEmailBooleanoptional campaign delivery by email, default is inherited from channel when not provided
enableMobileNotificationBooleanoptional campaign delivery by mobile, default is inherited from channel when not provided
emailReplyToStringoptional campaign email reply email address
commentVisibilityStringoptional Configuration for the comment of the campaign.
"0" for comment only visible to campaign team, "1" for comment also visible to other recipeints in the campaign; default is inherited from channel when not provided.Allowed values: "0","1"
senderUserEmailStringoptional Email address of the campaign sender user, it requires corresponding console user created. By default it is the token owner user. This is not the sender from email address used in campaign.
ownerUserEmailStringoptional Email address of the campaign owner, it requires corresponding console user created. By default it is the token owner user

Examples

CURL Example:

curl --request POST \
--url https://<url>/int/v1/channel/<id>/campaign \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"name": "My campaign",
"description": "My campaign description",
"enableMobileNotification": true,
"templateId": "62a7b72187ce0b222948d465",
"status": "live"
}'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "My campaign",
"description": "My campaign description",
"enableMobileNotification": true,
"templateId": "62a7b72187ce0b222948d465",
"status": "live"
})
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/campaign`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success": true,
"data": {
"_id": "6674d3c947724fc279454dee",
"campaignUrl": "https://mydomain.c8/admin/web/#/campaigns/sent/details/6674d3c947724fc279454dee"
}
}

Success response example - Error:

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

17. Create (and send) a new broadcast to the channel

Back to top

Create (and send) a new broadcast to the channel

POST /int/v1/channel/:id/broadcast

Headers - Header

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

Parameters - Parameter

NameTypeDescription
idStringChannel record ID

Request Body

NameTypeDescription
titleStringThe title of the broadcast.
messageStringThe message content of the broadcast.
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 Does the broadcast require recipient confirmation or not?Default value: false
actionLinkStringoptional Additonal link in broadcast.
actionLinkTextStringoptional The text for the action link button that appears in the broadcast email, that users can click on to view more details.Default value: More Detail
contentInEmailBooleanoptional Will the broadcast message content appear in the email body or require a clickthrough to read?Default value: false

Examples

CURL Example:

curl --request POST \
--url https://<url>/int/v1/channel/<id>/broadcast \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"title": "My broadcast",
"message": "Hello world"
}'

Javascript Example:

try {
const url = process.env.URL;
const token = process.env.TOKEN;
const id = process.env.CHANNEL_ID;
const options = {
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "My campaign",
"description": "My campaign description",
"imageUrl": "https://cf.communic8.com/dyzfiavco/image/upload/v1528258650/c8share/book.jpg",
"emoji": "📖",
"enableMobileNotification": true,
"templateId": "62a7b72187ce0b222948d465",
"status": "live"
})
};
const response = await fetch(`https://${url}/int/v1/channel/${id}/broadcast`, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Success response example

Success response example - Success:

HTTP/1.1 200 OK
{
"success": true,
"data": {
"_id": "6673c00fce26c58a01134090",
"broadcastUrl": "https://mydomain.c8/admin/web/#/broadcasts/all/view/6673c00fce26c58a01134090"
}
}

Success response example - Error:

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