blob: 54a795ea578210f872872182726fddab6a307d2b [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">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070078 <code><a href="#increment">increment(achievementId, stepsToIncrement, requestId=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">
Bu Sun Kim65020912020-05-20 12:08:20 -070081 <code><a href="#list">list(playerId, language=None, maxResults=None, pageToken=None, state=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">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070087 <code><a href="#reveal">reveal(achievementId)</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">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070090 <code><a href="#setStepsAtLeast">setStepsAtLeast(achievementId, steps)</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">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#unlock">unlock(achievementId)</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">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#updateMultiple">updateMultiple(body=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">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700100 <code class="details" id="increment">increment(achievementId, stepsToIncrement, requestId=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.
107
108Returns:
109 An object of the form:
110
111 { # This is a JSON template for an achievement increment response
Bu Sun Kim65020912020-05-20 12:08:20 -0700112 &quot;currentSteps&quot;: 42, # The current steps recorded for this incremental achievement.
113 &quot;kind&quot;: &quot;games#achievementIncrementResponse&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementIncrementResponse.
114 &quot;newlyUnlocked&quot;: 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 }</pre>
116</div>
117
118<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -0700119 <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&#x27;s achievements for the currently authenticated player.
John Asmuth614db982014-04-24 15:46:26 -0400121
122Args:
Bu Sun Kim65020912020-05-20 12:08:20 -0700123 playerId: string, A player ID. A value of me may be used in place of the authenticated player&#x27;s ID. (required)
John Asmuth614db982014-04-24 15:46:26 -0400124 language: string, The preferred language to use for strings returned by this method.
Bu Sun Kim65020912020-05-20 12:08:20 -0700125 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 Asmuth614db982014-04-24 15:46:26 -0400126 pageToken: string, The token returned by the previous request.
Bu Sun Kim65020912020-05-20 12:08:20 -0700127 state: string, Tells the server to return only achievements with the specified state. If this parameter isn&#x27;t specified, all achievements are returned.
John Asmuth614db982014-04-24 15:46:26 -0400128 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 Asmuth614db982014-04-24 15:46:26 -0400133
134Returns:
135 An object of the form:
136
137 { # This is a JSON template for a list of achievement objects.
Bu Sun Kim65020912020-05-20 12:08:20 -0700138 &quot;items&quot;: [ # The achievements.
John Asmuth614db982014-04-24 15:46:26 -0400139 { # This is a JSON template for an achievement object.
Bu Sun Kim65020912020-05-20 12:08:20 -0700140 &quot;achievementState&quot;: &quot;A String&quot;, # The state of the achievement.
John Asmuth614db982014-04-24 15:46:26 -0400141 # Possible values are:
Bu Sun Kim65020912020-05-20 12:08:20 -0700142 # - &quot;HIDDEN&quot; - Achievement is hidden.
143 # - &quot;REVEALED&quot; - Achievement is revealed.
144 # - &quot;UNLOCKED&quot; - Achievement is unlocked.
145 &quot;currentSteps&quot;: 42, # The current steps for an incremental achievement.
146 &quot;experiencePoints&quot;: &quot;A String&quot;, # 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 &quot;formattedCurrentStepsString&quot;: &quot;A String&quot;, # The current steps for an incremental achievement as a string.
148 &quot;id&quot;: &quot;A String&quot;, # The ID of the achievement.
149 &quot;kind&quot;: &quot;games#playerAchievement&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievement.
150 &quot;lastUpdatedTimestamp&quot;: &quot;A String&quot;, # The timestamp of the last modification to this achievement&#x27;s state.
John Asmuth614db982014-04-24 15:46:26 -0400151 },
152 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700153 &quot;kind&quot;: &quot;games#playerAchievementListResponse&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievementListResponse.
154 &quot;nextPageToken&quot;: &quot;A String&quot;, # Token corresponding to the next page of results.
John Asmuth614db982014-04-24 15:46:26 -0400155 }</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
162Args:
163 previous_request: The request for the previous page. (required)
164 previous_response: The response from the request for the previous page. (required)
165
166Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -0700167 A request object that you can call &#x27;execute()&#x27; on to request the next
John Asmuth614db982014-04-24 15:46:26 -0400168 page. Returns None if there are no more items in the collection.
169 </pre>
170</div>
171
172<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700173 <code class="details" id="reveal">reveal(achievementId)</code>
John Asmuth614db982014-04-24 15:46:26 -0400174 <pre>Sets the state of the achievement with the given ID to REVEALED for the currently authenticated player.
175
176Args:
177 achievementId: string, The ID of the achievement used by this method. (required)
178
179Returns:
180 An object of the form:
181
182 { # This is a JSON template for an achievement reveal response
Bu Sun Kim65020912020-05-20 12:08:20 -0700183 &quot;currentState&quot;: &quot;A String&quot;, # The current state of the achievement for which a reveal was attempted. This might be UNLOCKED if the achievement was already unlocked.
John Asmuth614db982014-04-24 15:46:26 -0400184 # Possible values are:
Bu Sun Kim65020912020-05-20 12:08:20 -0700185 # - &quot;REVEALED&quot; - Achievement is revealed.
186 # - &quot;UNLOCKED&quot; - Achievement is unlocked.
187 &quot;kind&quot;: &quot;games#achievementRevealResponse&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementRevealResponse.
John Asmuth614db982014-04-24 15:46:26 -0400188 }</pre>
189</div>
190
191<div class="method">
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700192 <code class="details" id="setStepsAtLeast">setStepsAtLeast(achievementId, steps)</code>
John Asmuth614db982014-04-24 15:46:26 -0400193 <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
195Args:
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
199Returns:
200 An object of the form:
201
202 { # This is a JSON template for an achievement set steps at least response.
Bu Sun Kim65020912020-05-20 12:08:20 -0700203 &quot;currentSteps&quot;: 42, # The current steps recorded for this incremental achievement.
204 &quot;kind&quot;: &quot;games#achievementSetStepsAtLeastResponse&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementSetStepsAtLeastResponse.
205 &quot;newlyUnlocked&quot;: True or False, # Whether the the current steps for the achievement has reached the number of steps required to unlock.
John Asmuth614db982014-04-24 15:46:26 -0400206 }</pre>
207</div>
208
209<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700210 <code class="details" id="unlock">unlock(achievementId)</code>
John Asmuth614db982014-04-24 15:46:26 -0400211 <pre>Unlocks this achievement for the currently authenticated player.
212
213Args:
214 achievementId: string, The ID of the achievement used by this method. (required)
215
216Returns:
217 An object of the form:
218
219 { # This is a JSON template for an achievement unlock response
Bu Sun Kim65020912020-05-20 12:08:20 -0700220 &quot;kind&quot;: &quot;games#achievementUnlockResponse&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUnlockResponse.
221 &quot;newlyUnlocked&quot;: 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 Asmuth614db982014-04-24 15:46:26 -0400222 }</pre>
223</div>
224
225<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700226 <code class="details" id="updateMultiple">updateMultiple(body=None)</code>
John Asmuth614db982014-04-24 15:46:26 -0400227 <pre>Updates multiple achievements for the currently authenticated player.
228
229Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700230 body: object, The request body.
John Asmuth614db982014-04-24 15:46:26 -0400231 The object takes the form of:
232
233{ # This is a JSON template for a list of achievement update requests.
Bu Sun Kim65020912020-05-20 12:08:20 -0700234 &quot;kind&quot;: &quot;games#achievementUpdateMultipleRequest&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateMultipleRequest.
235 &quot;updates&quot;: [ # The individual achievement update requests.
John Asmuth614db982014-04-24 15:46:26 -0400236 { # This is a JSON template for a request to update an achievement.
Bu Sun Kim65020912020-05-20 12:08:20 -0700237 &quot;achievementId&quot;: &quot;A String&quot;, # The achievement this update is being applied to.
238 &quot;incrementPayload&quot;: { # 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 &quot;kind&quot;: &quot;games#GamesAchievementIncrement&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#GamesAchievementIncrement.
240 &quot;requestId&quot;: &quot;A String&quot;, # The requestId associated with an increment to an achievement.
241 &quot;steps&quot;: 42, # The number of steps to be incremented.
John Asmuth614db982014-04-24 15:46:26 -0400242 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700243 &quot;kind&quot;: &quot;games#achievementUpdateRequest&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateRequest.
244 &quot;setStepsAtLeastPayload&quot;: { # 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 &quot;kind&quot;: &quot;games#GamesAchievementSetStepsAtLeast&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#GamesAchievementSetStepsAtLeast.
246 &quot;steps&quot;: 42, # The minimum number of steps for the achievement to be set to.
247 },
248 &quot;updateType&quot;: &quot;A String&quot;, # The type of update being applied.
John Asmuth614db982014-04-24 15:46:26 -0400249 # Possible values are:
Bu Sun Kim65020912020-05-20 12:08:20 -0700250 # - &quot;REVEAL&quot; - Achievement is revealed.
251 # - &quot;UNLOCK&quot; - Achievement is unlocked.
252 # - &quot;INCREMENT&quot; - Achievement is incremented.
253 # - &quot;SET_STEPS_AT_LEAST&quot; - Achievement progress is set to at least the passed value.
John Asmuth614db982014-04-24 15:46:26 -0400254 },
255 ],
256 }
257
John Asmuth614db982014-04-24 15:46:26 -0400258
259Returns:
260 An object of the form:
261
262 { # This is a JSON template for an achievement unlock response.
Bu Sun Kim65020912020-05-20 12:08:20 -0700263 &quot;kind&quot;: &quot;games#achievementUpdateMultipleResponse&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateMultipleResponse.
264 &quot;updatedAchievements&quot;: [ # The updated state of the achievements.
John Asmuth614db982014-04-24 15:46:26 -0400265 { # This is a JSON template for an achievement update response.
Bu Sun Kim65020912020-05-20 12:08:20 -0700266 &quot;achievementId&quot;: &quot;A String&quot;, # The achievement this update is was applied to.
267 &quot;currentState&quot;: &quot;A String&quot;, # The current state of the achievement.
John Asmuth614db982014-04-24 15:46:26 -0400268 # Possible values are:
Bu Sun Kim65020912020-05-20 12:08:20 -0700269 # - &quot;HIDDEN&quot; - Achievement is hidden.
270 # - &quot;REVEALED&quot; - Achievement is revealed.
271 # - &quot;UNLOCKED&quot; - Achievement is unlocked.
272 &quot;currentSteps&quot;: 42, # The current steps recorded for this achievement if it is incremental.
273 &quot;kind&quot;: &quot;games#achievementUpdateResponse&quot;, # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateResponse.
274 &quot;newlyUnlocked&quot;: 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 &quot;updateOccurred&quot;: True or False, # Whether the requested updates actually affected the achievement.
John Asmuth614db982014-04-24 15:46:26 -0400276 },
277 ],
278 }</pre>
279</div>
280
281</body></html>