POST comments/create
Create a comment
URL:
http://www.mobileroadie.com/api/comments/create
Formats
XML, JSON, HTML
Requirements
SSL, API Secret, White-Listed IP Address
HTTP Method(s):
POST
URL Parameter(s):
-
key
-
Required
-
POST Parameters:
-
secret
-
Required.
-
-
type
-
Required. The content section to post the comment to. Available types provided by comments/getTypes
-
-
body
-
Required. The text of the comment.
-
-
nickname
-
Username of the comment poster.
-
-
profile_image
-
URL of profile image of the comment poster. Image will be auto-cropped to 50px by 50px.
-
-
parent_id
-
Required. ID of the parent thread. You can Default this to 0.
-
-
item_id
-
Required for all types except fanwall. ID of the content item the comment is in reference to.
-
Usage Example
<?php $data = array( 'secret' => 'your_secret_key', 'type' => 'fanwall', 'body' => 'I love this app!', 'nickname' => 'moro', 'profile_image' => 'http://mobileroadie.com/img/default-image.png', 'parent_id' => '0', 'item_id' => '' ); $handle = curl_init("https://mobileroadie.com/api/comments/create/key/4d4ba30d73b77f7"); curl_setopt($handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($handle, CURLOPT_POST, true); curl_setopt($handle, CURLOPT_POSTFIELDS, $data); $response = curl_exec($handle); curl_close($handle); ?>
Success Response
<xml> <id></id> </xml>
NOTE: Presently there is a bug where a fanwall post will not return back a comment ID. However, the comment will still be posted. We hope to have this fixed shorty.
Response when Missing Required Fields
<xml> <error>[FieldName1] is required. [FieldNameX] is required.</error> </xml>
Comments
0 comments
Please sign in to leave a comment.