title | language_tabs | language_clients | toc_footers | includes | search | highlight_theme | headingLevel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Round 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.
To manage rounds in a match
Base URLs:
License: Apache 2.0
- HTTP Authentication, scheme: bearer
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3335/api \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3335/api',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /api
Check is the api is up
Example responses
200 Response
{
"message": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | Inline |
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» message | string | false | none | none |
Pokemon infos
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3335/pokemons \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3335/pokemons',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /pokemons
Get the list of existing pokemons
Example responses
200 Response
[
{
"id": 0,
"name": "string",
"types": [
{
"id": 0,
"name": "string",
"faiblesses": [
"string"
],
"resistances": [
"string"
]
}
]
}
]
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The list of pokemons | Inline |
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [Pokemon] | false | none | [A POKEMON :o] |
» Pokemon | Pokemon | false | none | A POKEMON :o |
»» id | integer(int64) | false | none | Pokemon's id |
»» name | string | false | none | Pokemon's name |
»» types | [TypePokemon] | false | none | List of the types for this pokemon |
»»» TypePokemon | TypePokemon | false | none | A POKEMON TYPE :o |
»»»» id | integer(int64) | false | none | id of the type |
»»»» name | string | false | none | label of the type |
»»»» faiblesses | [string] | false | none | list of weakness for a type |
»»»» resistances | [string] | false | none | list of weakness for a type |
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3335/pokemons/{id} \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3335/pokemons/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /pokemons/{id}
Get the pokemon for a given id
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | Pokemon ID |
Example responses
200 Response
{
"id": 0,
"name": "string",
"types": [
{
"id": 0,
"name": "string",
"faiblesses": [
"string"
],
"resistances": [
"string"
]
}
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The pokemon for a given id | Pokemon |
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3335/pokemons/name/{name} \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3335/pokemons/name/{name}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /pokemons/name/{name}
Get the pokemon for a given name
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | Pokemon name |
Example responses
200 Response
{
"id": 0,
"name": "string",
"types": [
{
"id": 0,
"name": "string",
"faiblesses": [
"string"
],
"resistances": [
"string"
]
}
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The pokemon for a given name | Pokemon |
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3335/types \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3335/types',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /types
Get the list of existing types
Example responses
200 Response
[
{
"id": 0,
"name": "string",
"faiblesses": [
"string"
],
"resistances": [
"string"
]
}
]
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The list of types | Inline |
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [TypePokemon] | false | none | [A POKEMON TYPE :o] |
» TypePokemon | TypePokemon | false | none | A POKEMON TYPE :o |
»» id | integer(int64) | false | none | id of the type |
»» name | string | false | none | label of the type |
»» faiblesses | [string] | false | none | list of weakness for a type |
»» resistances | [string] | false | none | list of weakness for a type |
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3335/types/{id} \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3335/types/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /types/{id}
Get the type for a given id
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | integer | true | type ID |
Example responses
200 Response
{
"id": 0,
"name": "string",
"faiblesses": [
"string"
],
"resistances": [
"string"
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The type for a given id | TypePokemon |
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3335/types/name/{name} \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3335/types/name/{name}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /types/name/{name}
Get the type for a given name
Name | In | Type | Required | Description |
---|---|---|---|---|
name | path | string | true | type name |
Example responses
200 Response
{
"id": 0,
"name": "string",
"faiblesses": [
"string"
],
"resistances": [
"string"
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The type for a given name | TypePokemon |
rounds infos
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3335/round/{id1}/{id2} \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3335/round/{id1}/{id2}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /round/{id1}/{id2}
Get the result of a round for two given pokemon ids
Name | In | Type | Required | Description |
---|---|---|---|---|
id1 | path | string | true | pokemon1 id |
id2 | path | string | true | pokemon2 id |
Example responses
200 Response
{
"id": 0,
"name": "string",
"types": [
{
"id": 0,
"name": "string",
"faiblesses": [
"string"
],
"resistances": [
"string"
]
}
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The winning pokemon | Pokemon |
Code samples
# You can also use wget
curl -X GET http://127.0.0.1:3335/round/name/{name1}/{name2} \
-H 'Accept: application/json'
const headers = {
'Accept':'application/json'
};
fetch('http://127.0.0.1:3335/round/name/{name1}/{name2}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
GET /round/name/{name1}/{name2}
Get the result of a round for two given pokemon names
Name | In | Type | Required | Description |
---|---|---|---|---|
name1 | path | string | true | pokemon1 name |
name2 | path | string | true | pokemon2 name |
Example responses
200 Response
{
"id": 0,
"name": "string",
"types": [
{
"id": 0,
"name": "string",
"faiblesses": [
"string"
],
"resistances": [
"string"
]
}
]
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The winning pokemon | Pokemon |
Code samples
# You can also use wget
curl -X PUT http://127.0.0.1:3335/match \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
const inputBody = '{
"idMatch": 0,
"idxPokemonDeck": 0
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('http://127.0.0.1:3335/match',
{
method: 'PUT',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
PUT /match
Play the round for a given user and a given match
Body parameter
{
"idMatch": 0,
"idxPokemonDeck": 0
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | false | none |
Example responses
200 Response
{
"roundWinner": 0,
"pokemonWinner": 0,
"roundLooser": 0,
"pokemonLooser": 0,
"roundIndex": 9
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | The winning pokemon | RoundResultDto |
408 | Request Timeout | Timeout the other player didn't responded within the allowed delay | None |
{
"id": 0,
"name": "string",
"types": [
{
"id": 0,
"name": "string",
"faiblesses": [
"string"
],
"resistances": [
"string"
]
}
]
}
Pokemon
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer(int64) | false | none | Pokemon's id |
name | string | false | none | Pokemon's name |
types | [TypePokemon] | false | none | List of the types for this pokemon |
{
"id": 0,
"name": "string",
"faiblesses": [
"string"
],
"resistances": [
"string"
]
}
TypePokemon
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | integer(int64) | false | none | id of the type |
name | string | false | none | label of the type |
faiblesses | [string] | false | none | list of weakness for a type |
resistances | [string] | false | none | list of weakness for a type |
{
"roundWinner": 0,
"pokemonWinner": 0,
"roundLooser": 0,
"pokemonLooser": 0,
"roundIndex": 9
}
RoundResultDto
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
roundWinner | integer | true | none | the id of the winner |
pokemonWinner | integer | true | none | the pokeApi id of the winner's pokemon |
roundLooser | integer | true | none | the id of the looser |
pokemonLooser | integer | true | none | the pokeApi id of the looser's pokemon |
roundIndex | integer | true | none | the index of the round |