Rename a Client Account

Purpose: Rename a client to an alternate "unique" ID.
Parent API: Client Ops [http://www.simplescripts.com/api/client_ops.php]
Notes: Renaming a client from one unique ID to another will preserve any installation data and account status.

Requirements

This API can be accessed via a standard GET or POST request.
KeyValueNotes
m"rename_client""m" sets the mode of operation for the parent API.
host_keyYour Host KeyYour Host Key is a unique identifier provided by SimpleScripts for tracking purposes. This key is used in all SimpleScripts APIs.
host_api_keyYour Host API KeyYour Host API Key is a special password required to use this and any other SimpleScripts API. Keep this password secure!
old_uniqueCurrent Unique Account IDThe existing host-wide unique id for the client. Can be the user's username (if unique among ALL of your servers) or an account id, etc.
new_uniqueNew Unique Account IDThe replacement for the existing unique ID.

Return Values

A successful request (not necessarily a successful operation) will return a string concatenated with a pipe "|" symbol, like this: "0|Secure Connection Required". Exploding the string on the pipe symbol will give you an array of parts, which are notated below. Part Zero will always be a binary 0 or 1, depending on the operations failure or success, respectively.
SuccessPart 1Notes
0Secure Connection RequiredAll requests must use the https:// protocol when calling the SimpleScripts APIs.
0HostKey RequiredThis field is required. For more info, view the Requirements table above.
0HostAPIKey RequiredThis field is required. For more info, view the Requirements table above.
0Invalid HostKey/HostAPIKey CombinationJust like a bad username/password combination, this means you have provided bad information.
0Old/New Unique ID RequiredThe client's unique id is required. For more info, view the Requirements table above.
1UniqueID Does Not ExistThe specified Unique ID does not exist in our system. This returns successful.
1Successfully renamed old_unique to new_uniqueThe operation completed successfully.

Sample Request

<?php

$url = "https://www.simplescripts.com/api/client_ops.php";

$my_request = array(
   "host_key" => "YOUR HOST KEY",
   "host_api_key" => "YOUR HOST API KEY",
   "m" => "rename_client",
   "old_unique" => "OLD UNIQUE CLIENT ID HERE", 
   "new_unique" => "NEW UNIQUE CLIENT ID HERE",
);

//use CURL or equivalent to get response data 
//returns: 0|Host Key Required or 1|Successfully renamed old_unique to new_unique 

?>