Skip to main content

txt.co.zw API

The txt.co.zw API provides a simple way to send SMS messages and pinless airtime directly to recipients using a pre-existing txt.co.zw account via form POST requests.

A Postman collection of all API requests and sample responses is available at paynow/paynow-txt.

Hosts

There are two txt.co.zw hosts available.

HostCurrency
www.txt.co.zwZWG
usd.txt.co.zwUSD
warning

Your API credentials need to be configured on the host you choose to use. If your credentials are configured on usd.txt.co.zw you cannot use them on www.txt.co.zw without having them added to that host as well.

Authentication

There are two methods available for API authentication. Both require a user with the REMOTE role to be added to the customer account on txt.co.zw. Contact support to have a REMOTE user created for you.

1. Username & I.P. Address Authentication

The REMOTE user must have the public IP address of the requesting machine configured for authentication purposes.

info

If the requesting system is web-based, the server must make the request (not the client) as the requesting IP address will change with each client and will be blocked by the API.

All API endpoints accept a Username field for this authentication method.

2. Basic Authentication

The REMOTE user must be configured with a password of at least 16 characters.

For increased security, you may optionally add IP address restrictions to the user, which will disable login from non-whitelisted IP addresses.

All requests should include an Authorization header. When using Basic Authentication, the Username field can be omitted from all API endpoints.

See Basic access authentication for details on the scheme.

Test Mode

A REMOTE user can be put in test mode which directs all SMS and airtime requests to a list of predefined email addresses or mobile numbers. This ensures that:

  • No SMS is sent to live customers by mistake
  • No monetary exchange is made during airtime testing