Sei sulla pagina 1di 8

SwagBucks Extend

Version 1.0

API Documentation

© August 2009
Redondo Beach, CA
Methods

Name Literal Name Function Page

User Registration GetUserReg() Register a user 3

Authenticate a user
User Login
GetUserLogin() on the swagbucks 4
Authentication
network
Transfer Swag Bucks
Transfer Swag Bucks TransferTransaction() 5
between systems

Retrieve Swag Store


List Prizes ListingTransactions() 6
prizes

SwagBucks Extend // Version 1.0 2


User Registration

Function: GetUserReg()

Sample URL:
http://www.SwagBucks.com/?cmd=api-extend01&m=get-user-reg&fullname=Harry
Lucky&email=h@h.com&password=xud&country=usa&state=IL&zip=60619&yob=1959&apik=jjf09
d7d787dkl3k4

Parameters:
Name Type Literal Required? Default Notes
API Method String 'm' Yes N/A API Method Name
Full Name String 'fullname' Yes N/A Fist Last
Email Address String 'email' Yes N/A Must be valid 'x@y.zzz'
Password String 'password' Yes N/A Cannot be blank
Country String 'country' Yes N/A Approved List
State String 'state' Yes N/A Approved List
Zip Code String 'zip' Yes N/A Cannot be blank
Year of Birth Numeric 'yob' Yes N/A Full Year YYYY
API Key String 'apik' Yes N/A Assigned by Prodege

Returns:
Notes
XML Results Success returns non-zero member id assigned to new
member.

<member id="656233" />


Failure returns member with zero id and body error
message.

<member id="0">
'email' is empty, invalid or already exists in our
system.
</member>

SwagBucks Extend // Version 1.0 3


User Login Authentication

Function: GetUserLogin()

Sample URL:
http://www.SwagBucks.com/?cmd=api-extend01&m=get-user-
login&email=harry@harry.com&password=barky&apik=jjf09d7d787dkl3k4

Parameters:
Name Type Literal Required? Default Notes
API Method String 'm' Yes N/A API Method Name
Email Address String 'email' Yes N/A Must be valid 'x@y.zzz'
Password String 'password' Yes N/A Cannot be blank
API Key String 'apik' Yes N/A Assigned by Prodege

Returns:
Notes
XML Results Success returns non-zero member id of
authenticated member.

<member id="656233" />


Failure returns member with zero id and body error
message.

<member id="0">
'email' or 'password' not found.
</member>

SwagBucks Extend // Version 1.0 4


Transfer Swag Bucks

Function: TransferTransaction()

Sample URL:
http://www.SwagBucks.com/?cmd=api-extend01&m=transfer-
trans&amount=100&memberid=656233&typeid=2&apik=jjf09d7d787dkl3k4

Parameters:
Name Type Literal Required? Default Notes
API Method String 'm' Yes N/A API Method Name
Amount Numeric 'amount' Yes 0 Must be valid number …
Positive or Negative.
Member ID Numeric 'memberid' Yes 0 Must be valid member ID
Type ID Numeric 'typeid' No N/A Assigned by Prodege
API Key String 'apik' Yes N/A Assigned by Prodege

Returns:
Notes
XML Results Success returns non-zero member id of
authenticated member.

<transfer result="true"/>
Failure returns member with zero id and body
error message.

<transfer result="false">
'memberid' not valid.
</transfer

SwagBucks Extend // Version 1.0 5


List Prizes

Function: ListingTransaction()

Sample URL:
http://www.SwagBucks.com/?cmd=api-extend01&m=listing-
trans&page=1&ppp=1&sort=0catid=-999&allcat=1&apik=jjf09d7d787dkl3k4

Parameters:
Name Type Literal Required? Default Notes
API Method String 'm' Yes N/A API Method Name
Page Numeric 'page' No 1 Must be within range of
available product
pages.
Products Per Page Numeric 'ppp' No 6 Maximum is 10
Sort Numeric 'sort' No 0 0 = ascending
swagbucks, 1 =
decending swagbucks,
or 2 = by name
Category ID Numeric 'catid' No -999 -999 is All Categories
Display Categories Numeric 'allcat' No 0 Zero = No, Other = All
API Key String 'apik' Yes N/A Assigned by Prodege

<See Next Page>

SwagBucks Extend // Version 1.0 6


Returns:
Notes
XML Results Single Item <response>
<products count="509" currentPage="1"
totalPages="509">
<product Id="2850">
<name>Greg Bennett Guitar Swagstakes
Entry</name>
<description>
This is your chance to earn a BEAUTIFUL Greg
Bennett design guitar!
</description>
<variables type="">
<variable Id="4896" Name="" Cost="1"/>
</variables>
</product>
</products>
<categories>
<category id="5" parentCategoryId="0">MP3
Singles & Albums</category>
<category id="158" parentCategoryId="0">Swap
Video Games</category>
<category id="126" parentCategoryId="0">Airline
Miles</category>
<category id="233"
parentCategoryId="158">GameCube</category>
</categories>
</response>
XML Results Multiple Items <response>
<products count="509" currentPage="1"
totalPages="509">
<product Id="2850">
<name>Greg Bennett Guitar Swagstakes
Entry</name>
<description>
This is your chance to earn a BEAUTIFUL Greg
Bennett design guitar!
</description>
<variables type="">
<variable Id="4896" Name="" Cost="1"/>
</variables>
</product>
<product Id="2543">
<name>100 Swag Bucks Swagstakes Entry</name>
<description>A slender mahogany body generates
tons of rich low-mid warmth and power.
</description>
<variables type="">
<variable Id="4448" Name="" Cost="1"/>
</variables>
</product>
</products>
<categories>
<category id="5" parentCategoryId="0">MP3
Singles & Albums</category>
<category id="158" parentCategoryId="0">Swap

SwagBucks Extend // Version 1.0 7


Video Games</category>
<category id="126" parentCategoryId="0">Airline
Miles</category>
<category id="233"
parentCategoryId="158">GameCube</category>
</categories>
</response>
Failure returns response with products with zero
productCount and body error message.
<response>
<products productCount="0">
'apiu', 'apip', and 'apik' must have valid values and
be used from an approved IP Address.
</products>
</response>

SwagBucks Extend // Version 1.0 8

Potrebbero piacerti anche