Commit 61b07590e8389d7fd8e0f2093cca3354988f17e1

Authored by Esaú Freitas
1 parent e8b18f54

ajustes

Showing 1 changed file with 28 additions and 26 deletions
Readme.md
@@ -5,7 +5,7 @@ This method authenticate a player to your gamification and opens a session for t @@ -5,7 +5,7 @@ This method authenticate a player to your gamification and opens a session for t
5 GET Method 5 GET Method
6 6
7 ```sh 7 ```sh
8 -https://service2.funifier.com/2.0.0/authenticate 8 +http[s]://service2.funifier.com/2.0.0/authenticate
9 ``` 9 ```
10 10
11 **Parameters** . 11 **Parameters** .
@@ -22,46 +22,43 @@ https://service2.funifier.com/2.0.0/authenticate @@ -22,46 +22,43 @@ https://service2.funifier.com/2.0.0/authenticate
22 22
23 ### Example Request 23 ### Example Request
24 ```sh 24 ```sh
25 -https://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=IMPLICIT&player=ricardo@funifier.com 25 +https://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=IMPLICIT&player=player@funifier.com
26 ``` 26 ```
27 ```sh 27 ```sh
28 -https://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=PASSWORD&player=ricardo@funifier.com&password=123 28 +https://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=PASSWORD&player=player@funifier.com&password=123
29 ``` 29 ```
30 ```sh 30 ```sh
31 -mhttps://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=CREDENTIAL&player=ricardo@funifier.com&app_secret=54d80b7f34282de652978326 31 +mhttps://service2.funifier.com/2.0.0/authenticate?api_key=556df789108d44a65c389583&auth_mode=CREDENTIAL&player=player@funifer.com&app_secret=54d80b7f34282de652978326
32 ``` 32 ```
33 -### Example Response  
34 33
35 -```sh  
36 -{"message" : "action tracked","code" : 200,"type" : "OK"}  
37 -```  
38 -### Example Response 34 +### Example Response Sucess
39 35
40 ```sh 36 ```sh
41 {"access_token" : "54d80a14e4b0e8d184586a1c"} 37 {"access_token" : "54d80a14e4b0e8d184586a1c"}
42 ``` 38 ```
43 -### Example Error 39 +### Example Response Error
44 ``` 40 ```
45 -{"message" : "player ricardo@funifier.com does not exist, ask your administrator to create it in studio.funifier.com","code" : 401,"type" : "Unauthorized"} 41 +{"message" : "player player@funifier.com does not exist, ask your administrator to create it in studio2.funifier.com","code" : 401,"type" : "Unauthorized"}
46 ``` 42 ```
47 -### Track  
48 - - 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. 43 +
  44 +# Track
  45 +
  46 +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.
49 47
50 POST Method 48 POST Method
51 49
52 -``` 50 +```sh
53 http[s]://service2.funifier.com/2.0.0/track 51 http[s]://service2.funifier.com/2.0.0/track
54 ``` 52 ```
55 53
56 - - api_key **String** Required  
57 - - access_token **String** Optional  
58 - - player **String** Optional  
59 - - app_secret **String** Optional  
60 - - action **String** Required  
61 - - attributes **String** Optional **Description** Json Object,  
62 - (** Example: {"attribute1":"value1", - - - - "attribute2":"value2"}**)  
63 - - timestamp long Optional  
64 - - callback String Optional 54 + - api_key: **String/Required** - Field that identify the key of gamification
  55 + - access_token: **String/Required** - This field authorize the player to request this method, This value can be obtain by method Authenticate
  56 + - player: **String/Required** - Identify the Player of gamification
  57 + - app_secret: **String/Optional** - Token security, create this app_secret value in funfier studio on menu security
  58 + - action: **String/Required** - This field identifies the action that will be registered
  59 + - attributes: **String/Optional** - In This field can be past the objects of action. It is a Json Object. e.g. {"attribute1":"value1", "attribute2":"value2"}
  60 + - timestamp: **long/Optional** - This field is used to define a date. The type is a long
  61 + - callback: **String/Optional** - Use to callbacks in javascript
65 62
66 ### Example Request 63 ### Example Request
67 64
@@ -69,13 +66,18 @@ http[s]://service2.funifier.com/2.0.0/track @@ -69,13 +66,18 @@ http[s]://service2.funifier.com/2.0.0/track
69 https://service2.funifier.com/2.0.0/track?api_key=556df789108d44a65c389583&action=sell&attributes={"product":"book","price":12.5}&access_token=54d8139ae4b0e8d184586a1f 66 https://service2.funifier.com/2.0.0/track?api_key=556df789108d44a65c389583&action=sell&attributes={"product":"book","price":12.5}&access_token=54d8139ae4b0e8d184586a1f
70 ``` 67 ```
71 ```sh 68 ```sh
72 -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 69 +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
73 ``` 70 ```
74 -### Example Response 71 +### Example Response Sucess
75 ```sh 72 ```sh
76 {"message" : "action tracked","code" : 200,"type" : "OK"} 73 {"message" : "action tracked","code" : 200,"type" : "OK"}
77 ``` 74 ```
78 -### Widget Data 75 +### Example Response Error
  76 +```
  77 +{"message" : "action sell does not exist","code" : 400, "type" : "Bad Request"}
  78 +```
  79 +
  80 +# Widget Data
79 81
80 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. 82 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.
81 83