Blame view

api.raml 3.64 KB
90a48e21   Geoffrey PREUD'HOMME   Personnes
1
  #%RAML 0.8
ea2f57e1   Geoffrey PREUD'HOMME   Test API
2
3
4
  title: API d'Etunicorn
  baseUri: https://etunicorn.plil.net/{version}/
  version: v1
90a48e21   Geoffrey PREUD'HOMME   Personnes
5
6
  
  # Les codes 401 et 400 sont implicites
509e1d6e   Geoffrey PREUD'HOMME   API: Login
7
  /login:
b8824e3a   Geoffrey PREUD'HOMME   Avec le login, ce...
8
9
    post:
      description: Instancie une nouvelle connexion
90a48e21   Geoffrey PREUD'HOMME   Personnes
10
      queryParameters:
b8824e3a   Geoffrey PREUD'HOMME   Avec le login, ce...
11
12
13
14
15
16
17
18
19
20
21
22
23
        login:
          displayName: Login Polytech
          type: string
          required: true
        password:
          displayName: Mot de passe Polytech
          type: string
          required: false
      responses: 
        200:
          description: Authentification réussie
          body:
            application/json:
90a48e21   Geoffrey PREUD'HOMME   Personnes
24
              example: |
b8824e3a   Geoffrey PREUD'HOMME   Avec le login, ce...
25
26
27
28
29
30
                {
                  "token": "ooT6zahdura7vaethuiph1ugiph6co",
                  "expire": 1485607703
                }
        401:
          description: Authentication échouée
90a48e21   Geoffrey PREUD'HOMME   Personnes
31
32
33
34
35
36
37
38
    /{token}:
      delete:
        description: Se déconnecter
        responses: 
          204:
            description: Déconnecté avec succès
          404:
            description: Jeton non trouvé
ea2f57e1   Geoffrey PREUD'HOMME   Test API
39
  /personne:
509e1d6e   Geoffrey PREUD'HOMME   API: Login
40
41
42
43
44
45
    get:
     description: Obtenir la liste des persones
     responses: 
       200:
         body:
            application/json:
90a48e21   Geoffrey PREUD'HOMME   Personnes
46
              example: |
509e1d6e   Geoffrey PREUD'HOMME   API: Login
47
                [
90a48e21   Geoffrey PREUD'HOMME   Personnes
48
49
50
                 {
                    "id": 42,
                    "carte": "AAAAA",
509e1d6e   Geoffrey PREUD'HOMME   API: Login
51
52
                    "naissance": "1997-02-14",
                    "solde": 1337,
90a48e21   Geoffrey PREUD'HOMME   Personnes
53
                    "login": "gbontoux"
509e1d6e   Geoffrey PREUD'HOMME   API: Login
54
55
                  }
                ]
90a48e21   Geoffrey PREUD'HOMME   Personnes
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
    /{idPersonne}:
      get:
        description: Obtenir les infos sur une personne
        responses:
          200:
            description: Utilisateur récupéré
            body:
              application/json:
                example: |
                 {
                    "id": 42,
                    "carte": "AAAAA",
                    "naissance": "1997-02-14",
                    "solde": 1337,
                    "login": "gbontoux"
                  }
          404:
            description: Utilisateur non trouvé
      put:
        description: Modifer les infos d'une personne
        queryParameters:
          carte:
            displayName: ID de la carte NFC
            type: string
            required: false
            minLength: 14
            maxLength: 14
            example: 39cdd9ed0b191d
          naissance:
            displayName: Date de naissance
            type: date
            required: false
            example: 1997-02-14
          login:
            displayName: Login Polytech
            type: string
            required: false
            example: gbontoux
        responses:
          202:
            description: Utilisateur modifié
            body:
              application/json:
                example: |
                 {
                    "id": 42,
                    "carte": "AAAAA",
                    "naissance": "1997-02-14",
                    "solde": 1337,
                    "login": "gbontoux"
                  }
          404:
            description: Utilisateur non trouvé
      delete:
        description: Obtenir les infos sur une personne
        responses:
          204:
            description: Utilisateur supprimé
          404:
            description: Utilisateur non trouvé
    post:
      description: Ajoute une nouvelle personne
509e1d6e   Geoffrey PREUD'HOMME   API: Login
118
      queryParameters:
90a48e21   Geoffrey PREUD'HOMME   Personnes
119
        carte:
509e1d6e   Geoffrey PREUD'HOMME   API: Login
120
121
122
          displayName: ID de la carte NFC
          type: string
          required: false
90a48e21   Geoffrey PREUD'HOMME   Personnes
123
124
125
          minLength: 14
          maxLength: 14
          example: 39cdd9ed0b191d
509e1d6e   Geoffrey PREUD'HOMME   API: Login
126
127
        naissance:
          displayName: Date de naissance
90a48e21   Geoffrey PREUD'HOMME   Personnes
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
          type: date
          required: false
          example: 1997-02-14
        login:
          displayName: Login Polytech
          type: string
          required: false
          example: gbontoux
      responses: 
        201:
          description: Personne ajoutée avec succès
          body:
            application/json:
              example: |
                {
                  "id": 42
                }
          
          
509e1d6e   Geoffrey PREUD'HOMME   API: Login
147