POST badges/create
Create a custom badge
URL:
http://mobileroadie.com/api/badges/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.
-
-
title
-
Required. The name of the badge.
-
-
description
-
Optional. A description of how the badge is earned.
-
-
imgurl
-
Optional. URL for the badge image.
-
-
url
-
Optional. URL that user is directed to after earning the badge. This is typically a link to a video or coupon.
-
Usage Example
<?php $data = array( 'secret' => 'your_secret_key', 'title' => 'Super Badge', 'description' => 'Earn this badge by...', 'imgurl' => 'http://cdn.mblrd.com/i/1-1/ca/aHR0cDovL2dzMy5tYmxyZC5jb20vQmFkZ2VzL3NldHMvY2xhc3NpYy9TaWx2ZXIvQmFkZ2VMYXJnZUAyeF9FYXJCdWQucG5n', 'url' => 'http://mobileroadie.com/', ); $handle = curl_init("https://mobileroadie.com/api/badges/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>1234567890</id> </xml>
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.