John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="games_v1.html">Google Play Game Services API</a> . <a href="games_v1.achievements.html">achievements</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 78 | <code><a href="#increment">increment(achievementId, stepsToIncrement, requestId=None)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 79 | <p class="firstline">Increments the steps of the achievement with the given ID for the currently authenticated player.</p> |
| 80 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 81 | <code><a href="#list">list(playerId, language=None, maxResults=None, pageToken=None, state=None)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 82 | <p class="firstline">Lists the progress for all your application's achievements for the currently authenticated player.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 85 | <p class="firstline">Retrieves the next page of results.</p> |
| 86 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 87 | <code><a href="#reveal">reveal(achievementId)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 88 | <p class="firstline">Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.</p> |
| 89 | <p class="toc_element"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 90 | <code><a href="#setStepsAtLeast">setStepsAtLeast(achievementId, steps)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 91 | <p class="firstline">Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified.</p> |
| 92 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 93 | <code><a href="#unlock">unlock(achievementId)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 94 | <p class="firstline">Unlocks this achievement for the currently authenticated player.</p> |
| 95 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 96 | <code><a href="#updateMultiple">updateMultiple(body=None)</a></code></p> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 97 | <p class="firstline">Updates multiple achievements for the currently authenticated player.</p> |
| 98 | <h3>Method Details</h3> |
| 99 | <div class="method"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 100 | <code class="details" id="increment">increment(achievementId, stepsToIncrement, requestId=None)</code> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 101 | <pre>Increments the steps of the achievement with the given ID for the currently authenticated player. |
| 102 | |
| 103 | Args: |
| 104 | achievementId: string, The ID of the achievement used by this method. (required) |
| 105 | stepsToIncrement: integer, The number of steps to increment. (required) |
| 106 | requestId: string, A randomly generated numeric ID for each request specified by the caller. This number is used at the server to ensure that the request is handled correctly across retries. |
| 107 | |
| 108 | Returns: |
| 109 | An object of the form: |
| 110 | |
| 111 | { # This is a JSON template for an achievement increment response |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 112 | "currentSteps": 42, # The current steps recorded for this incremental achievement. |
| 113 | "kind": "games#achievementIncrementResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementIncrementResponse. |
| 114 | "newlyUnlocked": True or False, # Whether the current steps for the achievement has reached the number of steps required to unlock. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 115 | }</pre> |
| 116 | </div> |
| 117 | |
| 118 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 119 | <code class="details" id="list">list(playerId, language=None, maxResults=None, pageToken=None, state=None)</code> |
| 120 | <pre>Lists the progress for all your application's achievements for the currently authenticated player. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 121 | |
| 122 | Args: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 123 | playerId: string, A player ID. A value of me may be used in place of the authenticated player's ID. (required) |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 124 | language: string, The preferred language to use for strings returned by this method. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 125 | maxResults: integer, The maximum number of achievement resources to return in the response, used for paging. For any response, the actual number of achievement resources returned may be less than the specified maxResults. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 126 | pageToken: string, The token returned by the previous request. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 127 | state: string, Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 128 | Allowed values |
| 129 | ALL - List all achievements. This is the default. |
| 130 | HIDDEN - List only hidden achievements. |
| 131 | REVEALED - List only revealed achievements. |
| 132 | UNLOCKED - List only unlocked achievements. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 133 | |
| 134 | Returns: |
| 135 | An object of the form: |
| 136 | |
| 137 | { # This is a JSON template for a list of achievement objects. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 138 | "items": [ # The achievements. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 139 | { # This is a JSON template for an achievement object. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 140 | "achievementState": "A String", # The state of the achievement. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 141 | # Possible values are: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 142 | # - "HIDDEN" - Achievement is hidden. |
| 143 | # - "REVEALED" - Achievement is revealed. |
| 144 | # - "UNLOCKED" - Achievement is unlocked. |
| 145 | "currentSteps": 42, # The current steps for an incremental achievement. |
| 146 | "experiencePoints": "A String", # Experience points earned for the achievement. This field is absent for achievements that have not yet been unlocked and 0 for achievements that have been unlocked by testers but that are unpublished. |
| 147 | "formattedCurrentStepsString": "A String", # The current steps for an incremental achievement as a string. |
| 148 | "id": "A String", # The ID of the achievement. |
| 149 | "kind": "games#playerAchievement", # Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievement. |
| 150 | "lastUpdatedTimestamp": "A String", # The timestamp of the last modification to this achievement's state. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 151 | }, |
| 152 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 153 | "kind": "games#playerAchievementListResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievementListResponse. |
| 154 | "nextPageToken": "A String", # Token corresponding to the next page of results. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 155 | }</pre> |
| 156 | </div> |
| 157 | |
| 158 | <div class="method"> |
| 159 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 160 | <pre>Retrieves the next page of results. |
| 161 | |
| 162 | Args: |
| 163 | previous_request: The request for the previous page. (required) |
| 164 | previous_response: The response from the request for the previous page. (required) |
| 165 | |
| 166 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 167 | A request object that you can call 'execute()' on to request the next |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 168 | page. Returns None if there are no more items in the collection. |
| 169 | </pre> |
| 170 | </div> |
| 171 | |
| 172 | <div class="method"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 173 | <code class="details" id="reveal">reveal(achievementId)</code> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 174 | <pre>Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player. |
| 175 | |
| 176 | Args: |
| 177 | achievementId: string, The ID of the achievement used by this method. (required) |
| 178 | |
| 179 | Returns: |
| 180 | An object of the form: |
| 181 | |
| 182 | { # This is a JSON template for an achievement reveal response |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 183 | "currentState": "A String", # The current state of the achievement for which a reveal was attempted. This might be UNLOCKED if the achievement was already unlocked. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 184 | # Possible values are: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 185 | # - "REVEALED" - Achievement is revealed. |
| 186 | # - "UNLOCKED" - Achievement is unlocked. |
| 187 | "kind": "games#achievementRevealResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementRevealResponse. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 188 | }</pre> |
| 189 | </div> |
| 190 | |
| 191 | <div class="method"> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 192 | <code class="details" id="setStepsAtLeast">setStepsAtLeast(achievementId, steps)</code> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 193 | <pre>Sets the steps for the currently authenticated player towards unlocking an achievement. If the steps parameter is less than the current number of steps that the player already gained for the achievement, the achievement is not modified. |
| 194 | |
| 195 | Args: |
| 196 | achievementId: string, The ID of the achievement used by this method. (required) |
| 197 | steps: integer, The minimum value to set the steps to. (required) |
| 198 | |
| 199 | Returns: |
| 200 | An object of the form: |
| 201 | |
| 202 | { # This is a JSON template for an achievement set steps at least response. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 203 | "currentSteps": 42, # The current steps recorded for this incremental achievement. |
| 204 | "kind": "games#achievementSetStepsAtLeastResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementSetStepsAtLeastResponse. |
| 205 | "newlyUnlocked": True or False, # Whether the the current steps for the achievement has reached the number of steps required to unlock. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 206 | }</pre> |
| 207 | </div> |
| 208 | |
| 209 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 210 | <code class="details" id="unlock">unlock(achievementId)</code> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 211 | <pre>Unlocks this achievement for the currently authenticated player. |
| 212 | |
| 213 | Args: |
| 214 | achievementId: string, The ID of the achievement used by this method. (required) |
| 215 | |
| 216 | Returns: |
| 217 | An object of the form: |
| 218 | |
| 219 | { # This is a JSON template for an achievement unlock response |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 220 | "kind": "games#achievementUnlockResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUnlockResponse. |
| 221 | "newlyUnlocked": True or False, # Whether this achievement was newly unlocked (that is, whether the unlock request for the achievement was the first for the player). |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 222 | }</pre> |
| 223 | </div> |
| 224 | |
| 225 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 226 | <code class="details" id="updateMultiple">updateMultiple(body=None)</code> |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 227 | <pre>Updates multiple achievements for the currently authenticated player. |
| 228 | |
| 229 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 230 | body: object, The request body. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 231 | The object takes the form of: |
| 232 | |
| 233 | { # This is a JSON template for a list of achievement update requests. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 234 | "kind": "games#achievementUpdateMultipleRequest", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateMultipleRequest. |
| 235 | "updates": [ # The individual achievement update requests. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 236 | { # This is a JSON template for a request to update an achievement. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 237 | "achievementId": "A String", # The achievement this update is being applied to. |
| 238 | "incrementPayload": { # This is a JSON template for the payload to request to increment an achievement. # The payload if an update of type INCREMENT was requested for the achievement. |
| 239 | "kind": "games#GamesAchievementIncrement", # Uniquely identifies the type of this resource. Value is always the fixed string games#GamesAchievementIncrement. |
| 240 | "requestId": "A String", # The requestId associated with an increment to an achievement. |
| 241 | "steps": 42, # The number of steps to be incremented. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 242 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 243 | "kind": "games#achievementUpdateRequest", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateRequest. |
| 244 | "setStepsAtLeastPayload": { # This is a JSON template for the payload to request to increment an achievement. # The payload if an update of type SET_STEPS_AT_LEAST was requested for the achievement. |
| 245 | "kind": "games#GamesAchievementSetStepsAtLeast", # Uniquely identifies the type of this resource. Value is always the fixed string games#GamesAchievementSetStepsAtLeast. |
| 246 | "steps": 42, # The minimum number of steps for the achievement to be set to. |
| 247 | }, |
| 248 | "updateType": "A String", # The type of update being applied. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 249 | # Possible values are: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 250 | # - "REVEAL" - Achievement is revealed. |
| 251 | # - "UNLOCK" - Achievement is unlocked. |
| 252 | # - "INCREMENT" - Achievement is incremented. |
| 253 | # - "SET_STEPS_AT_LEAST" - Achievement progress is set to at least the passed value. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 254 | }, |
| 255 | ], |
| 256 | } |
| 257 | |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 258 | |
| 259 | Returns: |
| 260 | An object of the form: |
| 261 | |
| 262 | { # This is a JSON template for an achievement unlock response. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 263 | "kind": "games#achievementUpdateMultipleResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateMultipleResponse. |
| 264 | "updatedAchievements": [ # The updated state of the achievements. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 265 | { # This is a JSON template for an achievement update response. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 266 | "achievementId": "A String", # The achievement this update is was applied to. |
| 267 | "currentState": "A String", # The current state of the achievement. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 268 | # Possible values are: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 269 | # - "HIDDEN" - Achievement is hidden. |
| 270 | # - "REVEALED" - Achievement is revealed. |
| 271 | # - "UNLOCKED" - Achievement is unlocked. |
| 272 | "currentSteps": 42, # The current steps recorded for this achievement if it is incremental. |
| 273 | "kind": "games#achievementUpdateResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateResponse. |
| 274 | "newlyUnlocked": True or False, # Whether this achievement was newly unlocked (that is, whether the unlock request for the achievement was the first for the player). |
| 275 | "updateOccurred": True or False, # Whether the requested updates actually affected the achievement. |
John Asmuth | 614db98 | 2014-04-24 15:46:26 -0400 | [diff] [blame] | 276 | }, |
| 277 | ], |
| 278 | }</pre> |
| 279 | </div> |
| 280 | |
| 281 | </body></html> |