1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
|
# Players
Player objects contain aggregated lifetime information about each Player. At this time Players are fairly sparse, but there are plans to add much richer data as it becomes available.
{% method %}
## Get a single Player
This endpoint retrieves a specific player.
* If a player has changed names, it is possible that there are multiple ID's for a single player name.
* Player renames do not trigger a change on this endpoint. A minimum of 1 match after the rename is required to view the change.
**Changes Coming!** - Player resources are not fully defined at this point, but are
included so that consumers can get basic info (name, etc.) This object will have
additional data added over the next few months, and may change slightly as data
moves from the `attributes.stats` object to the main `attributes` object.
{% sample lang="shell" %}
```shell
curl "https://api.dc01.gamelockerapp.com/shards/na/players/<ID>" \
-H "Authorization: Bearer <api-key>" \
-H "Accept: application/vnd.api+json"
```
{% sample lang="java" %}
```java
//There are a variety of Java HTTP libraries that support query-parameters.
```
{% sample lang="python" %}
```python
```
{% sample lang="ruby" %}
```ruby
```
{% sample lang="js" %}
```javascript
```
{% sample lang="go" %}
```go
```
{% sample lang="swift" %}
```swift
import Foundation
let urlString = "https://api.dc01.gamelockerapp.com/shards/na/players?filter[playerNames]=PlayerIGN"
let url = NSURL(string: urlString)
var downloadTask = URLRequest(url: (url as URL?)!, cachePolicy: URLRequest.CachePolicy.ReloadIgnoringCacheData, timeoutInterval: 20)
downloadTask.httpMethod = "GET"
downloadTask.addValue("apiKey", forHTTPHeaderField: "Authorization")
downloadTask.addValue("application/vnd.api+json", forHTTPHeaderField: "Accept")
URLSession.shared.dataTask(with: downloadTask) { (data, response, error) in
if let response = response {
print(response)
}
if let data = data {
do {
let jsonData = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? NSDictionary
print(jsonData!.value(forKey: "data") as Any)
} catch {
print(error)
}
}
}.resume()
```
{% common %}
> The above command returns JSON structured like this:
```json
{
"data": {
"attributes": {
"stats": {
"lossStreak": 1,
"winStreak": 0,
"lifetimeGold": 10536.0
},
"name": "boombastic04"
},
"type": "player",
"id": "6abb30de-7cb8-11e4-8bd3-06eb725f8a76"
}
}
```
{% endmethod %}
### HTTP Request
`GET https://api.dc01.gamelockerapp.com/shards/na/players/<ID>`
### URL Parameters
Parameter | Description
--------- | -----------
ID | The ID of the player to retrieve
{% method %}
## Get a collection of players
This endpoint retrieves a collection of up to 6 players, filtered by name. Player names are specific to each region.
{% sample lang="shell" %}
```shell
curl "https://api.dc01.gamelockerapp.com/shards/na/players?filter[playerNames]=player1,player2" \
-H "Authorization: Bearer <api-key>" \
-H "Accept: application/vnd.api+json"
```
{% sample lang="java" %}
```java
//There are a variety of Java HTTP libraries that support query-parameters.
```
{% sample lang="python" %}
```python
```
{% sample lang="ruby" %}
```ruby
```
{% sample lang="js" %}
```javascript
```
{% sample lang="go" %}
```go
```
{% sample lang="swift" %}
```swift
import Foundation
let urlString = "https://api.dc01.gamelockerapp.com/shards/na/players?filter[playerNames]=PlayerIGN1, PlayerIGN2, PlayerIGN3"
let url = NSURL(string: urlString)
var downloadTask = URLRequest(url: (url as URL?)!, cachePolicy: URLRequest.CachePolicy.ReloadIgnoringCacheData, timeoutInterval: 20)
downloadTask.httpMethod = "GET"
downloadTask.addValue("apiKey", forHTTPHeaderField: "Authorization")
downloadTask.addValue("application/vnd.api+json", forHTTPHeaderField: "Accept")
URLSession.shared.dataTask(with: downloadTask) { (data, response, error) in
if let response = response {
print(response)
}
if let data = data {
do {
let jsonData = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? NSDictionary
print(jsonData!.value(forKey: "data") as Any)
} catch {
print(error)
}
}
}.resume()
```
{% endmethod %}
### HTTP Request
`GET https://api.dc01.gamelockerapp.com/shards/na/players`
### Query Parameters
Parameter | Default | Description
--------- | ------- | -----------
filter[playerNames] | none | Filters by player names. Usage: filter[playerNames]=player1,player2
|