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
| Parameter | Possible Values | Purpose | Default | |
| submit | account.create.new | | | Required |
| email | | Email address is used as account login. | | Required |
| password | | Six characters minimum and must contain at least one number. | | Required |
| first_name | | Initial author name will be created from your first & last name. Additional pen names can be added after your account is created. | | Required |
| last_name | | | | Required |
| middle_name | | | | |
| address1 | | Mailing address. | | Required |
| address2 | | | | |
| city | | City name. | | Required |
| state | | Account owner's Province or State name. | | Required |
| zip | | Postal or Zip code | | Required |
| country | | | | Required |
| phone | | | | Required |
| fax | | | | |
| business | | Account owner's business name. | | |
| url | | Account owner's web site url. | | Required |
| referrer | | Application name or web site url used to create this account. | | Required |
| newsletter_subscribe | true, false | To Subscribe To The Weekly/Periodic EzineArticles Newsletter | true | |
| training_series_subscribe | true, false | To Subscribe To The EzineArticles 12+ Part Email-Based Training Series | true | |
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.
| Code | Meaning |
| 200 | The request was successful. This code will accompany a response from the API. |
| 404 | No results found. This code will accompany a message explaining that no results were found for your request. |
| 400 | The request was invalid. This code will also be sent if you have exceeded your maximum hourly requests or your API Key is invalid. |
| 500 | The API is experiencing a problem unrelated to your request that prevents it being performed at this time. |