Home Sign In Try Free

Account


The account object contains functions related to your account such as viewing remaing credits and getting your API key

get_name()

Gets the name of the user assigned to the current API key

Function Declaration

public function get_name();

Example Code

$textplode = new Textplode('API_KEY');
$name = $textplode->account->get_name();

Example Response

{"errors":{"errorCode":200,"errorMessage":"OK"},"version":"v3","data":"first_name last_name"}

get_email()

Gets the email of the user assigned to the current API key

Function Declaration

public function get_name();

Example Code

$textplode = new Textplode('API_KEY');
$email = $textplode->account->get_email();

Example Response

{"errors":{"errorCode":200,"errorMessage":"OK"},"version":"v3","data":[{"email":"example@example.com"}]}

get_credits()

Gets the remaining credits of the user assigned to the current API key

Function Declaration

public function get_credits();

Example Code

$textplode = new Textplode('API_KEY');
$credits = $textplode->account->get_credits();

Example Response

{"errors":{"errorCode":200,"errorMessage":"OK"},"version":"v3","data":[{"credits":"10"}]}

get_credit_threshold()

Gets the credit alert threshold of the user assigned to the current API key

Function Declaration

public function get_credit_threshold();

Example Code

$textplode = new Textplode('API_KEY');
$credit_threshold = $textplode->account->get_credit_threshold();

Example Response

{"errors":{"errorCode":200,"errorMessage":"OK"},"version":"v3","data":[{"low_credit_warning":"5"}]}

get_default_from()

Gets the default "From Name" of the user assigned to the current API key

Function Declaration

public function get_credit_threshold();

Example Code

$textplode = new Textplode('API_KEY');
$default_from = $textplode->account->get_default_from();

Example Response

{"errors":{"errorCode":200,"errorMessage":"OK"},"version":"v3","data":[{"default_from_name":"Textplode"}]}

login()

Gets the API key for the account specified

Function Declaration

public function login($email, $password);

Example Code

$textplode = new Textplode();
$email = $_POST['email'];
$password = sha1($_POST['password']); /* Password must be SHA-1 hashed */
$api_key = $textplode->account->login($email, $password);
$textplode = new Textplode($api_key);

Example Response

{"errors":{"errorCode":200,"errorMessage":"OK"},"version":"v3","data":{"api_key":"api_key"}}