Menu
Introduction Getting started SMS Promotional - Large campaigns Transactional - Basic Transactional (Alerts) - Virtual Number Route Transactional (Alerts) - Priority Routing Transactional (OTPs & Alerts) - Special route International route to Nigeria International route to Other Countries SMS DLR SMS DLR Webhooks Voice Voice OTP Voice Broadcasts Voice DLR Units Transfer Units to Sub-Account Transfer Units to Other Account Check Units Balance Sender IDs Register Sender IDs Check Sender ID status Categories Add Customer Remove Customer Virtual Number Inbox webhook Carrier Billing Run USSD Query Run Shortcode Query Query Status Tools Create Sub-Account Check DND Status Check Service Status 3rd-party integrations ZOHO
CREATE NEW CUSTOMER / CONTACT The API is used when you want to programatically create a new customer/recipient/contact under a category.
💡 USAGE First, create a category and a corresponding contacts link in the 'category' section of your dashboard.
GET
https://api.textng.xyz/addcustomer/?key=YOUR-ACCOUNT-KEY&catid=CATEGORY-URL-ID&customername=CUSTOMER-FULLNAME&customerphone=CUSTOMER-PHONENUMBER
PHP code
<?php
  // Using file_get_contents
  $key="YOUR-ACCOUNT-KEY";
  $catid="CATEGORY-URL-ID";
  $customername=str_replace(" ","|_","CUSTOMER FULLNAME");
  $customerphone="CUSTOMER-PHONENUMBER";
  $arrContextOptions=array(
        "ssl"=>array(
            "verify_peer"=>false,
           "verify_peer_name"=>false,
        ),
    );
    $data = file_get_contents("https://api.textng.xyz/addcustomer/?key=$key&catid=$catid&customername=$customername&customerphone=$customerphone", false, stream_context_create($arrContextOptions));
    $decode = json_decode($data);
    $extracted_data = $decode->D->details;
    foreach ($extracted_data as $extracted_data_info) {
        echo $customer_phone = $extracted_data_info->customerphone;
        echo $customer_name = $extracted_data_info->customername;
        echo $catid = $extracted_data_info->catid;
        echo $status = $extracted_data_info->status;
    }
?>
Parameters
Parameters Example Description
Key XXXXX-XXXX-XXXXX This can be found in the Developers page of your dashboard. The key authorizes the transaction.
catid * XXXXXXXXXX This is the category url ID generated for each url link you create. you'll get this in the Customer URL Upload page.
customername * Adekunle This the name you want to save the recipient/customer as.
customerphone * 2 This is the phone number of the recipient/customer to be saved.
Responses
Your transaction response will appear in JSON format as shown below.
Successful (JSON)
{
    "D":{
        "details":[{
            "customerphone":"080xxxxxx",
            "customername":"CUSTOMER-NAME",
            "catid":"xxxxxxxxxx",
            "status":"successful"
            }]
        }
    }    
}
Error - Phone number already exists in the category (JSON)
{
    "D":{
        "details":[{
            "customerphone":"080xxxxxx",
            "customername":"CUSTOMER-NAME",
            "catid":"xxxxxxxxxx",
            "status":"error-customerphone-exists-in-category"
            }]
        }
}
Error - Missing name (JSON)
{
    "D":{
        "details":[
        {
            "status":"customername-not-exists"
        }]
    }
}
Error - Missing phone number (JSON)
{
    "D":{
        "details":[
            {
            "status":"customerphone-not-exists"
            }
        ]
    }
}
Error - Missing Category ID (JSON)
{
    "D":{
        "details":[
            {
            "status":"catid-not-exists"
            }
        ]
    }
}
Error - Invalid key (JSON)
{
    "D":{
        "details":[
            {
            "status":"key-invalid"
            }
        ]
    }
}