blob: 15092bf2c875a235d52ea66236a5c92d7d9f64c9 [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">
78 <code><a href="#increment">increment(achievementId, stepsToIncrement, requestId=None)</a></code></p>
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">
81 <code><a href="#list">list(playerId, language=None, pageToken=None, state=None, maxResults=None)</a></code></p>
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">
87 <code><a href="#reveal">reveal(achievementId)</a></code></p>
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">
90 <code><a href="#setStepsAtLeast">setStepsAtLeast(achievementId, steps)</a></code></p>
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">
93 <code><a href="#unlock">unlock(achievementId)</a></code></p>
94<p class="firstline">Unlocks this achievement for the currently authenticated player.</p>
95<p class="toc_element">
96 <code><a href="#updateMultiple">updateMultiple(body)</a></code></p>
97<p class="firstline">Updates multiple achievements for the currently authenticated player.</p>
98<h3>Method Details</h3>
99<div class="method">
100 <code class="details" id="increment">increment(achievementId, stepsToIncrement, requestId=None)</code>
101 <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
112 "currentSteps": 42, # The current steps recorded for this incremental achievement.
113 "newlyUnlocked": True or False, # Whether the the current steps for the achievement has reached the number of steps required to unlock.
114 "kind": "games#achievementIncrementResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementIncrementResponse.
115 }</pre>
116</div>
117
118<div class="method">
119 <code class="details" id="list">list(playerId, language=None, pageToken=None, state=None, maxResults=None)</code>
120 <pre>Lists the progress for all your application's achievements for the currently authenticated player.
121
122Args:
123 playerId: string, A player ID. A value of me may be used in place of the authenticated player's ID. (required)
124 language: string, The preferred language to use for strings returned by this method.
125 pageToken: string, The token returned by the previous request.
126 state: string, Tells the server to return only achievements with the specified state. If this parameter isn't specified, all achievements are returned.
127 Allowed values
128 ALL - List all achievements. This is the default.
129 HIDDEN - List only hidden achievements.
130 REVEALED - List only revealed achievements.
131 UNLOCKED - List only unlocked achievements.
132 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.
133
134Returns:
135 An object of the form:
136
137 { # This is a JSON template for a list of achievement objects.
138 "nextPageToken": "A String", # Token corresponding to the next page of results.
139 "items": [ # The achievements.
140 { # This is a JSON template for an achievement object.
141 "achievementState": "A String", # The state of the achievement.
142 # Possible values are:
143 # - "HIDDEN" - Achievement is hidden.
144 # - "REVEALED" - Achievement is revealed.
145 # - "UNLOCKED" - Achievement is unlocked.
146 "kind": "games#playerAchievement", # Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievement.
147 "lastUpdatedTimestamp": "A String", # The timestamp of the last modification to this achievement's state.
148 "currentSteps": 42, # The current steps for an incremental achievement.
Craig Citro065b5302014-08-14 00:47:23 -0700149 "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 -0400150 "formattedCurrentStepsString": "A String", # The current steps for an incremental achievement as a string.
151 "id": "A String", # The ID of the achievement.
152 },
153 ],
154 "kind": "games#playerAchievementListResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#playerAchievementListResponse.
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
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:
167 A request object that you can call 'execute()' on to request the next
168 page. Returns None if there are no more items in the collection.
169 </pre>
170</div>
171
172<div class="method">
173 <code class="details" id="reveal">reveal(achievementId)</code>
174 <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
183 "kind": "games#achievementRevealResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementRevealResponse.
184 "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.
185 # Possible values are:
186 # - "REVEALED" - Achievement is revealed.
187 # - "UNLOCKED" - Achievement is unlocked.
188 }</pre>
189</div>
190
191<div class="method">
192 <code class="details" id="setStepsAtLeast">setStepsAtLeast(achievementId, steps)</code>
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
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.
203 "currentSteps": 42, # The current steps recorded for this incremental achievement.
204 "newlyUnlocked": True or False, # Whether the the current steps for the achievement has reached the number of steps required to unlock.
205 "kind": "games#achievementSetStepsAtLeastResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementSetStepsAtLeastResponse.
206 }</pre>
207</div>
208
209<div class="method">
210 <code class="details" id="unlock">unlock(achievementId)</code>
211 <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
220 "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).
221 "kind": "games#achievementUnlockResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUnlockResponse.
222 }</pre>
223</div>
224
225<div class="method">
226 <code class="details" id="updateMultiple">updateMultiple(body)</code>
227 <pre>Updates multiple achievements for the currently authenticated player.
228
229Args:
230 body: object, The request body. (required)
231 The object takes the form of:
232
233{ # This is a JSON template for a list of achievement update requests.
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.
236 { # This is a JSON template for a request to update an achievement.
237 "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.
238 "kind": "games#GamesAchievementSetStepsAtLeast", # Uniquely identifies the type of this resource. Value is always the fixed string games#GamesAchievementSetStepsAtLeast.
239 "steps": 42, # The minimum number of steps for the achievement to be set to.
240 },
241 "updateType": "A String", # The type of update being applied.
242 # Possible values are:
243 # - "REVEAL" - Achievement is revealed.
244 # - "UNLOCK" - Achievement is unlocked.
245 # - "INCREMENT" - Achievement is incremented.
246 # - "SET_STEPS_AT_LEAST" - Achievement progress is set to at least the passed value.
247 "kind": "games#achievementUpdateRequest", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateRequest.
248 "achievementId": "A String", # The achievement this update is being applied to.
249 "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.
250 "kind": "games#GamesAchievementIncrement", # Uniquely identifies the type of this resource. Value is always the fixed string games#GamesAchievementIncrement.
251 "steps": 42, # The number of steps to be incremented.
252 "requestId": "A String", # The requestId associated with an increment to an achievement.
253 },
254 },
255 ],
256 }
257
258
259Returns:
260 An object of the form:
261
262 { # This is a JSON template for an achievement unlock response.
263 "kind": "games#achievementUpdateMultipleResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateListResponse.
264 "updatedAchievements": [ # The updated state of the achievements.
265 { # This is a JSON template for an achievement update response.
266 "kind": "games#achievementUpdateResponse", # Uniquely identifies the type of this resource. Value is always the fixed string games#achievementUpdateResponse.
267 "achievementId": "A String", # The achievement this update is was applied to.
268 "currentSteps": 42, # The current steps recorded for this achievement if it is incremental.
269 "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).
270 "updateOccurred": True or False, # Whether the requested updates actually affected the achievement.
271 "currentState": "A String", # The current state of the achievement.
272 # Possible values are:
273 # - "HIDDEN" - Achievement is hidden.
274 # - "REVEALED" - Achievement is revealed.
275 # - "UNLOCKED" - Achievement is unlocked.
276 },
277 ],
278 }</pre>
279</div>
280
281</body></html>