Send SMS

Send SMS messages through our API. Let's start with our first service.

Endpoint

POST https://anypaytanzania.com/api/sms/send/

Request Body

{
  "sender_id": "ANYPAY TZ",
  "message": "Now you can visit our website via https://anypaytanzania.com",
  "contacts": "0798100380"
}

Sample Response

{
    "code": 200,
    "success": true,
    "message": "Message sent successfully",
    "balance_info": {
        "current_balance": 1.0,
        "required_segments": 1,
        "can_send": true,
        "additional_credits_needed": 0,
        "characters": {
            "total": 59,
            "per_segment": 160,
            "segments_breakdown": "59 characters = 1 SMS segments"
        }
    },
    "data": {
        "id": "40cb8739-016e-4e1a-91cc-cae1ead08477",
        "sender_id": "ANYPAY TZ",
        "message_type": "text",
        "message": "Now you can visit our website via https://anypaytanzania.com",
        "contacts": "0798100380",
        "shoot_id": "regimentfnqobxlfq9d5m",
        "valid_contacts": 1,
        "invalid_contacts": 0,
        "duplicated_contacts": 0,
        "message_size": 1,
        "success": true,
        "response_message": "Message submit",
        "created_at": "2026-01-13T11:51:55.576743Z"
    }
}

Code Samples

Choose the sample you need and click the copy button in the top-right corner.

curl -X POST https://anypaytanzania.com/api/sms/send/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
    "sender_id": "ANYPAY TZ",
    "message": "Now you can visit our website via https://anypaytanzania.com",
    "contacts": "0798100380"
  }'

Recent SMS Messages

Endpoint

GET https://anypaytanzania.com/api/sms/recent/

Sample Response

{
    "success": true,
    "recent_messages_count": 2,
    "recent_messages": [
        {
            "id": "40cb8739-016e-4e1a-91cc-cae1ead08477",
            "sender_id": "ANYPAY TZ",
            "message_type": "text",
            "message": "Hellow Customer !",
            "contacts": "0798100380",
            "shoot_id": "regimentfnqobxlfq9d5m",
            "valid_contacts": 1,
            "invalid_contacts": 0,
            "duplicated_contacts": 0,
            "message_size": 1,
            "success": true,
            "response_message": "Message submit",
            "created_at": "2026-01-13T11:51:55.576743Z"
        },
        {
            "id": "3111b152-d017-45b7-ac50-e7ac7668f59f",
            "sender_id": "ANYPAY TZ",
            "message_type": "text",
            "message": "Hellow Customer !",
            "contacts": "0798100380,0713570435,0680900380",
            "shoot_id": "regimentoj4i3qzs9ifyf",
            "valid_contacts": 3,
            "invalid_contacts": 0,
            "duplicated_contacts": 0,
            "message_size": 1,
            "success": true,
            "response_message": "Message submit",
            "created_at": "2026-01-13T09:42:25.221450Z"
        }
    ]
}

SMS Balance

Endpoint

GET https://anypaytanzania.com/api/sms/remains_sms_number/

Sample Response

{
    "success": true,
    "sms_balance": "100.00"
}