BetterVoice.com provides two general methods to access your Contact, Call, SMS, and Fax data via API.
You'll need your Username
and API Token
to use either method. You can find both on the Account Settings page in your dashboard.
REST API
To see a list of all Rest API endpoints available, you can issue a GET request to the following URL:
https://api.bettervoice.com/api/v3/?username={Your_Username}&token={Your_API_Token}
WebHooks API
To get notified via an HTTP POST when new calls, texts, faxes, or contacts are created in your BetterVoice.com account, simply POST and event
and target_url
parameter to the following URL and we will notify the corresponding Target URL any time a new event occurs:
https://api.bettervoice.com/api/v3/hook/?username={Your_Username}&token={Your_API_Token}
Event choices so far are: call.created
, sms.created
, fax.created
, contact.created
, contact.updated
, and contact.deleted
.
Example WebHook Payload for a call.created
event:
{
"from_number": "+15128275555",
"duration": 989,
"contact_name": "",
"id": "XXXX",
"viewed": false,
"account_id": "1",
"archived": false,
"to_number": "+19712165555",
"to_city": "WOODBURN",
"to_country": "US",
"audio_voicemail": "http://www.example.com/voicemail_url.mp3",
"status": "completed",
"direction": "inbound",
"from_name": "AUSTIN TX",
"to_zip": "97071",
"tags": [],
"timestamp": "02/01/2013 03:38 PM",
"audio_call_label": null,
"from_city": "AUSTIN",
"from_zip": "78749",
"audio_call": null,
"audio_transcription": "This is a voicemail transcription.",
"from_country": "US",
"forwarded_from": null,
"from_state": "TX",
"account": "/api/v2/account/X/",
"to_state": "OR",
"audio_label": null,
"contact": "/api/v2/contact/XX/",
"tollfree": false,
"minutes": 17,
"resource_uri": "/api/v2/call/XXX/"
}