Developers

SDKs and libraries

Every feature is a plain HTTPS request, so the HTTP client you already use is all you need.

Send a text from your language

The same request in each tab. The API key pair goes in the x-key and x-secret headers.

curl
curl -X POST https://api-v2.dropcowboy.com/sms \
  -H "x-key: $DC_KEY" -H "x-secret: $DC_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+13125550142",
    "phone_line_id": "e2b6f9a3-5c1d-4e8b-a4f7-9c3e1b5d7a28",
    "body": "Your order is ready for pickup. Reply STOP to opt out."
  }'
JavaScript (Node 18+)
const res = await fetch('https://api-v2.dropcowboy.com/sms', {
  method: 'POST',
  headers: {
    'x-key': process.env.DC_KEY,
    'x-secret': process.env.DC_SECRET,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    to: '+13125550142',
    phone_line_id: 'e2b6f9a3-5c1d-4e8b-a4f7-9c3e1b5d7a28',
    body: 'Your order is ready for pickup. Reply STOP to opt out.'
  })
});

// 202 means accepted. The result arrives on the contact.sms.status webhook.
console.log(res.status, await res.json());
Python (requests)
import os
import requests

res = requests.post(
    "https://api-v2.dropcowboy.com/sms",
    headers={"x-key": os.environ["DC_KEY"], "x-secret": os.environ["DC_SECRET"]},
    json={
        "to": "+13125550142",
        "phone_line_id": "e2b6f9a3-5c1d-4e8b-a4f7-9c3e1b5d7a28",
        "body": "Your order is ready for pickup. Reply STOP to opt out.",
    },
    timeout=30,
)

# 202 means accepted. The result arrives on the contact.sms.status webhook.
print(res.status_code, res.json())

Questions

Do I need to install a package?
No. Call the REST API directly with fetch, axios, requests or any other HTTP client. The docs show curl, JavaScript and Python for each flow, and the examples on GitHub run in Node.js, Python and C# with no Drop Cowboy® package.
Which base URL do I use?
Every v2 route is under https://api-v2.dropcowboy.com. Authenticate with the x-key and x-secret headers, or with an OAuth bearer token from https://login.dropcowboy.com/oauth/token.
Can I embed Drop Cowboy UI instead of building it?
Yes. Building Blocks load a ready-made dialer, inbox, contacts and texting-registration UI into your app with one script and a short-lived token minted by your server.