API reference
Campaigns
The Campaign object represents the Twitter outreach campaigns on Cold DM.
ENDPOINTS
The Campaign Object
- id stringUnique identifier of the campaign
- name stringName of the campaign
- template stringName of the template used for the campaign
- contact_list stringName of the contact list, if used, for the campaign
- is_api_allowed booleanTrue for campaigns with API access to send on-demand messages
- total_recipients numberTotal number of recipients
- messages_sent numberTotal number of messages sent at the moment
List All Campaigns
Returns a list of all the Campaign objects in sorted order with the most recently created appearing first.
Example
cURL
curl https://api.colddm.me/v1/campaigns/
-H "Authorization: Bearer your-secret-api-key"
Javascript
const response = await fetch(`https://api.colddm.me/v1/campaigns/`, {
headers: {
Authorization: 'Bearer your-secret-api-key',
},
})
if (response.ok) {
//Success
const { data: campaigns } = await response.json()
campaigns.forEach((campaign) => console.log(campaign.name))
} else {
//Handle error
const { code, message } = await response.json()
console.log(`Error Code : ${code}
Error Message : ${message}`)
}
Retrieve Campaign
Returns the Campaign object for the provided identifier.
Example
cURL
curl https://api.colddm.me/v1/campaigns/some-campaign-id
-H "Authorization: Bearer your-secret-api-key"
Javascript
const response = await fetch(
`https://api.colddm.me/v1/campaigns/some-campaign-id`,
{
headers: {
Authorization: 'Bearer your-secret-api-key',
},
}
)
if (response.ok) {
//Success
const { data: campaign } = await response.json()
console.log(campaign.name)
} else {
//Handle error
const { code, message } = await response.json()
console.log(`Error Code : ${code}
Error Message : ${message}`)
}