twitter

API reference

Campaigns

The Campaign object represents the Twitter outreach campaigns on Cold DM.

ENDPOINTS

The Campaign Object

  • id string
    Unique identifier of the campaign
  • name string
    Name of the campaign
  • template string
    Name of the template used for the campaign
  • contact_list string
    Name of the contact list, if used, for the campaign
  • is_api_allowed boolean
    True for campaigns with API access to send on-demand messages
  • total_recipients number
    Total number of recipients
  • messages_sent number
    Total 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}`)
}
Previous
Errors