• Home
  • About Us
  • IT & Digital Solutions
    • Website Design & Development
    • Web & Mobile Applications
    • ICT Consultancy
    • Bulk SMS
  • Weighing Systems & Software
  • SiriTrack
  • SYSTEM LOGIN
    • GPS Tracking System
    • Video Telematics System
    • Bulk SMS Application
Ampenet Solutions
    • Home
    • About Us
    • IT & Digital Solutions
      • Website Design & Development
      • Web & Mobile Applications
      • ICT Consultancy
      • Bulk SMS
    • Weighing Systems & Software
    • SiriTrack
    • SYSTEM LOGIN
      • GPS Tracking System
      • Video Telematics System
      • Bulk SMS Application
  • info@ampenet.com
  • +255 710 867 157
Ampenet Solutions
Ampenet Solutions
  • Home
  • About Us
  • IT & Digital Solutions
    • Website Design & Development
    • Web & Mobile Applications
    • ICT Consultancy
    • Bulk SMS
  • Weighing Systems & Software
  • SiriTrack
  • SYSTEM LOGIN
    • GPS Tracking System
    • Video Telematics System
    • Bulk SMS Application

Contacts API

  • September 1, 2022
  • AmpenetSolutions
  • 0

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

PARAMETERREQUIREDDESCRIPTION
AuthorizationWhen calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token})
AcceptSet 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

PARAMETERREQUIREDTYPEDESCRIPTION
group_idstringContact groups uid
phonenumberThe phone number of the contact.
first_nameNostringThe first name of the contact.
last_nameNostringThe 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

PARAMETERREQUIREDTYPEDESCRIPTION
group_idstringContact groups uid
uidstringContact 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

PARAMETERREQUIREDTYPEDESCRIPTION
group_idstringContact groups uid
uidstringContact uid
phonenumberThe phone number of the contact.
first_nameNostringThe first name of the contact.
last_nameNostringThe 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

PARAMETERREQUIREDTYPEDESCRIPTION
group_idstringContact groups uid
uidstringContact 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

PARAMETERREQUIREDTYPEDESCRIPTION
group_idstringContact 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."
} 
  • Previous Contact Groups API
  • Next Teachers
Ampenet Solutions

Subscribe to our newsletter

About Us

Your success is our success and that is why we put emphasis in solution implimentations that are optimized to deliver you the most returns on investment and sustain your business in the long-term.

Kenya

   PCEA Flats, Block B, B1,
Jabavu Road, Hurlingham,
Nairobi, Kenya

   (254) 740 855 082

   info@ampenet.com

   tracking@ampenet.com

Tanzania

   1st Floor, 397 Capial Plaza, Mwai Kibaki Rd, Mbezi Beach, Dar es Salaam.

   (255) 710 867 157

   info@ampenet.com

   tracking@ampenet.com

Useful Links

  •    About Us
  •    GPS Tracking & Fleet Management
  •    Web & Digital Solutions
  •    Bulk SMS Solutions
  •    ICT Consultancy

© 2023 | Ampenet Solutions