EzineArticles API

EzineArticles API - Submit Article

The EzineArticles API provides the ability to submit new articles or update existing articles associated with your account. In order to submit or update articles you must have an EzineArticles Membership Account. For more information on creating an account, please refer to New Account Creation section of the API documentation or visit http://EzineArticles.com/submit/.

« Return to API home

Parameters for Article Submission

This method requires Member Authentication.

ParameterPossible ValuesPurposeLimits
submitRequired
submit »account.article.newTo indicate a submission of the new article.
submit »account.article.updateTo indicate an update of the existing article.
article_idThe unique ID assigned to an article.*
titleTitle of the article.10-100 charactersRequired
authorTo indicate the author of the article. Must be a valid author name listed on the account. If an author name is not provided, the account's primary author name will be used.
coauthorTo indicate the optional co-author of the article. Must be a valid author name listed on the account.
categoryTo indicate which category the article should be listed under. See Categories Search for more information.Required
subcategoryTo indicate which subcategory the article should be listed under.
summarySummary of the article.10-200 wordsRequired
keywordsKeywords describing the article.Required
bodyBody of the article.400-5000 wordsRequired
signatureAuthor Signature. If none provided, account's default signature will be used. If no default signature found on your account, an error will be returned.10-300 words
emailThe email address for an EzineArticles Membership Account (Used to login to their Membership Account).Required
passEzineArticles member's password associated with the email.Required
validate_onlytrue/noneSet this parameter if you would like to test your submission without actually submitting an article for review.Required
Schedule Release Of This Article
This feature is for Premium Membership level authors. It allows your article, once approved, to be scheduled to appear on EzineArticles.com on the specified date. Find out how to become a Premium Membership Level Author.
publish_dateM-D-YYYY:H

M - Represents Month on which your article should be released.


D - Represents Day on which your article should be released.

YYYY - Represents Year on which your article should be released.

H - Represents Hour on which your article should be released.

1 through 12. This value should never exceed more than four(4) months from now.

1 through 31.


A four digit representation of a year. Eg: 2009.

1 through 24. 24-Hour clock format.

Note: Publishing time is Central Standard Time (America/Chicago -6 GMT)

* article_id is Required with account.article.update method.

New Article Submission Example

Using PHP:
<?php

$data['submit'] = 'account.article.new';
$data['response_format'] = 'xml';
$data['key'] = '{your api key}';
$data['email'] = '{email address}';
$data['pass'] = '{password}';

$data['title'] = '{article title}';
$data['author'] = '{article author}';
$data['category'] = '{article category}';
$data['subcategory'] = '{article subcategory}';
$data['summary'] = '{article summary}';
$data['keywords'] = '{article keywords}';
$data['body'] = '{article body}';
$data['signature'] = '{article signature}';


//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>Article has been submitted.</success>
<article_id>1895683</article_id>
<response_info>
<time>2008-08-27 16:36:49</time>
<status>200</status>
<submit>account.article.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.