title | language_tabs | language_clients | toc_footers | includes | search | highlight_theme | headingLevel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Stats service v0.0.1 |
|
|
true |
darkula |
2 |
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Because we need statistics
Base URLs:
License: Apache 2.0
Pokemon stats
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3337/pokemons/{id}/number-of-rounds \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3337/pokemons/{id}/number-of-rounds',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /pokemons/{id}/number-of-rounds
Number of rounds for a specific pokemon
Returns the number of rounds for a specific pokemon
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | PokemonID | true | Pokemon ID |
Example responses
200 Response
{
"id": 0,
"numberOfRounds": 0
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | Inline |
400 | Bad Request | An error caused by the client | Inline |
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» id | integer(int64) | false | none | Pokemon's id used in the request |
» numberOfRounds | integer(int64) | false | none | Number of rounds for this pokemon |
Status Code 400
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [AppError] | false | none | none |
» code | integer(int32) | true | none | Error code |
» message | string | true | none | Error message |
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3337/pokemons/{id}/number-of-victories \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3337/pokemons/{id}/number-of-victories',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /pokemons/{id}/number-of-victories
Number of victories for a specific pokemon
Returns the number of victories for a specific pokemon
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | PokemonID | true | Pokemon ID |
Example responses
200 Response
{
"id": 0,
"numberOfVictories": 0
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | Inline |
400 | Bad Request | An error caused by the client | Inline |
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» id | integer(int64) | false | none | Pokemon's id used in the request |
» numberOfVictories | integer(int64) | false | none | Number of victories for this pokemon |
Status Code 400
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [AppError] | false | none | none |
» code | integer(int32) | true | none | Error code |
» message | string | true | none | Error message |
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3337/pokemons/rounds \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3337/pokemons/rounds',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /pokemons/rounds
List of pokemons with their number of rounds
Returns the list of pokemons with their number of rounds
Example responses
200 Response
[
{
"id": 0,
"numberOfRounds": 0
}
]
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | ArrayOfPokemons |
Rounds stats
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3337/rounds/count-a-day-last-30-days \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3337/rounds/count-a-day-last-30-days',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /rounds/count-a-day-last-30-days
Number of rounds a day for the last 30 days. 1 round per player play. It means that's the double of rounds played
Example responses
200 Response
[
{
"date": "2019-08-24",
"numberOfRounds": 0
}
]
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | ArrayOfRounds |
Code samples
# You can also use wget
curl -X PUT http://127.0.0.1:3337/stats \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
const inputBody = '{
"idPokemon": 0,
"dateMatch": "2019-08-24T14:15:22Z",
"victory": true,
"idMatch": 0,
"team": 1
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http://127.0.0.1:3337/stats',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
PUT /stats
Upload stats
Upload stats
Body parameter
{
"idPokemon": 0,
"dateMatch": "2019-08-24T14:15:22Z",
"victory": true,
"idMatch": 0,
"team": 1
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | StatsDto | false | Stats to upload |
Example responses
200 Response
{
"idPokemon": 0,
"dateMatch": "2019-08-24T14:15:22Z",
"victory": true,
"idMatch": 0,
"team": 1
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | StatsDto |
400 | Bad Request | An error caused by the client | Inline |
Status Code 400
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [AppError] | false | none | none |
» code | integer(int32) | true | none | Error code |
» message | string | true | none | Error message |
{
"idPokemon": 0,
"dateMatch": "2019-08-24T14:15:22Z",
"victory": true,
"idMatch": 0,
"team": 1
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
idPokemon | integer(int64) | true | none | Pokemon's id |
dateMatch | string(date-time) | true | none | Date of the round |
victory | boolean | true | none | Victory (if true) or defeat |
idMatch | integer(int64) | true | none | Round's id |
team | integer | true | none | Team of the pokemon |
[
{
"date": "2019-08-24",
"numberOfRounds": 0
}
]
Array Of Rounds Stats
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Array Of Rounds Stats | [object] | false | none | Array of rounds |
date | string(date) | true | none | Date of the aggregated day |
numberOfRounds | integer(number) | true | none | Number of rounds for this day |
[
{
"id": 0,
"numberOfRounds": 0
}
]
Array Of Pokemons Stats
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Array Of Pokemons Stats | [object] | false | none | Array of pokemons |
id | integer(int64) | true | none | Pokemon's id |
numberOfRounds | integer(int64) | true | none | Number of rounds for this pokemon |
0
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | integer | false | none | none |
{
"code": 0,
"message": "Internal error"
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
code | integer(int32) | true | none | Error code |
message | string | true | none | Error message |