Add a new campaign item to a campaign
curl --request POST \
--url https://api.starleads.co/CampaignItem/{campaignId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"phoneNumber": "<string>",
"dataBag": {},
"nextTryDate": "<string>"
}
'import requests
url = "https://api.starleads.co/CampaignItem/{campaignId}"
payload = {
"phoneNumber": "<string>",
"dataBag": {},
"nextTryDate": "<string>"
}
headers = {
"X-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-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({phoneNumber: '<string>', dataBag: {}, nextTryDate: '<string>'})
};
fetch('https://api.starleads.co/CampaignItem/{campaignId}', 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.starleads.co/CampaignItem/{campaignId}",
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([
'phoneNumber' => '<string>',
'dataBag' => [
],
'nextTryDate' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <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.starleads.co/CampaignItem/{campaignId}"
payload := strings.NewReader("{\n \"phoneNumber\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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.starleads.co/CampaignItem/{campaignId}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/CampaignItem/{campaignId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"campaignId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z",
"lastCallDate": "2023-11-07T05:31:56Z",
"runningStatus": "Pending",
"attemptCount": 123,
"channel": 0,
"phoneNumber": "<string>",
"businessId": "<string>",
"nextTryDate": "2023-11-07T05:31:56Z",
"dataBag": {},
"result": {
"tag": {
"id": "<string>",
"name": "<string>",
"color": "<string>"
},
"conversation": {
"id": "<string>",
"messages": [
{
"timestamp": "2023-11-07T05:31:56Z",
"role": "<string>",
"text": "<string>",
"rawText": "<string>",
"intent": "<string>",
"commands": [
"<string>"
],
"isConversationEnded": true,
"endReason": "<string>"
}
]
},
"summary": "<string>",
"isSystem": true,
"metadata": {}
},
"isArchived": true,
"eventList": [
{
"type": "LaunchCall",
"date": "2023-11-07T05:31:56Z",
"description": "<string>"
}
],
"delivery": {
"status": 1,
"externalMessageId": "<string>",
"provider": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"readAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorTitle": "<string>",
"lastMessageIndex": 123,
"lastOrigin": 0,
"history": [
{
"origin": 0,
"messageIndex": 123,
"externalMessageId": "<string>",
"status": 1,
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"readAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorTitle": "<string>"
}
]
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Campaign Items
Add a new campaign item to a campaign
POST
/
CampaignItem
/
{campaignId}
Add a new campaign item to a campaign
curl --request POST \
--url https://api.starleads.co/CampaignItem/{campaignId} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"phoneNumber": "<string>",
"dataBag": {},
"nextTryDate": "<string>"
}
'import requests
url = "https://api.starleads.co/CampaignItem/{campaignId}"
payload = {
"phoneNumber": "<string>",
"dataBag": {},
"nextTryDate": "<string>"
}
headers = {
"X-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-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({phoneNumber: '<string>', dataBag: {}, nextTryDate: '<string>'})
};
fetch('https://api.starleads.co/CampaignItem/{campaignId}', 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.starleads.co/CampaignItem/{campaignId}",
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([
'phoneNumber' => '<string>',
'dataBag' => [
],
'nextTryDate' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <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.starleads.co/CampaignItem/{campaignId}"
payload := strings.NewReader("{\n \"phoneNumber\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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.starleads.co/CampaignItem/{campaignId}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phoneNumber\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.starleads.co/CampaignItem/{campaignId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"phoneNumber\": \"<string>\",\n \"dataBag\": {},\n \"nextTryDate\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"campaignId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"processedAt": "2023-11-07T05:31:56Z",
"lastCallDate": "2023-11-07T05:31:56Z",
"runningStatus": "Pending",
"attemptCount": 123,
"channel": 0,
"phoneNumber": "<string>",
"businessId": "<string>",
"nextTryDate": "2023-11-07T05:31:56Z",
"dataBag": {},
"result": {
"tag": {
"id": "<string>",
"name": "<string>",
"color": "<string>"
},
"conversation": {
"id": "<string>",
"messages": [
{
"timestamp": "2023-11-07T05:31:56Z",
"role": "<string>",
"text": "<string>",
"rawText": "<string>",
"intent": "<string>",
"commands": [
"<string>"
],
"isConversationEnded": true,
"endReason": "<string>"
}
]
},
"summary": "<string>",
"isSystem": true,
"metadata": {}
},
"isArchived": true,
"eventList": [
{
"type": "LaunchCall",
"date": "2023-11-07T05:31:56Z",
"description": "<string>"
}
],
"delivery": {
"status": 1,
"externalMessageId": "<string>",
"provider": "<string>",
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"readAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorTitle": "<string>",
"lastMessageIndex": 123,
"lastOrigin": 0,
"history": [
{
"origin": 0,
"messageIndex": 123,
"externalMessageId": "<string>",
"status": 1,
"sentAt": "2023-11-07T05:31:56Z",
"deliveredAt": "2023-11-07T05:31:56Z",
"readAt": "2023-11-07T05:31:56Z",
"failedAt": "2023-11-07T05:31:56Z",
"errorCode": "<string>",
"errorTitle": "<string>"
}
]
}
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"instance": "<string>"
}Authorizations
Headers
Path Parameters
ID of the campaign.
Body
application/jsontext/jsonapplication/*+json
Phone number of the campaign item. It must be unique.
Minimum string length:
1The databag refer to the campaign fields. The Databag needs one key / entry per mandatory fields of the targeted campaign.
If one mandatory field is missing from the databag, an error will be returned.
Databag's keys that aren't properties of the targeted campaign will be ignored.
If the campaign has no mandatory fields, this property can be ommited
Show child attributes
Show child attributes
The next date when the number will be called again by Starleads.
If this property is not set (or set to null), it will be setted by default to today.
Response
Created
Available options:
Pending, Calling, Processed, ProcessingResult, Error Available options:
0, 1, 2, 3, 4 Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes

