Commentaires¶ GET /api/workouts/(string: workout_short_id)/comments¶ Obtenir les commentaires de le séance. Retourne uniquement les commentaires visibles par l’utilisateur authentifié et les commentaires publiques sans authentification. Scope : workouts:read Exemple de requête : GET /api/workouts/2oRDfncv6vpRkfp3yrCYHt/comments HTTP/1.1 Content-Type: application/json Exemple de réponse : HTTP/1.1 200 OK Content-Type: application/json { "data": { "comments": [ { "created_at": "Sun, 01 Dec 2024 13:45:34 GMT", "id": "WJgTwtqFpnPrHYAK5eX9Pw", "liked": false, "likes_count": 0, "mentions": [], "modification_date": null, "suspended_at": null, "text": "Great!", "text_html": "Great!", "text_visibility": "private", "user": { "created_at": "Sun, 24 Nov 2024 16:52:14 GMT", "followers": 3, "following": 2, "nb_workouts": 10, "picture": true, "role": "user", "suspended_at": null, "username": "Sam" }, "workout_id": "2oRDfncv6vpRkfp3yrCYHt" } ] }, "status": "success" } Paramètres: workout_short_id (string) – identifiant court de la séance En-têtes de requête: Authorization – Jeton “OAuth 2.0 Bearer” pour les commentaires avec une visibilité private et``followers_only`` Codes d’état: 200 OK – success 401 Unauthorized – provide a valid auth token signature expired, please log in again invalid token, please log in again 403 Forbidden – you do not have permissions, your account is suspended 404 Not Found – workout not found 500 Internal Server Error – Error during comment save. GET /api/comments/(string: comment_short_id)¶ Obtenir le commentaire. Scope : workouts:read Exemple de requête : GET /api/workouts/2oRDfncv6vpRkfp3yrCYHt/comment HTTP/1.1 Content-Type: application/json Exemple de réponse : HTTP/1.1 200 OK Content-Type: application/json { "comment": { "created_at": "Sun, 01 Dec 2024 13:45:34 GMT", "id": "T2zeeUXvuy3PLA8MeeUFyk", "liked": false, "likes_count": 0, "mentions": [], "modification_date": null, "suspended_at": null, "text": "Nice!", "text_html": "Nice!", "text_visibility": "private", "user": { "created_at": "Sun, 24 Nov 2024 16:52:14 GMT", "followers": 3, "following": 2, "nb_workouts": 10, "picture": true, "role": "user", "suspended_at": null, "username": "Sam" }, "workout_id": null }, "status": "success" } Paramètres: comment_short_id (string) – identifiant court du commentaire En-têtes de requête: Authorization – Jeton “OAuth 2.0 Bearer” pour le commentaire avec une visibilité private et followers_only Codes d’état: 200 OK – success 401 Unauthorized – provide a valid auth token signature expired, please log in again invalid token, please log in again 403 Forbidden – you do not have permissions, your account is suspended 404 Not Found – workout comment not found POST /api/workouts/(string: workout_short_id)/comments¶ Poster un commentaire. Scope : workouts:write Exemple de requête : POST /api/workouts/2oRDfncv6vpRkfp3yrCYHt HTTP/1.1 Content-Type: application/json Exemple de réponse : HTTP/1.1 200 OK Content-Type: application/json { "comment": { "created_at": "Sun, 01 Dec 2024 13:45:34 GMT", "id": "WJgTwtqFpnPrHYAK5eX9Pw", "liked": false, "likes_count": 0, "mentions": [], "modification_date": null, "suspended_at": null, "text": "Great!", "text_html": "Great!", "text_visibility": "private", "user": { "created_at": "Sun, 24 Nov 2024 16:52:14 GMT", "followers": 3, "following": 2, "nb_workouts": 10, "picture": true, "role": "user", "suspended_at": null, "username": "Sam" }, "workout_id": "2oRDfncv6vpRkfp3yrCYHt" }, "status": "created" } Paramètres: workout_short_id (string) – identifiant court de la séance Objet JSON de requête: text (string) – contenu du commentaire text_visibility (string) – niveau de visibilité (public, followers_only, private) En-têtes de requête: Authorization – Jeton “OAuth 2.0 Bearer” Codes d’état: 201 Created – created 400 Bad Request – invalid payload 401 Unauthorized – provide a valid auth token signature expired, please log in again invalid token, please log in again 403 Forbidden – you do not have permissions, your account is suspended 404 Not Found – workout not found 500 Internal Server Error – Error during comment save. PATCH /api/comments/(string: comment_short_id)¶ Mettre à jour le texte du commentaire. Scope : workouts:write Exemple de requête : PATCH /api/workouts/WJgTwtqFpnPrHYAK5eX9Pw HTTP/1.1 Content-Type: application/json Exemple de réponse : HTTP/1.1 200 OK Content-Type: application/json { "comment": { "created_at": "Sun, 01 Dec 2024 13:45:34 GMT", "id": "WJgTwtqFpnPrHYAK5eX9Pw", "liked": false, "likes_count": 0, "mentions": [], "modification_date": null, "suspended_at": null, "text": "Great!", "text_html": "Great!", "text_visibility": "private", "user": { "created_at": "Sun, 24 Nov 2024 16:52:14 GMT", "followers": 3, "following": 2, "nb_workouts": 10, "picture": true, "role": "user", "suspended_at": null, "username": "Sam" }, "workout_id": "2oRDfncv6vpRkfp3yrCYHt" }, "status": "success" } Paramètres: comment_short_id (string) – identifiant court du commentaire Objet JSON de requête: text (string) – contenu du commentaire En-têtes de requête: Authorization – Jeton “OAuth 2.0 Bearer” Codes d’état: 200 OK – success 400 Bad Request – invalid payload 401 Unauthorized – provide a valid auth token signature expired, please log in again invalid token, please log in again 403 Forbidden – you do not have permissions you do not have permissions, your account is suspended 404 Not Found – comment not found 500 Internal Server Error – error, please try again or contact the administrator POST /api/comments/(string: comment_short_id)/like¶ Ajouter un « like » au commentaire. Scope : workouts:write Exemple de requête : POST /api/comments/WJgTwtqFpnPrHYAK5eX9Pw/like HTTP/1.1 Content-Type: application/json Exemple de réponse : HTTP/1.1 200 OK Content-Type: application/json { "comment": { "created_at": "Sun, 01 Dec 2024 13:45:34 GMT", "id": "WJgTwtqFpnPrHYAK5eX9Pw", "liked": true, "likes_count": 1, "mentions": [], "modification_date": null, "suspended_at": null, "text": "Great!", "text_html": "Great!", "text_visibility": "private", "user": { "created_at": "Sun, 24 Nov 2024 16:52:14 GMT", "followers": 3, "following": 2, "nb_workouts": 10, "picture": true, "role": "user", "suspended_at": null, "username": "Sam" }, "workout_id": "2oRDfncv6vpRkfp3yrCYHt" }, "status": "success" } Paramètres: comment_short_id (string) – identifiant court du commentaire En-têtes de requête: Authorization – Jeton “OAuth 2.0 Bearer” Codes d’état: 200 OK – success 401 Unauthorized – provide a valid auth token signature expired, please log in again invalid token, please log in again 403 Forbidden – you do not have permissions you do not have permissions, your account is suspended 404 Not Found – comment not found POST /api/comments/(string: comment_short_id)/like/undo¶ Supprimer le « like » du commentaire. Scope : workouts:write Exemple de requête : POST /api/comments/2oRDfncv6vpRkfp3yrCYHt/like/undo HTTP/1.1 Content-Type: application/json Exemple de réponse : HTTP/1.1 200 OK Content-Type: application/json { "comment": { "created_at": "Sun, 01 Dec 2024 13:45:34 GMT", "id": "WJgTwtqFpnPrHYAK5eX9Pw", "liked": false, "likes_count": 0, "mentions": [], "modification_date": null, "suspended_at": null, "text": "Great!", "text_html": "Great!", "text_visibility": "private", "user": { "created_at": "Sun, 24 Nov 2024 16:52:14 GMT", "followers": 3, "following": 2, "nb_workouts": 10, "picture": true, "role": "user", "suspended_at": null, "username": "Sam" }, "workout_id": "2oRDfncv6vpRkfp3yrCYHt" }, "status": "success" } Paramètres: comment_short_id (string) – identifiant court du commentaire En-têtes de requête: Authorization – Jeton “OAuth 2.0 Bearer” Codes d’état: 200 OK – success 401 Unauthorized – provide a valid auth token signature expired, please log in again invalid token, please log in again 403 Forbidden – you do not have permissions you do not have permissions, your account is suspended 404 Not Found – comment not found GET /api/comments/(string: comment_short_id)/likes¶ Obtenir la liste des utilisateurs qui ont « liké » le commentaire Scope : workouts:read Exemple de requête : POST /api/comments/WJgTwtqFpnPrHYAK5eX9Pw/likes HTTP/1.1 Content-Type: application/json Exemple de réponse : HTTP/1.1 200 OK Content-Type: application/json { "data": { "likes": [ { "created_at": "Sun, 31 Dec 2017 09:00:00 GMT", "followers": 0, "following": 0, "nb_workouts": 1, "picture": false, "role": "user", "suspended_at": null, "username": "Sam" } ] }, "status": "success" } Paramètres: comment_short_id (string) – identifiant court du commentaire Paramètres de requête: page (integer) – page si pagination (par défaut : 1) En-têtes de requête: Authorization – Jeton “OAuth 2.0 Bearer” pour le commentaire avec une visibilité private et followers_only Codes d’état: 200 OK – success 401 Unauthorized – provide a valid auth token signature expired, please log in again invalid token, please log in again 403 Forbidden – you do not have permissions you do not have permissions, your account is suspended 404 Not Found – comment not found POST /api/comments/(string: comment_short_id)/suspension/appeal¶ Faire appel de la suspension du commentaire. Seul l’auteur du commentaire peut faire appel de la suspension. Scope : workouts:write Exemple de requête : POST /api/comments/WJgTwtqFpnPrHYAK5eX9Pw/suspension/appeal HTTP/1.1 Content-Type: application/json Exemple de réponse : HTTP/1.1 201 CREATED Content-Type: application/json { "status": "success" } Paramètres: comment_short_id (string) – identifiant court du commentaire En-têtes de requête: Authorization – Jeton “OAuth 2.0 Bearer” Codes d’état: 201 Created – appel créé 400 Bad Request – no text provided you can appeal only once workout comment is not suspended workout comment has no suspension 401 Unauthorized – provide a valid auth token signature expired, please log in again invalid token, please log in again 403 Forbidden – you do not have permissions you do not have permissions, your account is suspended 404 Not Found – comment not found 500 Internal Server Error – error, please try again or contact the administrator DELETE /api/comments/(string: comment_short_id)¶ Supprimer le commentaire de la séance. Scope : workouts:write Exemple de requête : DELETE /api/comments/MzydiCYYfktG3gga2x8AfU HTTP/1.1 Content-Type: application/json Exemple de réponse : HTTP/1.1 204 NO CONTENT Content-Type: application/json Paramètres: comment_short_id (string) – identifiant court du commentaire En-têtes de requête: Authorization – Jeton “OAuth 2.0 Bearer” Codes d’état: 204 No Content – commentaire supprimé 401 Unauthorized – provide a valid auth token signature expired, please log in again invalid token, please log in again 403 Forbidden – you do not have permissions you do not have permissions, your account is suspended 404 Not Found – comment not found 500 Internal Server Error – error, please try again or contact the administrator
Commentaires¶
Obtenir les commentaires de le séance.
Retourne uniquement les commentaires visibles par l’utilisateur authentifié et les commentaires publiques sans authentification.
Scope :
workouts:read
Exemple de requête :
Exemple de réponse :
workout_short_id (string) – identifiant court de la séance
Authorization – Jeton “OAuth 2.0 Bearer” pour les commentaires avec une visibilité
private
et``followers_only``200 OK –
success
401 Unauthorized –
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions, your account is suspended
404 Not Found –
workout not found
500 Internal Server Error –
Error during comment save.
Obtenir le commentaire.
Scope :
workouts:read
Exemple de requête :
Exemple de réponse :
comment_short_id (string) – identifiant court du commentaire
Authorization – Jeton “OAuth 2.0 Bearer” pour le commentaire avec une visibilité
private
etfollowers_only
200 OK –
success
401 Unauthorized –
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions, your account is suspended
404 Not Found –
workout comment not found
Poster un commentaire.
Scope :
workouts:write
Exemple de requête :
Exemple de réponse :
workout_short_id (string) – identifiant court de la séance
text (string) – contenu du commentaire
text_visibility (string) – niveau de visibilité (
public
,followers_only
,private
)Authorization – Jeton “OAuth 2.0 Bearer”
201 Created –
created
400 Bad Request –
invalid payload
401 Unauthorized –
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions, your account is suspended
404 Not Found –
workout not found
500 Internal Server Error –
Error during comment save.
Mettre à jour le texte du commentaire.
Scope :
workouts:write
Exemple de requête :
Exemple de réponse :
comment_short_id (string) – identifiant court du commentaire
text (string) – contenu du commentaire
Authorization – Jeton “OAuth 2.0 Bearer”
200 OK –
success
400 Bad Request –
invalid payload
401 Unauthorized –
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions
you do not have permissions, your account is suspended
404 Not Found –
comment not found
500 Internal Server Error –
error, please try again or contact the administrator
Ajouter un « like » au commentaire.
Scope :
workouts:write
Exemple de requête :
Exemple de réponse :
comment_short_id (string) – identifiant court du commentaire
Authorization – Jeton “OAuth 2.0 Bearer”
200 OK –
success
401 Unauthorized –
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions
you do not have permissions, your account is suspended
404 Not Found –
comment not found
Supprimer le « like » du commentaire.
Scope :
workouts:write
Exemple de requête :
Exemple de réponse :
comment_short_id (string) – identifiant court du commentaire
Authorization – Jeton “OAuth 2.0 Bearer”
200 OK –
success
401 Unauthorized –
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions
you do not have permissions, your account is suspended
404 Not Found –
comment not found
Obtenir la liste des utilisateurs qui ont « liké » le commentaire
Scope :
workouts:read
Exemple de requête :
Exemple de réponse :
comment_short_id (string) – identifiant court du commentaire
page (integer) – page si pagination (par défaut : 1)
Authorization – Jeton “OAuth 2.0 Bearer” pour le commentaire avec une visibilité
private
etfollowers_only
200 OK –
success
401 Unauthorized –
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions
you do not have permissions, your account is suspended
404 Not Found –
comment not found
Faire appel de la suspension du commentaire.
Seul l’auteur du commentaire peut faire appel de la suspension.
Scope :
workouts:write
Exemple de requête :
Exemple de réponse :
comment_short_id (string) – identifiant court du commentaire
Authorization – Jeton “OAuth 2.0 Bearer”
201 Created – appel créé
400 Bad Request –
no text provided
you can appeal only once
workout comment is not suspended
workout comment has no suspension
401 Unauthorized –
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions
you do not have permissions, your account is suspended
404 Not Found –
comment not found
500 Internal Server Error –
error, please try again or contact the administrator
Supprimer le commentaire de la séance.
Scope :
workouts:write
Exemple de requête :
Exemple de réponse :
comment_short_id (string) – identifiant court du commentaire
Authorization – Jeton “OAuth 2.0 Bearer”
204 No Content – commentaire supprimé
401 Unauthorized –
provide a valid auth token
signature expired, please log in again
invalid token, please log in again
403 Forbidden –
you do not have permissions
you do not have permissions, your account is suspended
404 Not Found –
comment not found
500 Internal Server Error –
error, please try again or contact the administrator