diff --git a/Readme.md b/Readme.md index fe6381b..d63b373 100644 --- a/Readme.md +++ b/Readme.md @@ -5,7 +5,7 @@ This method authenticate a player to your gamification and opens a session for t GET Method ```sh -https://service2.funifier.com/2.0.0/authenticate +http[s]://service2.funifier.com/2.0.0/authenticate ``` **Parameters** . @@ -22,46 +22,43 @@ https://service2.funifier.com/2.0.0/authenticate ### Example Request ```sh -https://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=IMPLICIT&player=ricardo@funifier.com +https://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=IMPLICIT&player=player@funifier.com ``` ```sh -https://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=PASSWORD&player=ricardo@funifier.com&password=123 +https://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=PASSWORD&player=player@funifier.com&password=123 ``` ```sh -mhttps://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=CREDENTIAL&player=ricardo@funifier.com&app_secret=54d80b7f34282de652978326 +mhttps://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=CREDENTIAL&player=player@funifer.com&app_secret=54d80b7f34282de652978326 ``` -### Example Response -```sh -{"message" : "action tracked","code" : 200,"type" : "OK"} -``` -### Example Response +### Example Response Sucess ```sh {"access_token" : "54d80a14e4b0e8d184586a1c"} ``` -### Example Error +### Example Response Error ``` -{"message" : "player ricardo@funifier.com does not exist, ask your administrator to create it in studio.funifier.com","code" : 401,"type" : "Unauthorized"} +{"message" : "player player@funifier.com does not exist, ask your administrator to create it in studio2.funifier.com","code" : 401,"type" : "Unauthorized"} ``` -### Track - - This method send actions performed by players to Funifier. Requires you to call this method whenever the action occurs, and pass the action name, and all the metadata you care about. + +# Track + +This method send actions performed by players to Funifier. Requires you to call this method whenever the action occurs, and pass the action name, and all the metadata you care about. POST Method -``` +```sh http[s]://service2.funifier.com/2.0.0/track ``` - - api_key **String** Required - - access_token **String** Optional - - player **String** Optional - - app_secret **String** Optional - - action **String** Required - - attributes **String** Optional **Description** Json Object, - (** Example: {"attribute1":"value1", - - - - "attribute2":"value2"}**) - - timestamp long Optional - - callback String Optional + - api_key: **String/Required** - Field that identify the key of gamification + - access_token: **String/Required** - This field authorize the player to request this method, This value can be obtain by method Authenticate + - player: **String/Required** - Identify the Player of gamification + - app_secret: **String/Optional** - Token security, create this app_secret value in funfier studio on menu security + - action: **String/Required** - This field identifies the action that will be registered + - attributes: **String/Optional** - In This field can be past the objects of action. It is a Json Object. e.g. {"attribute1":"value1", "attribute2":"value2"} + - timestamp: **long/Optional** - This field is used to define a date. The type is a long + - callback: **String/Optional** - Use to callbacks in javascript ### Example Request @@ -69,13 +66,18 @@ http[s]://service2.funifier.com/2.0.0/track https://service2.funifier.com/2.0.0/track?api_key=556df789108d44a65c389583&action=sell&attributes={"product":"book","price":12.5}&access_token=54d8139ae4b0e8d184586a1f ``` ```sh -https://service2.funifier.com/2.0.0/track?api_key=556df789108d44a65c389583&action=sell&attributes={"product":"book","price":12.5}&player=ricardo@funifier.com&app_secret=54d80b7f34282de652978326 +https://service2.funifier.com/2.0.0/track?api_key=556df789108d44a65c389583&action=sell&attributes={"product":"book","price":12.5}&player=player@funifier.com&app_secret=54d80b7f34282de652978326 ``` -### Example Response +### Example Response Sucess ```sh {"message" : "action tracked","code" : 200,"type" : "OK"} ``` -### Widget Data +### Example Response Error +``` +{"message" : "action sell does not exist","code" : 400, "type" : "Bad Request"} +``` + +# Widget Data This method retrieves information about players, win-states, incentives and other objects inside the gamification. Use this to show to visually engage the players with their status and other infos.