Comments

GET /api/workouts/(string: workout_short_id)/comments

Get workout comments.

It returns only comments visible to authenticated user and only public comments when no authentication provided.

Scope: workouts:read

Example request:

GET /api/workouts/2oRDfncv6vpRkfp3yrCYHt/comments HTTP/1.1
Content-Type: application/json

Example response:

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"
  }
Parameters:
  • workout_short_id (string) – workout short id

Request Headers:
  • Authorization – OAuth 2.0 Bearer Token for comments with private and followers_only visibility

Status Codes:
GET /api/comments/(string: comment_short_id)

Get comment.

Scope: workouts:read

Example request:

GET /api/workouts/2oRDfncv6vpRkfp3yrCYHt/comment HTTP/1.1
Content-Type: application/json

Example response:

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"
  }
Parameters:
  • comment_short_id (string) – comment short id

Request Headers:
  • Authorization – OAuth 2.0 Bearer Token for comment with private and followers_only visibility

Status Codes:
  • 200 OKsuccess

  • 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 Foundworkout comment not found

POST /api/workouts/(string: workout_short_id)/comments

Post a comment.

Scope: workouts:write

Example request:

POST /api/workouts/2oRDfncv6vpRkfp3yrCYHt HTTP/1.1
Content-Type: application/json

Example response:

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"
  }
Parameters:
  • workout_short_id (string) – workout short id

Request JSON Object:
  • text (string) – comment content

  • text_visibility (string) – visibility level (public, followers_only, private)

Request Headers:
Status Codes:
PATCH /api/comments/(string: comment_short_id)

Update comment text.

Scope: workouts:write

Example request:

PATCH /api/workouts/WJgTwtqFpnPrHYAK5eX9Pw HTTP/1.1
Content-Type: application/json

Example response:

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"
  }
Parameters:
  • comment_short_id (string) – comment short id

Request JSON Object:
  • text (string) – comment content

Request Headers:
Status Codes:
POST /api/comments/(string: comment_short_id)/like

Add a “like” to a comment.

Scope: workouts:write

Example request:

POST /api/comments/WJgTwtqFpnPrHYAK5eX9Pw/like HTTP/1.1
Content-Type: application/json

Example response:

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"
  }
Parameters:
  • comment_short_id (string) – comment short id

Request Headers:
Status Codes:
  • 200 OKsuccess

  • 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 Foundcomment not found

POST /api/comments/(string: comment_short_id)/like/undo

Remove a comment “like”.

Scope: workouts:write

Example request:

POST /api/comments/2oRDfncv6vpRkfp3yrCYHt/like/undo HTTP/1.1
Content-Type: application/json

Example response:

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"
  }
Parameters:
  • comment_short_id (string) – comment short id

Request Headers:
Status Codes:
  • 200 OKsuccess

  • 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 Foundcomment not found

GET /api/comments/(string: comment_short_id)/likes

Get users who like comment.

Scope: workouts:read

Example request:

POST /api/comments/WJgTwtqFpnPrHYAK5eX9Pw/likes HTTP/1.1
Content-Type: application/json

Example response:

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"
  }
Parameters:
  • comment_short_id (string) – comment short id

Query Parameters:
  • page (integer) – page if using pagination (default: 1)

Request Headers:
  • Authorization – OAuth 2.0 Bearer Token for comment with private and followers_only visibility

Status Codes:
  • 200 OKsuccess

  • 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 Foundcomment not found

POST /api/comments/(string: comment_short_id)/suspension/appeal

Appeal comment suspension.

Only comment author can appeal the suspension.

Scope: workouts:write

Example request:

POST /api/comments/WJgTwtqFpnPrHYAK5eX9Pw/suspension/appeal HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 201 CREATED
Content-Type: application/json

  {
    "status": "success"
  }
Parameters:
  • comment_short_id (string) – comment short id

Request Headers:
Status Codes:
  • 201 Created – appeal created

  • 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 Foundcomment not found

  • 500 Internal Server Errorerror, please try again or contact the administrator

DELETE /api/comments/(string: comment_short_id)

Delete workout comment.

Scope: workouts:write

Example request:

DELETE /api/comments/MzydiCYYfktG3gga2x8AfU HTTP/1.1
Content-Type: application/json

Example response:

HTTP/1.1 204 NO CONTENT
Content-Type: application/json
Parameters:
  • comment_short_id (string) – comment short id

Request Headers:
Status Codes: