Tutoriels & RéférenceREST API
Référence API REST brute
Spécification complète des endpoints HTTP pour Godot, Unity, Unreal Engine ou Web.
Cette référence technique décrit les endpoints HTTP de l'API publique d'Angon Cloud. Elle s'adresse aux développeurs intégrant Angon Cloud dans d'autres moteurs de jeu (Godot, Unity, Unreal Engine, Pygame, Phaser...) ou souhaitant automatiser des flux personnalisés.
URL de base & En-têtes obligatoires
Toutes les requêtes doivent cibler le chemin :
https://votre-console.angon.cloud/api/public/v1
| En-tête | Obligatoire | Description |
|---|---|---|
| x-api-key | Oui | Clé d'API publique de votre jeu |
| x-player-token | Selon droits | Jeton de session obtenu lors du login du joueur |
| Content-Type | Oui (POST/PATCH) | Toujours valoir application/json |
Format des réponses & Erreurs standardisées
Toutes les réponses renvoient du JSON. En cas de succès :
Réponse de succès type
{
"ok": true,
"data": { ... }
}En cas d'erreur (HTTP 4xx ou 5xx) :
Réponse d'erreur type
{
"error": "code_technique",
"message": "Message lisible compréhensible par le joueur"
}1. Endpoints Joueurs & Authentification
POST/players/register
Exemple cURL — Inscription
curl -X POST "https://votre-console.angon.cloud/api/public/v1/players/register" \
-H "Content-Type: application/json" \
-H "x-api-key: VOTRE_CLE_API" \
-d '{
"pseudo": "PlayerOne",
"email": "player@example.com",
"password": "MonMotDePasse123",
"pays": "FR"
}'POST/players/login
Exemple cURL — Connexion
curl -X POST "https://votre-console.angon.cloud/api/public/v1/players/login" \
-H "Content-Type: application/json" \
-H "x-api-key: VOTRE_CLE_API" \
-d '{
"identifiant": "PlayerOne",
"password": "MonMotDePasse123"
}'2. Endpoints Tables de données
GET/tables/:nomTable
Exemple cURL — Lister les lignes avec filtres
curl -X GET "https://votre-console.angon.cloud/api/public/v1/tables/inventaire?limit=25&order_by=rarete&order_dir=desc" \
-H "x-api-key: VOTRE_CLE_API" \
-H "x-player-token: JETON_DU_JOUEUR"POST/tables/:nomTable
Exemple cURL — Créer une ligne
curl -X POST "https://votre-console.angon.cloud/api/public/v1/tables/inventaire" \
-H "Content-Type: application/json" \
-H "x-api-key: VOTRE_CLE_API" \
-H "x-player-token: JETON_DU_JOUEUR" \
-d '{
"donnees": {
"item_id": "epee_legendaire",
"quantite": 1,
"rarete": "legendaire"
}
}'3. Endpoints Stockage de fichiers
POST/storage/upload
Exemple cURL — Téléverser un fichier texte / JSON
curl -X POST "https://votre-console.angon.cloud/api/public/v1/storage/upload" \
-H "Content-Type: application/json" \
-H "x-api-key: VOTRE_CLE_API" \
-H "x-player-token: JETON_DU_JOUEUR" \
-d '{
"nom": "sauvegarde.json",
"contenu": "{\"score\": 1500, \"niveau\": 5}",
"mime_type": "application/json",
"ecraser": true
}'4. Endpoints Classements
POST/leaderboards/:id/submit
Exemple cURL — Soumettre un score
curl -X POST "https://votre-console.angon.cloud/api/public/v1/leaderboards/course_infinie/submit" \
-H "Content-Type: application/json" \
-H "x-api-key: VOTRE_CLE_API" \
-H "x-player-token: JETON_DU_JOUEUR" \
-d '{
"valeur": 4520
}'GET/leaderboards/:id/scores
Exemple cURL — Récupérer le top 50
curl -X GET "https://votre-console.angon.cloud/api/public/v1/leaderboards/course_infinie/scores?limit=50" \
-H "x-api-key: VOTRE_CLE_API"5. Endpoints Boutique
GET/shop/articles
Exemple cURL — Liste des articles actifs
curl -X GET "https://votre-console.angon.cloud/api/public/v1/shop/articles" \
-H "x-api-key: VOTRE_CLE_API"6. Endpoints Multijoueur & Matchmaking
Le matchmaking est atomique côté serveur : il suffit de rejoindre la file d'un mode (ex: "1v1", "2v2") puis d'interroger le statut jusqu'à ce qu'un salon soit formé. L'en-tête x-player-token est obligatoire.
POST/matchmaking/join
Exemple cURL — Rejoindre la file d'attente
curl -X POST "https://votre-console.angon.cloud/api/public/v1/matchmaking/join" \
-H "Content-Type: application/json" \
-H "x-api-key: VOTRE_CLE_API" \
-H "x-player-token: JETON_DU_JOUEUR" \
-d '{
"mode_jeu": "2v2",
"elo_actuel": 1250
}'
# Réponse "en attente" :
# { "ok": true, "status": "waiting", "queue_id": "...", "position": 1 }
#
# Réponse "salon formé" :
# { "ok": true, "status": "matched", "partie_id": "...", "code_salon": "SALON_EF5D0",
# "equipe": 2, "participants": [ { "joueur_id": "...", "pseudo": "...", "equipe": 1 } ] }GET/matchmaking/status
Exemple cURL — Statut du joueur (idle | waiting | matched)
curl -X GET "https://votre-console.angon.cloud/api/public/v1/matchmaking/status" \
-H "x-api-key: VOTRE_CLE_API" \
-H "x-player-token: JETON_DU_JOUEUR"POST/matchmaking/leave
Exemple cURL — Quitter la file d'attente
curl -X POST "https://votre-console.angon.cloud/api/public/v1/matchmaking/leave" \
-H "x-api-key: VOTRE_CLE_API" \
-H "x-player-token: JETON_DU_JOUEUR"GET/realtime/config
Exemple cURL — Configuration du canal temps-réel des salons
curl -X GET "https://votre-console.angon.cloud/api/public/v1/realtime/config" \
-H "x-api-key: VOTRE_CLE_API"
# { "ok": true, "url": "wss://.../realtime/v1/websocket", "key": "cle_publique",
# "channel_prefix": "angon_partie_" }
# Canal Broadcast d'un salon : angon_partie_<partie_id>POST/match/action
Exemple cURL — Action de match via le relais serveur (règles action_partie)
curl -X POST "https://votre-console.angon.cloud/api/public/v1/match/action" \
-H "Content-Type: application/json" \
-H "x-api-key: VOTRE_CLE_API" \
-H "x-player-token: JETON_DU_JOUEUR" \
-d '{
"partie_id": "uuid-de-la-partie",
"action": "coup",
"donnees": { "plateau": "..." }
}'
# { "ok": true, "partie": { "statut": "en_cours", "tour_joueur": "...", ... } }
# ou { "error": "action_refusee", "reason": "pas_ton_tour" } si une règle refuse.
# L'action est ensuite rediffusée au salon (event "action") et l'état
# officiel persisté est rediffusé aussi (event "etat").GET/match/state
Exemple cURL — État autoritaire de la partie (participants uniquement)
curl -X GET "https://votre-console.angon.cloud/api/public/v1/match/state?partie_id=uuid" \
-H "x-api-key: VOTRE_CLE_API" \
-H "x-player-token: JETON_DU_JOUEUR"
# { "ok": true, "partie": { "statut", "tour_joueur", "numero_tour",
# "etat_plateau", "participants", "gagnant_id", ... } }