POST badges/award
Awards a badget to a user
URL:
http://www.mobileroadie.com/api/badges/award
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.
-
-
device_id
-
Required. The id of the user/device.
-
-
badge_id
-
Required. The id of of badge.
-
-
earned
-
Optional. The date/time the badge was earned, formatted as YYYY-MM-DD hh:mm:ss.
-
Usage Example
<?php $data = array( 'secret' => 'your_secret_key', 'device_id' => 123456789, 'badge_id' => 123, 'earned' => '2011-11-29 12:00:00' ); $handle = curl_init("https://mobileroadie.com/api/badges/award/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>1234567890</id> </xml>
Response when Missing Required Fields
<xml> <error>Missing [FieldName1].</error> </xml>
Comments
0 comments
Please sign in to leave a comment.