Types d’équipement¶
- GET /api/equipment-types¶
Obtenir tous les types d’équipement
Scope :
equipments:read
Exemple de requête :
GET /api/equipment-types HTTP/1.1 Content-Type: application/json
Exemple de réponse :
pour un utilisateur non admin :
HTTP/1.1 200 OK Content-Type: application/json { "data": { "equipment_types": [ { "id": 1, "is_active": true, "label": "Shoe" }, { "id": 2, "is_active": true, "label": "Bike" }, { "id": 3, "is_active": true, "label": "Bike Trainer" }, { "id": 4, "is_active": true, "label": "Kayak_Boat" }, { "id": 5, "is_active": true, "label": "Skis" }, { "id": 5, "is_active": true, "label": "Snowshoes" } ] }, "status": "success" }
pour un administrateur :
HTTP/1.1 200 OK Content-Type: application/json { "data": { "equipment_types": [ { "has_equipments": true, "id": 1, "is_active": true, "label": "Shoe" }, { "has_equipments": true, "id": 2, "is_active": true, "label": "Bike" }, { "has_equipments": false, "id": 3, "is_active": true, "label": "Bike Trainer" }, { "has_equipments": false, "id": 4, "is_active": true, "label": "Kayak_Boat" }, { "has_equipments": false, "id": 5, "is_active": true, "label": "Skis" }, { "has_equipments": false, "id": 6, "is_active": true, "label": "Snowshoes" } ] }, "status": "success" }
- En-têtes de requête:
Authorization – Jeton “OAuth 2.0 Bearer”
- Codes d’état:
200 OK – succès
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions
- GET /api/equipment-types/(int: equipment_type_id)¶
Obtenir un type d’équipement
Scope :
equipments:read
Exemple de requête :
GET /api/equipment-types/2 HTTP/1.1 Content-Type: application/json
Exemple de réponse :
succès pour un utilisateur non admin :
HTTP/1.1 200 OK Content-Type: application/json { "data": { "equipment_types": [ { "id": 2, "is_active": true, "label": "Bike" } ] }, "status": "success" }
succès pour un administrateur :
HTTP/1.1 200 OK Content-Type: application/json { "data": { "equipment_types": [ { "has_equipments": true, "id": 2, "is_active": true, "label": "Bike" } ] }, "status": "success" }
type d’équipement non trouvé
HTTP/1.1 404 NOT FOUND Content-Type: application/json { "status": "not found", "data": { "equipment_types": [] } }
- Paramètres:
equipment_type_id (integer) – id du type d’équipement
- En-têtes de requête:
Authorization – Jeton “OAuth 2.0 Bearer”
- Codes d’état:
200 OK – succès
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions
404 Not Found –
equipment_type not found
- PATCH /api/equipment-types/(int: equipment_type_id)¶
Modifier un type d’équipement pour le (dés)activer.
L’utilisateur authentifié doit avoir des droits d’administration.
Scope :
equipments:write
Exemple de requête :
PATCH /api/equipment-types/2 HTTP/1.1 Content-Type: application/json
Exemple de réponse :
succès :
HTTP/1.1 200 OK Content-Type: application/json { "data": { "equipment_types": [ { "has_equipments": true, "id": 2, "is_active": true, "label": "Bike" } ] }, "status": "success" }
- Paramètres:
equipment_type_id (integer) – id du type d’équipement
- Objet JSON de requête:
is_active (boolean) – état d’activation du type d’équipement
- En-têtes de requête:
Authorization – Jeton “OAuth 2.0 Bearer”
- Codes d’état:
200 OK – succès
400 Bad Request –
invalid payload
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions
404 Not Found –
equipment_type not found
500 Internal Server Error –
error, please try again or contact the administrator