GET /products/:id_or_alias/top_routines

GET /products/{id_or_alias}/top_routines

Returns top routines for product

Query parameters

  • page integer

    requested page number

    Minimum value is 1. Default value is 1.

  • page_size integer

    requested page size

    Minimum value is 1, maximum value is 100. Default value is 12.

Responses

  • 200

    successful operation

    Hide response attributes Show response attributes object
    • data array[object]
      Hide data attributes Show data attributes array[object]
      • id integer
      • user_id integer
      • title string
      • routine_type string
      • status string
      • created_at string(DateTime)
      • updated_at string(DateTime)
      • routine_step_ids array[integer]
      • routine_step_order array[integer]
      • favorite_count integer
      • product_routine_ranking object
        Hide product_routine_ranking attributes Show product_routine_ranking attributes object
        • rank integer
        • score integer
      • routine_steps array[object]
        Hide routine_steps attributes Show routine_steps attributes array[object]
        • id integer
        • routine_id integer
        • product_id integer
        • product_tutorial_id integer
        • product_category_id integer
        • product_pitch_id integer
        • status string
        • created_at string(DateTime)
        • updated_at string(DateTime)
        • product object
          Hide product attributes Show product attributes object
          • id integer(int32)
          • full_title string
          • alias string
          • image string(nullable)
  • 400

    Bad Request

  • 401

    Authorization information is missing or invalid.

  • 404

    Product Not Found

  • 500

    Server Error

GET /products/{id_or_alias}/top_routines
curl \
 -X GET https://api.cosmily.com/api/v1/products/{id_or_alias}/top_routines \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "data": [
    {
      "id": 42,
      "user_id": 42,
      "title": "string",
      "routine_type": "string",
      "status": "string",
      "created_at": "string",
      "updated_at": "string",
      "routine_step_ids": [
        42
      ],
      "routine_step_order": [
        42
      ],
      "favorite_count": 42,
      "product_routine_ranking": {
        "rank": 42,
        "score": 42
      },
      "routine_steps": [
        {
          "id": 42,
          "routine_id": 42,
          "product_id": 42,
          "product_tutorial_id": 42,
          "product_category_id": 42,
          "product_pitch_id": 42,
          "status": "string",
          "created_at": "string",
          "updated_at": "string",
          "product": {
            "id": 42,
            "full_title": "string",
            "alias": "string",
            "image": "string"
          }
        }
      ]
    }
  ],
  "links": {
    "first": "string",
    "last": "string",
    "prev": "string",
    "next": "string"
  }
}
Response examples (200)
{
  "data": [
    {
      "id": 42,
      "user_id": 42,
      "title": "string",
      "routine_type": "string",
      "status": "string",
      "created_at": "string",
      "updated_at": "string",
      "routine_step_ids": [
        42
      ],
      "routine_step_order": [
        42
      ],
      "favorite_count": 42,
      "product_routine_ranking": {
        "rank": 42,
        "score": 42
      },
      "routine_steps": [
        {
          "id": 42,
          "routine_id": 42,
          "product_id": 42,
          "product_tutorial_id": 42,
          "product_category_id": 42,
          "product_pitch_id": 42,
          "status": "string",
          "created_at": "string",
          "updated_at": "string",
          "product": {
            "id": 42,
            "full_title": "string",
            "alias": "string",
            "image": "string"
          }
        }
      ]
    }
  ],
  "links": {
    "first": "string",
    "last": "string",
    "prev": "string",
    "next": "string"
  }
}