Get Started With SMS
Utilize a single SMS API integration to deliver scalable messaging to your audience.
Send a straightforward SMS text by specifying the recipient and message text, or try out a variety of extras, such as bulk sending. Use Ampenet's SMS API to swiftly, dependably, and securely provide scale messaging from your systems.
The Ampenet SMS Contacts API allows you to manage contacts identifiable by a unique random ID. You can use this ID to create, view, update, or remove contacts. This API functions as a database of customer-specific contacts, allowing you to organize them and provide custom values that you may then utilize when sending SMS template messages.
The Contacts API employs HTTP verbs and a RESTful endpoint structure, as well as an access key for API authorization. The payloads of requests and responses are represented as JSON with UTF-8 encoding and URL encoded values.
API Endpoint
https://sms.ampenet.com/api/v3/contacts
Parameters
PARAMETER | REQUIRED | DESCRIPTION |
---|---|---|
Authorization | When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token}) | |
Accept | Set to application/json |
Create a Contact
This method creates a new contact object. With each request, Ampenet SMS returns the newly created contact object.
API Endpoint
https://sms.ampenet.com/api/v3/contacts/{group_id}/store
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
group_id | string | Contact groups uid | |
phone | number | The phone number of the contact. | |
first_name | No | string | The first name of the contact. |
last_name | No | string | The last name of the contact. |
Example Request (PHP)
curl -X POST https://sms.ampenet.com/api/v3/contacts/6065ecdc9184a/store \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd' \
-d "phone=31612345678"
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "contacts data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
View a Contact
Returns the contact details for an existing contact. You simply need to supply the unique contact uid and group uid that was returned when the contact or group was created or received.
API Endpoint
https://sms.ampenet.com/api/v3/contacts/{group_id}/search/{uid}
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
group_id | string | Contact groups uid | |
uid | string | Contact uid |
Example Request (PHP)
curl -X POST https://sms.ampenet.com/api/v3/contacts/6065ecdc9184a/search/606732aec8705 \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd'
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "contacts data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
Update a Contact
Updates an existing contact. You simply need to supply the unique contact uid and contact group uid that was returned when the contact was created.
API Endpoint
https://sms.ampenet.com/api/v3/contacts/{group_id}/update/{uid}
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
group_id | string | Contact groups uid | |
uid | string | Contact uid | |
phone | number | The phone number of the contact. | |
first_name | No | string | The first name of the contact. |
last_name | No | string | The last name of the contact. |
Example Request (PHP)
curl -X PATCH https://sms.ampenet.com/api/v3/contacts/6065ecdc9184a/update/606732aec8705 \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd' \
-d "phone=31612345678"
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "contacts data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
Delete a Contact
Deletes an existing contact. You only need to supply the unique contact uid and group uid that was returned upon creation.
API Endpoint
https://sms.ampenet.com/api/v3/contacts/{group_id}/delete/{uid}
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
group_id | string | Contact groups uid | |
uid | string | Contact uid |
Example Request (PHP)
curl -X DELETE https://sms.ampenet.com/api/v3/contacts/6065ecdc9184a/delete/606732aec8705 \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd'
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "contacts data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
View All Contacts in a Group
Lists all contacts in a group.
API Endpoint
https://sms.ampenet.com/api/v3/contacts/{group_id}/all
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
group_id | string | Contact groups uid |
Example Request (PHP)
curl -X POST https://sms.ampenet.com/api/v3/contacts/6065ecdc9184a/all \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd'
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "contacts data with pagination",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
You can use the Ampenet SMS Contact Groups API to handle contact groups that are identified by a unique random ID. This ID is used to create, view, update, and delete groups.
API Endpoint
https://sms.ampenet.com/api/v3/contacts
Parameters
PARAMETER | REQUIRED | DESCRIPTION |
---|---|---|
Authorization | When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token}) | |
Accept | Set to application/json |
Create a Group
API Endpoint
https://sms.ampenet.com/api/v3/contacts
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
name | string | The name of the group. |
Example Request (PHP)
curl -X POST https://sms.ampenet.com/api/v3/contacts \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd' \
-d "name=ampenet"
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "group data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
View a Group
Returns information about an existing group. You simply need to provide the unique group ID that was returned when the group was created or received.
API Endpoint
https://sms.ampenet.com/api/v3/contacts/{group_id}/show/
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
group_id | string | Contact groups uid |
Example Request (PHP)
curl -X POST https://sms.ampenet.com/api/v3/contacts/6065ecdc9184a/show \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd'
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "group data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
Update a Group
API Endpoint
https://sms.ampenet.com/api/v3/contacts/{group_id}
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
group_id | string | Contact groups uid | |
name | string | New group name |
Example Request (PHP)
curl -X PATCH https://sms.ampenet.com/api/v3/contacts/6065ecdc9184a \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd' \
-d "name=ampenet new"
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "groups data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
Delete a Group
API Endpoint
https://sms.ampenet.com/api/v3/contacts/{group_id}
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
group_id | string | Contact groups uid |
Example Request (PHP)
curl -X DELETE https://sms.ampenet.com/api/v3/contacts/6065ecdc9184a \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd'
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "null",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
View All Groups
Lists all groups.
API Endpoint
https://sms.ampenet.com/api/v3/contacts/
Example Request (PHP)
curl -X GET https://sms.ampenet.com/api/v3/contacts \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd'
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "group data with pagination",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
API Endpoint
https://sms.ampenet.com/api/v3/sms/send
Parameters
PARAMETER | REQUIRED | DESCRIPTION |
---|---|---|
Authorization | When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token}) | |
Accept | Set to application/json |
Send An Outbound SMS
The Programmable SMS API from Ampenet SMS allows you to send SMS messages from your web application programmatically. You must first build a new message object. With each request, Ampenet SMS returns the produced message object.
Use this example request to send your first SMS message.
API Endpoint
https://sms.ampenet.com/api/v3/sms/send
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
recipient | string | Number to send message. Use a comma (,) to send multiple numbers. Ex. 255712345678,255712876543 | |
sender_id | string | The sender of the message. This can be a telephone number (including country code) or an alphanumeric string. In the case of an alphanumeric string, the maximum length is 11 characters. | |
type | string | The type of the message. For text messages, you have to insert plain as sms type. | |
message | string | The body of the SMS message. | |
schedule_time | datetime | The scheduled date and time of the message in RFC3339 format (Y-m-d H:i) |
Example Request for a Single Number (PHP)
curl -X POST https://sms.ampenet.com/api/v3/sms/send \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd' \
-d "recipient=255712345678" \
-d "sender_id=YourName" \
-d "type=plain" \
-d "schedule_time=2021-12-20 07:00" \
-d "message=This is a test message"
Example Request for Multiple Numbers (PHP)
curl -X POST https://sms.ampenet.com/api/v3/sms/send \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd' \
-d "recipient=254712345678,254712876543" \
-d "sender_id=YourName" \
-d "type=plain" \
-d "schedule_time=2021-12-20 07:00" \
-d "message=This is a test message"
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "sms reports with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
View An SMS
Our SMS API can be used to get information from an existing inbound or outgoing SMS message. You simply need to provide the unique message id that was returned when the message was created or received.
API Endpoint
https://sms.ampenet.com/api/v3/sms/{uid}
Parameters
PARAMETER | REQUIRED | TYPE | DESCRIPTION |
---|---|---|---|
uid | string | A unique random uid which is created on the Ampenet SMS platform and is returned upon creation of the object. |
Example Request (PHP)
curl -X POST https://sms.ampenet.com/api/v3/contacts/6065ecdc9184a/show \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd'
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "group data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
View All Messages
View all messages.
API Endpoint
https://sms.ampenet.com/api/v3/sms/
Example Request (PHP)
curl -X GET https://sms.ampenet.com/api/v3/sms \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd'
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "sms reports with pagination",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
API Endpoint
https://sms.ampenet.com/api/v3/me
Parameters
PARAMETER | REQUIRED | DESCRIPTION |
---|---|---|
Authorization | When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token}) | |
Accept | Set to application/json |
View SMS Units
Viewing the SMS units information.
API Endpoint
https://sms.ampenet.com/api/v3/balance
Example Request (PHP)
curl -X GET https://sms.ampenet.com/api/v3/balance \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd'
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "sms unit with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
View Profile
View profile information.
API Endpoint
https://sms.ampenet.com/api/v3/me
Example Request (PHP)
curl -X GET https://sms.ampenet.com/api/v3/me \
-H 'Authorization: Bearer 7|xs6pv2dspHJq8sWLhrpNFH5YLilMRQcVxLwSw2Sd'
Returns (JSON)
Returns a contact object if the request was successful.
{
"status": "success",
"data": "profile data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
Our Partners & Suppliers
Great collaborations result in great outcomes! In order to deliver on our commitment to you of excellent service, we have partnered with these fantastic brands.
Let's Get You Started
Please fill in the form with your details and we will get you started ASAP!
SMS Volume | Price Per SMS (KSH) |
---|---|
1 - 250000 | 0.50 |
250001 - 500000 | 0.45 |
500001+ | 0.40 |
Network | Price Per Sender ID (KSH) |
---|---|
Safaricom* | 7000 |
Airtel* | 7000 |
Telkom* | 7000 |
*Sender ID is subject to approval by the network |
Account Request Form
For us to better serve you, please tell us more about you or your company. After submission, a member of our team will contact you as soon as they can.
Let's Get You Started
Please fill in the form with your details and we will get you started ASAP!
SMS Volume | Price Per SMS (TSH) |
---|---|
1 - 5000 | 25 |
5001 - 25000 | 24 |
25001 - 50000 | 23 |
50001 - 100000 | 22 |
100001 - 250000 | 20 |
250001 - 500000 | 19 |
500001+ | 17 |
Network | Price Per Sender ID (TSH) |
---|---|
All mobile networks* | 0 |
*Sender ID is subject to approval by the networks |
Account Request Form
For us to better serve you, please tell us more about you or your company. After submission, a member of our team will contact you as soon as they can.