The same polls and two-player game as on affectionplus.com and in the AffectionPlus mobile app, so that results are shared wherever people play. Anyone can use this API: no account, no sign-up, and no personal data required.
Base URL: https://api.affection.org · Machine-readable description: OpenAPI 3.0 · All responses are JSON.
| Method | Path | Purpose |
|---|---|---|
GET | /api/sondage?s={poll}&l={language}&p={country} | Results of one poll |
POST | /api/sondage | Vote: { s, c, l, p, j } |
GET | /api/sondage/barometre | Results of all polls, refreshed every five minutes |
Poll ids, questions and choices in nine languages: sondages.json. j is a random token of 16 to 64 characters (letters, digits, _, -) that identifies no one; a second vote with the same token replaces the first.
curl -X POST https://api.affection.org/api/sondage -H 'Content-Type: application/json' \
-d '{"s":"sortie-ideale","c":1,"l":"en","j":"a-random-token-1234"}'
Each player answers questions about themselves, then guesses the other player's answers. A game started on one platform can be finished on another with its six-character code.
| Method | Path | Purpose |
|---|---|---|
POST | /api/jeu | Create a game: { l, prenom } returns { code, j } |
GET | /api/jeu/invitation?code={code} | Host first name and whether a seat is free |
POST | /api/jeu/rejoindre | Join: { code, prenom } returns { j, hote } |
POST | /api/jeu/reponses | Send answers: { code, j, moi, devine } |
GET | /api/jeu?code={code}&j={token} | State of the game, with the results once both players have finished |
j is a secret token per player: keep it private. Number of choices per question: jeu2.json.
429.{ "ok": false, "erreur": "<code>" } with status 400, 403, 404, 409, 429 or 503.