The Blog API endpoint/url is configurable by website. Typically the endpoint is:
Before you can make a call to the API, you must first configure an API key. API keys in the crm can be configured under Blog -> Settings -> API.
Each key can consists of the API key code, a reference name, active state, and when published assignment.
|key||Y||The appropriate Blog API Key|
|ip||Y||source ip address of the user submitting, configurable for pass through|
|author_id||Y||Author to be used on the Blog post record|
|post||Y||The post to be sent.|
|post_title||Y||the post title.|
The Blog API will return a text based result with a HTTP status code of 200.
The text result can be interpreted for either a pass or fail. Successful contact creation will yield a string result of "true". If there was an error "false" will be ouptutted. If there is an error message available, there will be a newline character after "false" where the second line will contain the error message/detail.
If a fail message is generated with no verbose error message/detail to the API call, an email with the error details will be generated to the site_email address for the website ( configurable under Settings ). Situations that will yield an error email to site_email address will typically be an incorrect API key.
curl -XPOST http://www.yourdomain.com/blog.php?api \ -d "key=testkey" \ -d "ip=127.0.0.1" \ -d "author_id=2179" \ -d "post=This is a really cool blog post about nothing." \ -d "post_title=this is the title of our blog post." \
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.yourdomain.com/crm.php?api'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array( 'key' => 'testkey', 'ip' => '127.0.0.1', 'author_id' => '2179', 'post' => 'This is a really cool blog post about nothing.', 'post_title' => 'this is the title of our blog post.', )); $result = curl_exec($ch); curl_close($ch);