Textlocal Logo

API Documentation

Update User API Key

A Reseller only service Requires Advanced Reseller API This command will update an API key for a sub account under a dual brand or white label provider account.

Resource URL

https://api.txtlocal.com/update_user_apikey/

Sample Request

<?php

$data = [
    'apiKey' => 'Your API Key',
    'user_api_key' => 'GSi8ihLplrc-KNVOYYCOMHNA1CNNE7F0R9N9NCDPU8',
    'notes' => 'My Updated API Key',
    'ip_addresses' => '127.0.0.1,192.168.4.88',
];

// Send the POST request with cURL
$ch = curl_init('https://api.txtlocal.com/update_user_apikey/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

// Process your response here
echo $response;
<?php

$data = [
    'apiKey' => 'Your API Key',
    'user_api_key' => 'GSi8ihLplrc-KNVOYYCOMHNA1CNNE7F0R9N9NCDPU8',
    'notes' => 'My Updated API Key',
    'ip_addresses' => '127.0.0.1,192.168.4.88',
];

$data = http_build_query($data);

// Send the GET request with cURL
$ch = curl_init('https://api.txtlocal.com/update_user_apikey/?' . $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

// Process your response here
echo $response;

Parameters

user_api_key The API key to be updated. Found in get_users
Login Parameters (Additional Information)
apiKey You can create these in your Messenger Control Panel (click here) for each application, and limit the usage of them by host IP Address.
Optional Parameters
notes A helpful note to identify the API key.
ip_addresses A comma separated list of IP addresses that are whitelisted to use the API key. If omitted, then the API key can be used from any IP address.

Sample Response

{
  "ip_addresses": [
    "127.0.0.1"
  ],
  "notes": "foobar",
  "status": "success"
}
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <ip_addresses>
    <ip_addresse>127.0.0.1</ip_addresse>
  </ip_addresses>
  <notes>foobar</notes>
  <status>success</status>
</response>

Errors

Error Codes
172 No reseller account found
311 This endpoint requires the advanced reseller API.
308 Specified API key does not exist or does not belong to a reseller sub account
309 No notes or IP addresses specified

Warnings

Warning Codes
400 Invalid IP address specified.
401 Invalid IP addresses specified.