Voice Calling
Voice calling is how you send audio in Our Voice - they allow you to send all kinds of files to your contacts and groups. On this page, we'll dive into the different attachment endpoints you can use to manage attachments programmatically. We will see how to get voice callback data, send a voice call, send a voice call to maby contacts or phone numbers and get an account voice calls.
The Voice Calling model contains all the information about the Voice calling and attachments you send to your contacts and groups, including how your contacts have reacted to them.
Properties
- Name
id
- Type
- string
- Description
Unique identifier for the Voice.
- Name
from
- Type
- string
- Description
Who sends the Voice.
- Name
to
- Type
- string
- Description
To whom the Voice is sent.
- Name
audio_url
- Type
- string
- Description
The URL for the audio file.
- Name
status
- Type
- enum
- Description
The status of the Voice. Types of status : queued, ringing, answered, playing.
- Name
direction
- Type
- enum
- Description
The direction of the SMS. Types of direction : incoming and outgoing.
- Name
start_time
- Type
- datetime
- Description
The start time of the Voice.
- Name
end_time
- Type
- datetime
- Description
The end time of the Voice.
- Name
cost
- Type
- double
- Description
The cost of the SMS.
- Name
campaign_id
- Type
- string
- Description
Unique identifier for the campaign the voice calling belongs to.
- Name
contact_id
- Type
- string
- Description
Unique identifier for the contact the voice calling belongs to.
- Name
created_at
- Type
- timestamp
- Description
Timestamp of when the sms was created.
- Name
updated_at
- Type
- timestamp
- Description
Timestamp of when the sms was updated.
Send a voice call
This endpoint allows you to send a new voice call to one of your conversations.
Required attributes
- Name
to
- Type
- string
- Description
The receiver phone number.
- Name
audio_url
- Type
- string
- Description
The audio_url.
Request
curl --request POST \
"https://api.getourvoice.com/v1/call" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"to\": \"22996XXXXXX\",
\"audio_url\": \"https://ourvoice-bucket.s3.eu-west-3.amazonaws.com/1683821110-videoplayback.mp3\"
}"
Send a voice call to many contacts or phone numbers
This endpoint allows you to send a new voice call to many contacts or phone numbers in your conversations.
Required attributes
- Name
to
- Type
- string
- Description
The receiver phone number.
- Name
audio_url
- Type
- string
- Description
The audio_url.
Request
curl --request POST \
"https://api.getourvoice.com/v1/calls" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"to\": \"22996XXXXXX\",
\"audio_url\": \"https://ourvoice-bucket.s3.eu-west-3.amazonaws.com/1683821110-videoplayback.mp3\"
}"
Get an account voice calls
This endpoint allows you to retrieve a paginated list with filter of all voice calls in your account (in a chat if a chat ID is provided). By default, a maximum of fifteen attachments are displayed per page.
Request
curl --request GET \
--get "https://api.getourvoice.com/v1/calls?page=1&limit=10&filter[to]=&filter[from]=&filter[direction]=outgoing&filter[status]=completed&filter[duration]=" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
Response
{
"data": [],
"links": {
"first": "https://api.getourvoice.com/v1/calls?page=1&limit=10&filter[to]=&filter[from]=&filter[direction]=outgoing&filter[status]=completed&filter[duration]=",
"last": "https://api.getourvoice.com/v1/calls?page=1&limit=10&filter[to]=&filter[from]=&filter[direction]=outgoing&filter[status]=completed&filter[duration]=",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": null,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Précédent",
"active": false
},
{
"url": "https://api.getourvoice.com/v1/calls?page=1&limit=10&filter[to]=&filter[from]=&filter[direction]=outgoing&filter[status]=completed&filter[duration]=",
"label": "1",
"active": true
},
{
"url": null,
"label": "Suivant »",
"active": false
}
],
"path": "https://api.getourvoice.com/v1/calls?page=1&limit=10&filter[to]=&filter[from]=&filter[direction]=outgoing&filter[status]=completed&filter[duration]=",
"limit": 10,
"to": null,
"total": 0
}
}