blob: 8e097faa2c8105dcb7419fc2ef471dde5b6b4df9 [file] [log] [blame]
John Asmuth614db982014-04-24 15:46:26 -04001<html><body>
2<style>
3
4body, 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
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, 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">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070078 <code><a href="#increment">increment(achievementId, stepsToIncrement, requestId=None, consistencyToken=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040079<p class="firstline">Increments the steps of the achievement with the given ID for the currently authenticated player.</p>
80<p class="toc_element">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070081 <code><a href="#list">list(playerId, language=None, pageToken=None, state=None, maxResults=None, consistencyToken=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040082<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">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070087 <code><a href="#reveal">reveal(achievementId, consistencyToken=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040088<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">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070090 <code><a href="#setStepsAtLeast">setStepsAtLeast(achievementId, steps, consistencyToken=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040091<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">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070093 <code><a href="#unlock">unlock(achievementId, consistencyToken=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040094<p class="firstline">Unlocks this achievement for the currently authenticated player.</p>
95<p class="toc_element">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -070096 <code><a href="#updateMultiple">updateMultiple(body, consistencyToken=None)</a></code></p>
John Asmuth614db982014-04-24 15:46:26 -040097<p class="firstline">Updates multiple achievements for the currently authenticated player.</p>
98<h3>Method Details</h3>
99<div class="method">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700100 <code class="details" id="increment">increment(achievementId, stepsToIncrement, requestId=None, consistencyToken=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400101 <pre>Increments the steps of the achievement with the given ID for the currently authenticated player.
102
103Args:
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.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700107 consistencyToken: string, The last-seen mutation timestamp.
John Asmuth614db982014-04-24 15:46:26 -0400108
109Returns:
110 An object of the form:
111
112 { # This is a JSON template for an achievement increment response
113 "currentSteps": 42, # The current steps recorded for this incremental achievement.
Jon Wayne Parrott0a471d32016-05-19 10:54:38 -0700114 "newlyUnlocked": True or False, # Whether the current steps for the achievement has reached the number of steps required to unlock.
John Asmuth614db982014-04-24 15:46:26 -0400115 "kind": "games#achievementIncrementResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementIncrementResponse.
116 }</pre>
117</div>
118
119<div class="method">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700120 <code class="details" id="list">list(playerId, language=None, pageToken=None, state=None, maxResults=None, consistencyToken=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400121 <pre>Lists the progress for all your application's achievements for the currently authenticated player.
122
123Args:
124 playerId: string, A player ID. A value of me may be used in place of the authenticated player's ID. (required)
125 language: string, The preferred language to use for strings returned by this method.
126 pageToken: string, The token returned by the previous request.
127 state: string, Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned.
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.
133 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.
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700134 consistencyToken: string, The last-seen mutation timestamp.
John Asmuth614db982014-04-24 15:46:26 -0400135
136Returns:
137 An object of the form:
138
139 { # This is a JSON template for a list of achievement objects.
140 "nextPageToken": "A String", # Token corresponding to the next page of results.
141 "items": [ # The achievements.
142 { # This is a JSON template for an achievement object.
143 "achievementState": "A String", # The state of the achievement.
144 # Possible values are:
145 # - "HIDDEN" - Achievement is hidden.
146 # - "REVEALED" - Achievement is revealed.
147 # - "UNLOCKED" - Achievement is unlocked.
148 "kind": "games#playerAchievement", # Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievement.
149 "lastUpdatedTimestamp": "A String", # The timestamp of the last modification to this achievement's state.
150 "currentSteps": 42, # The current steps for an incremental achievement.
Craig Citro065b5302014-08-14 00:47:23 -0700151 "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.
John Asmuth614db982014-04-24 15:46:26 -0400152 "formattedCurrentStepsString": "A String", # The current steps for an incremental achievement as a string.
153 "id": "A String", # The ID of the achievement.
154 },
155 ],
156 "kind": "games#playerAchievementListResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievementListResponse.
157 }</pre>
158</div>
159
160<div class="method">
161 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
162 <pre>Retrieves the next page of results.
163
164Args:
165 previous_request: The request for the previous page. (required)
166 previous_response: The response from the request for the previous page. (required)
167
168Returns:
169 A request object that you can call 'execute()' on to request the next
170 page. Returns None if there are no more items in the collection.
171 </pre>
172</div>
173
174<div class="method">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700175 <code class="details" id="reveal">reveal(achievementId, consistencyToken=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400176 <pre>Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.
177
178Args:
179 achievementId: string, The ID of the achievement used by this method. (required)
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700180 consistencyToken: string, The last-seen mutation timestamp.
John Asmuth614db982014-04-24 15:46:26 -0400181
182Returns:
183 An object of the form:
184
185 { # This is a JSON template for an achievement reveal response
186 "kind": "games#achievementRevealResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementRevealResponse.
187 "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.
188 # Possible values are:
189 # - "REVEALED" - Achievement is revealed.
190 # - "UNLOCKED" - Achievement is unlocked.
191 }</pre>
192</div>
193
194<div class="method">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700195 <code class="details" id="setStepsAtLeast">setStepsAtLeast(achievementId, steps, consistencyToken=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400196 <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.
197
198Args:
199 achievementId: string, The ID of the achievement used by this method. (required)
200 steps: integer, The minimum value to set the steps to. (required)
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700201 consistencyToken: string, The last-seen mutation timestamp.
John Asmuth614db982014-04-24 15:46:26 -0400202
203Returns:
204 An object of the form:
205
206 { # This is a JSON template for an achievement set steps at least response.
207 "currentSteps": 42, # The current steps recorded for this incremental achievement.
208 "newlyUnlocked": True or False, # Whether the the current steps for the achievement has reached the number of steps required to unlock.
209 "kind": "games#achievementSetStepsAtLeastResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementSetStepsAtLeastResponse.
210 }</pre>
211</div>
212
213<div class="method">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700214 <code class="details" id="unlock">unlock(achievementId, consistencyToken=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400215 <pre>Unlocks this achievement for the currently authenticated player.
216
217Args:
218 achievementId: string, The ID of the achievement used by this method. (required)
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700219 consistencyToken: string, The last-seen mutation timestamp.
John Asmuth614db982014-04-24 15:46:26 -0400220
221Returns:
222 An object of the form:
223
224 { # This is a JSON template for an achievement unlock response
225 "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).
226 "kind": "games#achievementUnlockResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUnlockResponse.
227 }</pre>
228</div>
229
230<div class="method">
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700231 <code class="details" id="updateMultiple">updateMultiple(body, consistencyToken=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400232 <pre>Updates multiple achievements for the currently authenticated player.
233
234Args:
235 body: object, The request body. (required)
236 The object takes the form of:
237
238{ # This is a JSON template for a list of achievement update requests.
239 "kind": "games#achievementUpdateMultipleRequest", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateMultipleRequest.
240 "updates": [ # The individual achievement update requests.
241 { # This is a JSON template for a request to update an achievement.
242 "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.
243 "kind": "games#GamesAchievementSetStepsAtLeast", # Uniquely identifies the type of this resource. Value is always the fixed string games#GamesAchievementSetStepsAtLeast.
244 "steps": 42, # The minimum number of steps for the achievement to be set to.
245 },
246 "updateType": "A String", # The type of update being applied.
247 # Possible values are:
248 # - "REVEAL" - Achievement is revealed.
249 # - "UNLOCK" - Achievement is unlocked.
250 # - "INCREMENT" - Achievement is incremented.
251 # - "SET_STEPS_AT_LEAST" - Achievement progress is set to at least the passed value.
252 "kind": "games#achievementUpdateRequest", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateRequest.
253 "achievementId": "A String", # The achievement this update is being applied to.
254 "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.
255 "kind": "games#GamesAchievementIncrement", # Uniquely identifies the type of this resource. Value is always the fixed string games#GamesAchievementIncrement.
256 "steps": 42, # The number of steps to be incremented.
257 "requestId": "A String", # The requestId associated with an increment to an achievement.
258 },
259 },
260 ],
261 }
262
Jon Wayne Parrott7d5badb2016-08-16 12:44:29 -0700263 consistencyToken: string, The last-seen mutation timestamp.
John Asmuth614db982014-04-24 15:46:26 -0400264
265Returns:
266 An object of the form:
267
268 { # This is a JSON template for an achievement unlock response.
269 "kind": "games#achievementUpdateMultipleResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateListResponse.
270 "updatedAchievements": [ # The updated state of the achievements.
271 { # This is a JSON template for an achievement update response.
272 "kind": "games#achievementUpdateResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateResponse.
273 "achievementId": "A String", # The achievement this update is was applied to.
274 "currentSteps": 42, # The current steps recorded for this achievement if it is incremental.
275 "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).
276 "updateOccurred": True or False, # Whether the requested updates actually affected the achievement.
277 "currentState": "A String", # The current state of the achievement.
278 # Possible values are:
279 # - "HIDDEN" - Achievement is hidden.
280 # - "REVEALED" - Achievement is revealed.
281 # - "UNLOCKED" - Achievement is unlocked.
282 },
283 ],
284 }</pre>
285</div>
286
287</body></html>