v 1.5


 

1. Introduction 

Social Media Connector APIs are REST based. The API can be easily consumed by any client that can send HTTP GET and POST requests.

How to test the API simply using browser? 

Social Media Connector APIs are REST based and it use two HTTP verbs including GET and POST. The get request can be tested from by using the address bar any browser. Testing the post request is bit tricky but there are free open source applications like Curl and Fiddler to test the POST request.  For testing the API on windows platform Fiddler is recommended tool.

Please note in few days we will provide online link for Join in Partners for testing…

 

Figure 1 Fiddler Post Request.

Follow the steps below to send a POST request to Social Dolphin API using Fiddler.


 

 

2. API Detail

2.1 Provider Authentication

Every API call needs an access token. To get an access token a user needs to authenticate first.

 

URL

/provider/GetAuthenticate?username={username}&password={password}

Request Type

GET

Parameters

Required Parameters

username: User name of the user

password: Password of the user

Request Body

N/A

JSON Result 

{

   “Data”:

   {

      “access_token”:””, // A valid access token

      “Id”: ,          // user id 

      “ticks”: ,      // No of seconds the access token is valid till.

      “username”:”” , // Username of the user

      “displayname”:””

   }

   Message:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <access_token></access_token>

 <id></id>

 <ticks></ticks>

 <username> </username>

<displayname></ displayname>

</Data>

<Message></Message>

Example

 

Request

/provider/GetAuthenticate?username=peter&password=123456

Request Body

N/A

JSON Result

{

   “Data”:

   {

      “access_token”: "ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      “id”: 7,

      “ticks”: 6000,

      “username”: "peter",

      “displayname”:”Peter Nilson”

   }

   “Message”: null

}

XML  Result

<Data>

 <access_token>ca4e0bdf-1e29-4f54-b015-49351bc8a0ae</access_token>

 <id>7</id>

 <ticks>6000</ticks>

 <username>peter</username>

<displayname>Peter Nilson</ displayname>

</Data>

<Message></message>

Comments:

It returns the given information if the user is  authenticated, if not error message is returned.

 

2.2 Register a Game Provider

This API allows registering of a new games provider. Each game provider will have their own account and they can use their account detail to login and add new game e.g. Carlow-IT, Valentia.

URL

/Provider/PostAddGameProvider

Request Type

POST

Parameters

Required Parameters

username:

password:

access_token: A valid access token

Request Body

{

      "access_token":"",

      "Data":

      {     

          "name": "",        // Name of the Provider

          "username": "",    // User name for the Provider

          "password": "",    // Password of the Provider

         "description": ""  // Description of the Provider

      }

}

JSON Result

{

  "Data":

  {

                  "id":    // Returns ID  of the newly registered provider

  },

  "Message": “”      // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id></id>

</Data>

<Message></Message>

Example:

Request

/Provider/PostAddGameProvider

Request Body

{

      "access_token":"ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      "Data":

      {     

          "name": "Peter Nilson",     

          "username": "peter",  

          "password": "password",

          "description": "This is some description about the provider"

      }

}

JSON Result

{

  "Data":

  {

                  "id":20

  },

  "Message":null

}

XML  Result

<Data>

 <id>20</id>

</Data>

<Message></Message>

 

2.3 Register a Game

This API allows game providers to register a new game e.g. Bubble Break, Walking Game.

URL

/Games/PostAddGame

Request Type

POST

Parameters

Required Parameters

name: game name

access_token: A valid access token

provider_id: provider of the game

Request Body

{

      "access_token":"",

      "Data":

      { "name": "",        // Name of the game

          "redirect_url": "",    //url of the game

          "provider_id": "",    //id of the game provider

          "Active": "",      // Is game  active 

          "description": ""  // Description of the game,

    “maxplayers”:

      }

}

JSON Result

{

  "Data":

  {

                  "id":    // Returns ID of the new game

  },

  "Message":””       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id></id>

</Data>

<Message></Message>

Example:

Request

/Games/PostAddGame

Request Body

{

      "access_token":"ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      "data":

      {

          "name": "My Game",     

          "redirect_url": "http://mygamedomain.com",  

          "provider_id": 20,

          "active": 1,       

          "description": "This is some description about the game"

“maxplayers”:4

 

      }

}

JSON Result

{

  "Data":

  {

                  "id":20

  },

  "Message":null

}

XML  Result

<Data>

 <id>20</id>

</Data>

<Message></Message>

Comments:

 

 

 

2.4 List Games

This API allows listing all games.

URL

/Games/GetGameList?access_token={access_token}

Request Type

Get

Parameters

Required Parameters

access_token: A valid access token

 

Request Body

N/A

JSON Result

{

  "Data":

  [{

                  "id":,    // Id of the game

                  "name":"",    // name of the game

                  "description":"",   // description of the game

                  "redirect_url":"", 

                    "provider_id": ,

                    "active": ,

                     “maxplayers”:       

  }],

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id></id>

 <name></name>

 <description></description>

 <redirect_url></redirect_url>

 <provider_id></provider_id>

 <Active></Active>

<maxplayers> </maxplayers>

<Data>

.

.

<Message></Message>

Example:

Request

/Games/GetGameList?access_token=ca4e0bdf-1e29-4f54-b015-49351bc8a0ae

Request Body

N/A

JSON Result

{

  "Data":

  [{

                  "id":20,    // Id of the game

                  "name":"My game" ,   // name of the game

                  "description":"this is game description",   // description of the game

                  "redirect_url":"http://gamedomain.com" ,

                    "provider_id": 11,

                    "Active": 1,

                     “maxplayers”:5 

  }],

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<data>

 <id>20</id>

 <name>My Game</name>

 <description>this is game description</description>

 <redirect_url>http://gamedomain.com</redirect_url>

 <provider_id>11</provider_id>

 <Active>1</Active>

<maxplayers>5</maxplayers>

</data>

<message></message>

Comments

Returns list of games as array of objects

 

2.5 Play Game

 

URL

/Games/GetPalyGame?gameid={gameid}&access_token={access_token}

Request Type

Get

Parameters

Required Parameters

access_token: A valid access token

 

Request Body

N/A

JSON Result

{

  "Data":

  {

                  "text":""    // URL of the game

  },

  "Message":””       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <text></text>

<Data>

<Message></Message>

Example:

Request

/Games/GetPalyGame?gameid=20&access_token=ca4e0bdf-1e29-4f54-b015-49351bc8a0ae

Request Body

N/A

JSON Result

{

  "Data":

  [{

                  "text":”http://myurlofgame.com”    // URL of the game

  }],

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <text> http://myurlofgame.com </text>

</Data>

<Message></Message>

Comments

Returns URL of the game

 

 

 

2.6 Add a Game Player

This API allows registration of a new player.

URL

/Player/PostAddGamePlayer

Request Type

POST

Parameters

Required Parameters

username:

password:

access_token: A valid access token

Request Body

{

 "access_token": "f3f7d6ae-e696-11e1-a3a5-001cc0f96fb6",

    "data": {

        "name": "",

        "email": "",

        "username": "",

        "password": "",

        "photo": "",

        "game_tag": "",

      

        "active":,

       

        "profileoptions": [{

            "profilekey": "",

            "profilevalue": "",

            "profileaccess": ""

        }]

     

    }

  

}

JSON Result

{

  "Data":

  {

                  "id":   // Returns ID of the player

  },

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id></id>

</Data>

<Message></Message>

Example:

Request

/Player/PostAddGamePlayer

Request Body

{

 "access_token": "f3f7d6ae-e696-11e1-a3a5-001cc0f96fb6",

    "data": {

        "id": 0,

        "name": "Peter Nilson",

        "email": "peter@my.web.pk",

        "username": "peter123",

        "password": "1234567",

        "photo": "http://peter.com",

        "game_tag": "adventure",

      

        "active":1,

       

        "profileoptions": [{

            "profilekey": "description",

            "profilevalue": "my Description",

            "profileaccess": "-2"

        }]

     

    }

  

}

JSON Result

{

  "Data":

  {

                  "id":20

  },

  "Message":null

}

XML  Result

<Data>

 <id>20</id>

</Data>

<Message></Message>

Comments

Possible profile keys for profile  options.

  'description',

      'briefdescription',

      'location',

      'interests',

      'skills',

      'contactemail',

      'phone',

      'mobile',

      'website',

      'twitter'

 

2.7 Player Authentication

Every API call needs an access token. To get an access token a user needs to authenticate first.

URL

/player/GetAuthenticate?username={username}&password={password}

Request Type

GET

Parameters

Required Parameters

username: User name of the user

password: password of the user

Request Body

N/A

JSON Result

{

   Data:

   {

      “access_token”:””, // A valid access token

      “id”: ,          // user id 

      “ticks”: ,      // No of seconds the access token is                valid till.

      “username”:”” ,  // Username of the user

      “displayname”:””

   }

   Message:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <access_token></access_token>

 <id></id>

 <ticks></ticks>

 <username> </username>

<displayname></ displayname>

</Data>

<Message></Message>

Example

 

Request

/provider/GetAuthenticate?username=peter&password=123456

Request Body

N/A

JSON Result

{

   data:

   {

      “access_token": "ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      “id”: 7,

      “ticks”: 6000,

      “username”: "peter",

      “displayname”:”Peter Nilson”

   }

   Message: null

}

XML  Result

<Data>

 <access_token>ca4e0bdf-1e29-4f54-b015-49351bc8a0ae</access_token>

 <id>7</id>

 <ticks>6000</ticks>

 <username>peter</username>

<displayname>Peter Nilson</ displayname>

</Data>

<Message></message>

Comments:

It returns the given information if the user is authenticated, if not error message is returned.

 

2.8 Player List

Every API call needs an access token. To get an access token a user needs to authenticate first.

URL

/player/GetPlayerlist?access_token={access_token}

Request Type

GET

Parameters

N/A

Request Body

N/A

JSON Result

{

   Data:

   [{

      “id”: ,          // user id 

      “email”:”” ,     

     “name”:””,

      “username”:”” ,  // Username of the user

    }]

   “Message”:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <id></id>

<email></email>

 <username> </username>

<name></name>

</Data>

.

.

<Message></Message>

Example

 

Request

/provider/GetAuthenticate?username=peter&password=123456

Request Body

N/A

JSON Result

{

   data:

   [{

      “id”:7,

      “email”: “peter@my.web.pk”,

      username: "peter",

      name:”Peter Nilson”

   }]

   Message: null

}

XML  Result

<Data>

<id>7</id>

 <email>peter@my.web.pk</ticks>

 <username>peter</username>

<name>Peter Nilson</name>

</Data>

.

.

<Message></message>

Comments:

It returns the given information if the user is authenticated, if not error message is returned.

 

2.9 Get a Player

Every API call needs an access token. To get an access token a user needs to authenticate first.

URL

/player/GetPlayerInfo?access_token={access_token}&playerid={playerid}

Request Type

GET

Parameters

Playerid:

Request Body

N/A

JSON Result

{

   Data:

  {

      “id”: ,          // user id 

      “email”:”” ,     

     “name”:””,

      “username”:”” ,  // Username of the user

     “profileoptions”:{

         [

          “profilekey”:””,

          “profilevalue”:””,

          “profileaccess”:

         ]

      }

    }

   “Message”:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <id></id>

<email></email>

 <username> </username>

<name></name>

<profileoptions>

<profilekey></profilekey>

<profilevalue><profilevalue>

<profileaccess></profileaccess>

</profileoptions>

</Data>

<Message></Message>

Example

 

Request

/player/GetPlayerInfo?access_token= ca4e0bdf-1e29-4f54-b015-49351bc8a0ae&playerid=43

Request Body

N/A

JSON Result

{

   data:

   {

      “id”:7,

      “email”: “peter@my.web.pk”,

      username: "peter",

      name:”Peter Nilson”,

     “profileoptions”:{

         [

          “profilekey”:””,

          “profilevalue”:””,

          “profileaccess”:

         ]

      }

   }

   Message: null

}

XML  Result

<Data>

<id>7</id>

 <email>peter@my.web.pk</ticks>

 <username>peter</username>

<name>Peter Nilson</name>

<profileoptions>

<profilekey></profilekey>

<profilevalue><profilevalue>

<profileaccess></profileaccess>

</profileoptions>

.

.

</Data>

<Message></message>

Comments:

It returns the given information if the user is authenticated, if not error message is returned.

 

 

2.10 Add contact for a Player

This API allows registration of a contact of a player e.g. son, daughter, colleague etc.

URL

/player/PostAddContact

Request Type

POST

Parameters

 

Request Body

 

{ "access_token": "",

    "Data": {

        "contactid": ,         //0 for new contact

        "ProfileID": ,         // Id of the payer

        "elggentityid": ,      //if contact is elgg user

        "relationshipid": , //1---Friend, 2---Family Member,3---Contact

        "groups": “",          // comma separated group Ids

        "contactname": "",

        "address":"",

        "phone1":"",

        "phone2":"",

        "skype1":"",

        "skype2":"",

        "mobile1":"",

        "mobile2":"",

        "email1" :" ",

        "email2" :" ",

        "other1":"",

        "other2":""

 

       }

}

JSON Result

{

  "Data":

  {

                  "id":""    // Returns ID of the contact

  },

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id></id>

</Data>

<Message></Message>

Example:

Request

/player/PostAddContact

Request Body

 

{ "access_token": "a4259ae4-f818-11e1-a64c-001cc0f96fb6",

    "data": {

        "contactid": 0,

        "ProfileID": 55,

        "elggentityid": 0,

        "relationshipid": 1,

        "groups": "1,2,3",

        "contactname": "nawaz",

        "address":"my Own Address",

        "phone1":"232323232",

        "phone2":"4444444444",

        "skype1":"nawazhi",

        "skype2":"nawazhi222",

        "mobile1":"0003333",

        "mobile2":"00044444",

        "email1" :"email1@exm.com",

        "email2" :"email1@exm.com",

        "other1":"other11111111",

        "other2":"other22222222"

 

       }

}

JSON Result

{

  "Data":

  {

                  "id":20

  },

  "Message":null

}

XML  Result

<Data>

 <id>20</id>

</Data>

<Message></Message>

 

2.11 List online/offline status

This API allows listing of player’s online/offline status.

URL

/player/GetOnlineStatus?access_token={access_token}&playerid={playerid}&showfriends={showfriends}&status={status}

Request Type

Get

Parameters

Required Parameters

access_token: A valid access token

Optional Parameter

showfriends: whether show only friend

status: status of the players to show

playerid: id of the player

Request Body

N/A

JSON Result

{

  "Data":

  [{

                  "id":"",    // userid

                  "name":"",    // display name of user

                     "username": "",

                      "onlinestatus":  // online status of the user “1” for offline and “false” for online

  }],

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id></id>

 <name></name>

  <username></username>

 < onlinestatus ></ onlinestatus >

</Data>

.

.

<Message></Message>

Example:

Request

/player/GetOnlineStatus?access_token= ca4e0bdf-1e29-4f54-b015-49351bc8a0ae &playerid=20&showfriends=1&status=1

Request Body

N/A

JSON Result

{

  "data":

  [{

                  "id":20,    // userid

                  "name":"Peter Nilson",    // display name of user

                     "username": "Peter",

                      "onlinstatus": 1 // online status of the user “1” for offline and “false” for online

  }],

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id>20</id>

 <name>peter nilson</name>

<username>peter</username>

 < onlinstatus >true</ onlinstatus >

</Data>

.

.

<Message></Message>

Comments

Returns list of  users as array of data

 

 

 

2.12 Add player’s interested games

This API allows adding player game preference for example what games they would like to play e.g. Bubble Breaker game etc.

URL

/player/PostInterestedgame

Request Type

POST

Parameters

Required Parameters

playerId:

access_token: A valid access token

gameid:

Request Body

{

      "access_token":"",

      "Data":

      {  "playerid":, 

          "gameid":         

      }

}

JSON Result

{

  "Data":

     [{ 

        "playerid":, 

        "gameid":      

      }]

 

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <playerid></playerid>

 <gameid></gameid>

</Data>

<Message></Message>

Example:

Request

/player/ PostInterestedgame

Request Body

{

      "access_token":"ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      "Data":

      {     

          "playerid": 20,     

          "gameid": 22

      }

}

JSON Result

{

   "Data":

   {     

      "playerid": "20",     

      "gameid": "22"

   },

  "Message":null

}

XML  Result

<Data>

 <player_id>20</player_id>

 <game_id>22</game_id>

</Data>

<Message></Message>

Comments:

 

 

2.13 Add player’s Game Metrics Data

This API allows adding player game preference for example what games they would like to play e.g. Bubble Breaker game etc.

URL

/player/PostAddMetrics

Request Type

POST

Parameters

Required Parameters

playerId:

access_token: A valid access token

gameid:

gamemetrics:

Request Body

{

      "access_token":"",

      "data":

      {  "playerid":, 

          "gameid":,

           “gamemetrics”:””      

      }

}

JSON Result

{

  "Data":

     { 

        "id"://Id of the player whose metrics has been just added

      }

 

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id></id>

</Data>

<Message></Message>

Example:

Request

/player/ PostAddMetrics

Request Body

{

      "access_token":"ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      "Data":

      {     

          "playerid": 20,     

          "gameid": 22,

          “gamemetrics”:”metrics data”      

 

      }

}

JSON Result

{

   "Data":

   {     

      "id":20     

   },

  "Message":null

}

XML  Result

<Data>

 <id>20</id>

 </Data>

<Message></Message>

Comments:

 

2.13 Register ELGG user as Player

This API allows registering elgg users which are not registered as game players.

URL

/player/PostRegisterAsPlayer

Request Type

POST

Parameters

Required Parameters

playerId:

access_token: A valid access token

 

Request Body

{

      "access_token":"",

      "data":

      {  "id":

         

}

JSON Result

{

  "Data":

     { 

        "id"://Id of the player whose metrics has been just added

      }

 

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id></id>

</Data>

<Message></Message>

Example:

Request

/player/PostRegisterAsPlayer

Request Body

{

      "access_token":"ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      "Data":

      {     

          "id": 20

      }

}

JSON Result

{

   "Data":

   {     

      "id":20     

   },

  "Message":null

}

XML  Result

<Data>

 <id>20</id>

 </Data>

<Message></Message>

Comments:

 

           

2.14 List a Player’s Profile Images URL

Every API call needs an access token. To get an access token a user needs to authenticate first.

URL

/player/GetProfileImages?access_token={access_token}&playerid={playerid}

Request Type

GET

Parameters

Playerid:

Request Body

N/A

JSON Result

{

   Data:

  [{

      “imagetype”: ,          // user id 

      “image”:””

 }]

}

   “Message”:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <imagetype></imagetype>

<image></image>

.

.

</Data>

<Message></Message>

Example

 

Request

/player/ GetProfileImages?access_token= ca4e0bdf-1e29-4f54-b015-49351bc8a0ae&playerid=43

Request Body

N/A

JSON Result

{

   data:

 [  {

      “imagetype”:”small”,

      “image”: “http://mydomain.com/image.jpg”

   }]

   Message: null

}

XML  Result

<Data>

<imagetype>small</imagetype >

 <image> http://mydomain.com/image.jpg</image>

.

.

</Data>

<Message></message>

Comments:

It returns the given information if the user is authenticated, if not error message is returned.

 

 

2.15 List a Player’s Profile Images

Every API call needs an access token. To get an access token a user needs to authenticate first.

URL

/player/GetProfileImagesBinary?access_token={access_token}&playerid={playerid}

Request Type

GET

Parameters

Playerid:

Request Body

N/A

JSON Result

{

   Data:

  [{

      “imagetype”: ,          // user id 

      “image”:”” //base64 string of image

 }]

}

   “Message”:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <imagetype></imagetype>

<image></image>

.

.

</Data>

<Message></Message>

Example

 

Request

/player/GetProfileImagesBinary?access_token=ca4e0bdf-1e29-4f54-b015-49351bc8a0ae&playerid=43

Request Body

N/A

JSON Result

{

   data:

 [  {

      “imagetype”:”small”,

      “image”: “R0lGODlhGQAZAOYAAGxsbHV1dc3Nzc7OztDQ0NLS0nl5eX5+fnp6enx8fHJycs/Pz3R0dIKCgnd3d29vb3Z2doODg3FxcdTU1Hh4eHt7e9PT02VlZWNjY7e3t2BgYGZmZmhoaG1tbW5ubsvLy4uLi8fHx3BwcGRkZKSkpKqqqq2trZiYmIGBgZ2dnXNzc8DAwJqamrCwsMrKyl9fX729vYSEhImJicjIyMLCwqWlpb+/v4aGhoeHh5eXl11dXaysrNbW1tra2rS0tMXFxa+vr4+Pj8TExIyMjKenp7Ozs5CQkLm5uaCgoH9/f5GRkaurq5ycnJmZmdHR0YCAgGdnZ2lpaWJiYmpqasbGxmtra8zMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAZABkAAAf/gFaCg4SFhoeGAk5OBIyIj1ZOLkUkKTVHBAOQhU4wQ0+goCxWmpukITdJEaurCEgFppElFQ21tk8oNAubAgQnFaHBFS1OvAtKBgfKywcUS7CQiicQCdXWFQYZxZsFQBAI4OEUMR+lkAUtDBQG7OwBMrumTj4qEA739woyBLEENgEMAggMAOGBEWibBsxwIIKBw4BVWEyIFYmIAgkKMj4wsIKfKQELegSZIqFkFRA8Fgh4NKCABQIfMgQA8KAmAAgrFFkosJJQgRkmmOCYWcVDh6MeAIigACKFiV6DnGRQcOHChihVAGjdCmAKhw0jMKAoR8qFCgxT0qpdyzbtixwTRi2U0DAlit27ePPa3eAhxIIJMTRwgEK4sOHDhDm8IDEBBgYNUiJLnkx5so4AA5qMqMK5s+fPn6dc2PGDiunTqFOrpiKESiAAOw==”

   }]

   Message: null

}

XML  Result

<Data>

<imagetype>small</imagetype >

 <image> R0lGODlhGQAZAOYAAGxsbHV1dc3Nzc7OztDQ0NLS0nl5eX5+fnp6enx8fHJycs/Pz3R0dIKCgnd3d29vb3Z2doODg3FxcdTU1Hh4eHt7e9PT02VlZWNjY7e3t2BgYGZmZmhoaG1tbW5ubsvLy4uLi8fHx3BwcGRkZKSkpKqqqq2trZiYmIGBgZ2dnXNzc8DAwJqamrCwsMrKyl9fX729vYSEhImJicjIyMLCwqWlpb+/v4aGhoeHh5eXl11dXaysrNbW1tra2rS0tMXFxa+vr4+Pj8TExIyMjKenp7Ozs5CQkLm5uaCgoH9/f5GRkaurq5ycnJmZmdHR0YCAgGdnZ2lpaWJiYmpqasbGxmtra8zMzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAAAAAALAAAAAAZABkAAAf/gFaCg4SFhoeGAk5OBIyIj1ZOLkUkKTVHBAOQhU4wQ0+goCxWmpukITdJEaurCEgFppElFQ21tk8oNAubAgQnFaHBFS1OvAtKBgfKywcUS7CQiicQCdXWFQYZxZsFQBAI4OEUMR+lkAUtDBQG7OwBMrumTj4qEA739woyBLEENgEMAggMAOGBEWibBsxwIIKBw4BVWEyIFYmIAgkKMj4wsIKfKQELegSZIqFkFRA8Fgh4NKCABQIfMgQA8KAmAAgrFFkosJJQgRkmmOCYWcVDh6MeAIigACKFiV6DnGRQcOHChihVAGjdCmAKhw0jMKAoR8qFCgxT0qpdyzbtixwTRi2U0DAlit27ePPa3eAhxIIJMTRwgEK4sOHDhDm8IDEBBgYNUiJLnkx5so4AA5qMqMK5s+fPn6dc2PGDiunTqFOrpiKESiAAOw==

.

.

</Data>

<Message></message>

Comments:

It returns the given information if the user is authenticated, if not error message is returned.

 

 

 

2.16 Get a Player by Token

Every API call needs an access token. To get an access token a user needs to authenticate first.

URL

/player/GetPlayerInfoByToken?access_token={access_token}

Request Type

GET

Parameters

 

Request Body

N/A

JSON Result

{

   Data:

  {

      “id”: ,          // user id 

      “email”:”” ,     

     “name”:””,

      “username”:”” ,  // Username of the user

     “profileoptions”:{

         [

          “profilekey”:””,

          “profilevalue”:””,

          “profileaccess”:

         ]

      }

    }

   “Message”:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <id></id>

<email></email>

 <username> </username>

<name></name>

<profileoptions>

<profilekey></profilekey>

<profilevalue><profilevalue>

<profileaccess></profileaccess>

</profileoptions>

.

.

</Data>

<Message></Message>

Example

 

Request

/player/GetPlayerInfo?access_token= ca4e0bdf-1e29-4f54-b015-49351bc8a0ae

Request Body

N/A

JSON Result

{

   data:

   {

      “id”:7,

      “email”: “peter@my.web.pk”,

      username: "peter",

      name:”Peter Nilson”,

     “profileoptions”:{

         [

          “profilekey”:””,

          “profilevalue”:””,

          “profileaccess”:

         ]

      }

   }

   Message: null

}

XML  Result

<Data>

<id>7</id>

 <email>peter@my.web.pk</ticks>

 <username>peter</username>

<name>Peter Nilson</name>

<profileoptions>

<profilekey></profilekey>

<profilevalue><profilevalue>

<profileaccess></profileaccess>

</profileoptions>

.

.

</Data>

<Message></message>

Comments:

It returns the given information if the user is authenticated, if not error message is returned.

 

 

2.17 Manage Game Instance

This API allows adding and updating game instance.

URL

/GameInstance/PostManageGameInstance

Request Type

POST

Parameters

Required Parameters

access_token: A valid access token

gameid:

startdatetime:

Request Body

{

      "access_token":"",

      "data":

      {  "instanceid":,  // if passed will give update the record otherwise will create a new one

          “gameid”:

          "playerids":, // comma separated player Ids

           “startdatetime”:””    // in unix date time format    

      }

}

JSON Result

{

  "Data":

     { 

        "guid":””       //GUID of the new created Instance or the one updated

      }

 

  "Message":””       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <guid></guid>

</Data>

<Message></Message>

Example:

Request

/GameInstance/PostManageGameInstance

Request Body

{

      "access_token":"ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      "Data":

      {     

          "instanceid": “ca4e0bdf-1e29-4f54-b015-49351bc8a0ae”,     

          "gameid": 22,

          “playerids”:”2,3,55”,

          “startdatetime”:”1354712002”

 

      }

}

JSON Result

{

   "Data":

   {     

      "guid":”ca4e0bdf-1e29-4f54-b015-49351bc8a0ae”     

   },

  "Message":null

}

XML  Result

<Data>

 <guid>ca4e0bdf-1e29-4f54-b015-49351bc8a0ae</guid>

 </Data>

<Message></Message>

Comments:

If GUID is passed the Instance is updated and empty instance is passed then new is inserted.

2.18 Remove Game Instance

This API allows removing game instance.

URL

/GameInstance/PostDeleteGameInstance

Request Type

POST

Parameters

Required Parameters

access_token: A valid access token

instanceid

Request Body

{

      "access_token":"",

      "data":

      {  "guid":””        }

}

JSON Result

{

  "Data":

     { 

        "guid"://GUID of the deleted instance

      }

 

  "Message":       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <guid></guid>

</Data>

<Message></Message>

Example:

Request

/GameInstance/PostDeleteGameInstance

Request Body

{

      "access_token":"ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      "Data":

      {     

          "instanceid": “da4e0bdf-1e29-4f54-b015-49351bc8a0ae”     

 

      }

}

JSON Result

{

   "Data":

   {     

      "guid":”ca4e0bdf-1e29-4f54-b015-49351bc8a0ae”     

   },

  "Message":null

}

XML  Result

<Data>

 <guid>ca4e0bdf-1e29-4f54-b015-49351bc8a0ae</guid>

 </Data>

<Message></Message>

Comments:

The GUID of the instance passed is removed from the database

 

2.19 List of Game Instances

 

URL

/GameInstance/GetGameInstance?access_token={access_token}&playerid={playerid}&gameinstanceid=[ gameinstanceid]&action=[action]

Request Type

GET

Parameters

Playerid:

access_token:

gameinstanceid:

action:

Request Body

N/A

JSON Result

{

   Data:

  [{

      "instanceid": "",

      "gameid": ,

      "playerids": "",

      "startdatetime": "",

       “maxplayer”:,

       “gameurl”:””

 }]

}

   “Message”:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <instanceid></instanceid>

<gameid></gameid>

<playerids></playerids>

<startdatetime></startdatetime>

.<maxplayer>.</maxplayer>

<gameurl></gameurl>

.

.

</Data>

<Message></Message>

Example

 

Request

/GameInstance/GetGameInstance?access_token=ca4e0bdf-1e29-4f54-b015-49351bc8a0ae&playerid=43&gameinstanceid= ca4e0bdf-1e29-4f54-b015-49351bc8a0ae&action=1

Request Body

N/A

JSON Result

{

   data:

 [  {

      "instanceid": "ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      "gameid": 2,

      "playerids": "12,445",

      "startdatetime": "1354712002",

      “maxplayer”:2,

       “gameurl”:”http://abc.com”

 

      .

   }]

   Message: null

}

XML  Result

<Data>

<instanceid>ca4e0bdf-1e29-4f54-b015-49351bc8a0ae</instanceid>

<gameid>2</gameid>

<playerids>12,445</playerids>

<startdatetime>1354712002</startdatetime>

.<maxplayer>2.</maxplayer>

<gameurl>http://abc.com </gameurl>

.

.

</Data>

<Message></message>

Comments:

It returns the list of game instance by search criteria.

 

 

2.20 Manage Game Instance Play Data.

This API allows adding game instance related play data.

URL

/GameInstanceData/PostManageGameInstanceData

Request Type

POST

Parameters

Required Parameters

playerid

gameid

instanceid

gamescore

starttime

endtime

gamedate

gamerecorddate

Request Body

{

      "access_token":"",

      "data": {

      "playerid":,

      "gameid":,

     "instanceid":"",

     "gamescore":,

     "starttime":,

     "endtime":,

     "gamedate":,

     "gamerecorddate":

}

 

JSON Result

{

  "Data":

     { 

        "id":””       //Id of the new created Instance Data

      }

  "Message":””       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id></id>

</Data>

<Message></Message>

Example:

Request

/GameInstanceData/PostManageGameInstanceData

Request Body

{

      "access_token":"ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      "Data":

      {     

       "playerid":41,"gameid":1,

       "instanceid":"9999900",

       "gamescore":60,

       "starttime":1364973184,

       "endtime":1364980694,

       "gamedate":1364929200,

       "gamerecorddate":1364973184

      }

}

JSON Result

{

   "Data":

   {     

      "id":”12”     

   },

  "Message":null

}

XML  Result

 <Data>

 <id>12</id>

 </Data>

<Message></Message>

Comments:

 

 

2.21 List of Game Instances Data

 

URL

/GameInstanceData/GetGameInstanceData?access_token={access_token}&playerid={playerid}&gameid=[gamid]

Request Type

GET

Parameters

Playerid:

access_token:

gameid:

 

Request Body

N/A

JSON Result

{

   Data:

  [{   

   "playerid":,

   "gameid":,

   "instanceid":"",

   "gamescore":,

   "starttime":,

   "endtime":,

   "gamedate":,

   "gamerecorddate":

 }]

}

   “Message”:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <playerid></playerid>

<gameid></gameid>

<instanceid></instanceid>

<gamescore></gamescore>

<starttime></starttime>

<endtime></endtime>

<gamedate></gamedate>

<gamerecorddate></gamerecorddate>

.

.

</Data>

<Message></Message>

Example

 

Request

/GameInstanceData/GetGameInstanceData?access_token=ca4e0bdf-1e29-4f54-b015-49351bc8a0ae&playerid=43&gamid=1

Request Body

N/A

JSON Result

{

   data:

 [{

   "playerid":8,

   "gameid":1,

   "instanceid":"2",

   "gamescore":6,

   "starttime":1364973184,

   "endtime":1364980694,

   "gamedate":1364929200,

   "gamerecorddate":1364973184

   }]

   Message: null

}

XML  Result

<Data>

<playerid>8</playerid>

<gameid>1</gameid>

<instanceid>2</instanceid>

<gamescore>6</gamescore>

<starttime>1364973184</starttime>

<endtime>1364980694</endtime>

<gamedate>1364929200</gamedate>

 <gamerecorddate>1364973184</gamerecorddate>

.

.

</Data>

<Message></message>

Comments:

It returns the list of game instance data by search criteria.

 

 

2.22 Manage Player Performance Data.

This API allows adding player performance data.

URL

/PlayerInstanceData/PostManagePlayerData

Request Type

POST

Parameters

Required Parameters

"playerid":

"gameid":

"skilllevel":

"experiencelevel"

"gamescore"

"recorddate"

Request Body

{

      "access_token":"",

      "data": {

"playerid":,

"gameid":,

"skilllevel":,

"experiencelevel":,

"gamescore":,

                  "recorddate":

                }

}

JSON Result

{

  "Data":

     { 

        "id":””       //Id of the new created Instance Data

      }

  "Message":””       // Message in case of any exceptions/error   

}

XML Result

<Data>

 <id></id>

</Data>

<Message></Message>

Example:

Request

/PlayerInstanceData/PostManagePlayerData

Request Body

{

      "access_token":"ca4e0bdf-1e29-4f54-b015-49351bc8a0ae",

      "Data":

      {     

       "playerid":8,

       "gameid":1,

       "skilllevel"5:,

       "experiencelevel":3,

       "gamescore":60,

       "recorddate"334343442:

      }

}

JSON Result

{

   "Data":

   {     

      "id":”12”     

   },

  "Message":null

}

XML  Result

 <Data>

 <id>12</id>

 </Data>

<Message></Message>

Comments:

 

 

2.23 List of Player Performance Data

 

URL

/PlayerInstanceData/GetPerformanceData?access_token={access_token}&playerid={playerid}&gameid=[gamid]

Request Type

GET

Parameters

Playerid:

access_token:

gameid:

 

Request Body

N/A

JSON Result

{

   Data:

  [{   

   "playerid":,

   "gameid":,

   "skilllevel":,

   "experiencelevel":,

   "gamescore":,

   "recorddate":

 }]

}

   “Message”:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <playerid></playerid>

<gameid></gameid>

<skilllevel></skilllevel>

<experiencelevel></experiencelevel>

<gamescore></gamescore>

<recorddate></recorddate>

.

.

</Data>

<Message></Message>

Example

 

Request

/PlayerInstanceData/GetPerformanceData?access_token=ca4e0bdf-1e29-4f54-b015-49351bc8a0ae&playerid=43&gameinstanceid= ca4e0bdf-1e29-4f54-b015-49351bc8a0ae&action=1

Request Body

N/A

JSON Result

{

   data:

 [  {

   "playerid":8,

   "gameid":1,

"skilllevel":3,

"experiencelevel":2,

"gamescore":5,

"recorddate":1365139182

   }]

   Message: null

}

XML  Result

<Data>

<playerid>8</playerid>

<gameid>1</gameid>

<skilllevel>3</skilllevel>

<experiencelevel>2</experiencelevel>

<gamescore>5</gamescore>

<recorddate>1365139182</recorddate>

.

.

</Data>

<Message></message>

Comments:

It returns the list of player performance instance data by search criteria.

 

 

2.24 List of Albums by Player

 

URL

/Album/GetAlbums?access_token={access_token}

Request Type

GET

Parameters

access_token:

 

Request Body

N/A

JSON Result

{

   Data:

 {"albums":

[{"albumid":,

"title":"",

"description":"",

"accessid":}],

"albumtags":

[{"albumid":,

"createdat":,

"tag":""

}]

}

 

 

},

   “Message”:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <albums>

<albumid></albumid>

<title></title>

<description></description>

<accessid></accessid>

.

.

</albums>

<albumtags>

<albumid></albumid>

<createdat></createdat>

<tag></tag>

.

.

 

</albumtags>

</Data>

<Message></Message>

Example

 

Request

/Album/GetAlbums?access_token=ca4e0bdf-1e29-4f54-b015-49351bc8a0ae

Request Body

N/A

JSON Result

{

   data:

  {"albums":

[{"albumid":285,

"title":"My New Album",

"description":"<p>Album Description</p>",

"accessid":2}],

"albumtags":

[{"albumid":285,

"createdat":1365593823,

"tag":"family"

}]

}

,

   Message: null

}

XML  Result

<Data>

 <albums>

<albumid>285</albumid>

<title>My New Album</title>

<description><p>Album Description</p></description>

<accessid>2</accessid>

.

.

</albums>

<albumtags>

<albumid>285</albumid>

<createdat>1365593823</createdat>

<tag>family</tag>

.

.

 

</albumtags>

</Data>

<Message></Message>

Comments:

It returns the list of player album detail.

 

2.24 List of Images in an album

 

URL

Album/GetImages?albumid={albumid}&access_token={access_token}

Request Type

GET

Parameters

access_token:

albumid:

 

Request Body

N/A

JSON Result

{

   Data:

{

"images":

[{"imageid":,

"title":"",

"description":"",

"accessid":,

"materimage":"",

"thumbimage":"",

"smallimage":""

}],

"imagetags":

[{"imageid":,

"createdat":,

"tag":""

}]

}

},

   “Message”:””         // A message in case any exception/Error        

}

XML  Result

<Data>

 <images>

<imageid></imageid>

<title></title>

<description></description>

<accessid></accessid>

<materimage></materimage>

<thumbimage></thumbimage>

<smallimage></smallimage>

.

.

</images>

<imagetags>

<imageid></imageid>

<createdat></createdat>

<tag></tag>

.

.

 

</imagetags>

</Data>

<Message></Message>

Example

 

Request

/Album/GetImages?albumid=285&access_token=ca4e0bdf-1e29-4f54-b015-49351bc8a0ae

Request Body

N/A

JSON Result

{

   data:

  {

"images":

[{"imageid":286,

"title":"follow",

"description":"<p>Follow Description</p>",

"accessid":2,

"materimage":"http://smconnector.valentiatech.com/photos/thumbnail/286/master/",

"thumbimage":"http://smconnector.valentiatech.com/photos/thumbnail/286/thumb/",

"smallimage":"http://smconnector.valentiatech.com/photos/thumbnail/286/small/"

}],

"imagetags":

[{"imageid":286,

"createdat":1365593906,

"tag":"Follow"

}]

}

,

   Message: null

}

XML  Result

<Data>

 <albums>

<imageid>286</imageid>

<title> follow </title>

<description><p>Follow Description</p></description>

<accessid>2</accessid>

<materimage>http://smconnector.valentiatech.com/photos/thumbnail/286/master/</materimage>

<thumbimage>http://smconnector.valentiatech.com/photos/thumbnail/286/thumb/</thumbimage>

<smallimage>http://smconnector.valentiatech.com/photos/thumbnail/286/small/</smallimage>

.

.

</albums>

<imagetags>

<imageid>285</imageid>

<createdat>1365593823</createdat>

<tag>family</tag>

.

.

</imagetags>

</Data>

<Message></Message>

Comments:

It returns the list of images in the album.

 

 

 

 

 

Last edited Apr 16, 2013 at 4:02 PM by mrmubi, version 7

Comments

No comments yet.