EzineArticles API

EzineArticles API - Create A New Account

The new account creation API method allows you to create new account and become an EzineArticles Expert Author.

« Return to API home

Parameters for New Account Creation

ParameterPossible ValuesPurposeDefault
submitaccount.create.newRequired
emailEmail address is used as account login.Required
passwordSix characters minimum and must contain at least one number.Required
first_nameInitial author name will be created from your first & last name. Additional pen names can be added after your account is created.Required
last_nameRequired
middle_name
address1Mailing address.Required
address2
cityCity name.Required
stateAccount owner's Province or State name.Required
zipPostal or Zip codeRequired
countryRequired
phoneRequired
fax
businessAccount owner's business name.
urlAccount owner's web site url.Required
referrerApplication name or web site url used to create this account.Required
newsletter_subscribetrue, falseTo Subscribe To The Weekly/Periodic EzineArticles Newslettertrue
training_series_subscribetrue, falseTo Subscribe To The EzineArticles 12+ Part Email-Based Training Seriestrue

New Account Creation Example

Using PHP:

<?php

$data['submit'] = 'account.create.new';
$data['key'] = '{your api key}';
$data['response_format'] = 'xml';

$data['email'] = '{email address}';
$data['password'] = '{password}';
$data['first_name'] = '{first name}';
$data['last_name'] = '{last name}';
$data['address1'] = '{address}';
$data['city'] = '{city}';
$data['state'] = '{state}';
$data['zip'] = '{postal/zip code}';
$data['country'] = '{country}';
$data['phone'] = '{phone}';
$data['business'] = '{business name}';
$data['url'] = '{web url address}';
$data['referrer'] = '{api application name}';


//traverse array and prepare data for posting (key1=value1)
foreach ( $data as $key => $value) {
  $post_items[] = $key . '=' . $value;
}

//create the final string to be posted using implode()
$post_string = implode ('&', $post_items);


//create cURL connection
$curl_connection = curl_init('http://api.ezinearticles.com/api.php');


//set options
curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($curl_connection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl_connection, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl_connection, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl_connection, CURLOPT_HTTPHEADER, array("Expect:"));


//set data to be posted
curl_setopt($curl_connection, CURLOPT_POSTFIELDS, $post_string);


//perform our request
$result = curl_exec($curl_connection);


//API response information
$response = curl_multi_getcontent($curl_connection);


//close the connection
curl_close($curl_connection);


?>

If above submit is successful, the API will return something similar to this:

<ezinearticles_api_response>
<success>New account has been created.</success>
<account_id>143256</account_id>
<response_info>
<time>2008-08-27 16:36:49</time>
<status>200</status>
<submit>account.create.new</submit>
<format>xml</format>
</response_info>
</ezinearticles_api_response>

Response Status Codes

If there is a problem with your API request, an error message will be shown in the format specified by the response_format parameter or in plain text if that parameter is missing.

CodeMeaning
200The request was successful. This code will accompany a response from the API.
404No results found. This code will accompany a message explaining that no results were found for your request.
400The request was invalid. This code will also be sent if you have exceeded your maximum hourly requests or your API Key is invalid.
500The API is experiencing a problem unrelated to your request that prevents it being performed at this time.