GET /my/compatibility/product/:id_or_alias

GET /my/compatibility/product/{id_or_alias}

Returns the logged in user's compatibility report for the requested product

Path parameters

  • id_or_alias string Required

    ID of the resource to return

Responses

  • 200

    successful operation

    Hide response attributes Show response attributes object
    • ingredient_counts object
      Hide ingredient_counts attributes Show ingredient_counts attributes object
      • liked integer
      • disliked integer
    • effect_counts object
      Hide effect_counts attributes Show effect_counts attributes object
      • positive integer
      • harmful integer
      • notable integer
    • ingredients object
      Hide ingredients attributes Show ingredients attributes object
      • liked array[object]
        Hide liked attributes Show liked attributes array[object]
        • id integer
        • title string
        • alias string
      • disliked array[object]
        Hide disliked attributes Show disliked attributes array[object]
        • id integer
        • title string
        • alias string
    • effects object
      Hide effects attributes Show effects attributes object
      • positive array[object]
        Hide positive attributes Show positive attributes array[object]
        • effect string
        • ingredient_ids array[integer]
      • harmful array[object]
        Hide harmful attributes Show harmful attributes array[object]
        • effect string
        • ingredient_ids array[integer]
      • notable array[object]
        Hide notable attributes Show notable attributes array[object]
        • effect string
        • ingredient_ids array[integer]
  • 400

    Bad Request

  • 401

    Authorization information is missing or invalid.

  • 403

    Authorization forbidden

  • 404

    Product not found

  • 500

    Server Error

GET /my/compatibility/product/{id_or_alias}
curl \
 -X GET https://api.cosmily.com/api/v1/my/compatibility/product/{id_or_alias} \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "ingredient_counts": {
    "liked": 42,
    "disliked": 42
  },
  "effect_counts": {
    "positive": 42,
    "harmful": 42,
    "notable": 42
  },
  "ingredients": {
    "liked": [
      {
        "id": 42,
        "title": "string",
        "alias": "string"
      }
    ],
    "disliked": [
      {
        "id": 42,
        "title": "string",
        "alias": "string"
      }
    ]
  },
  "effects": {
    "positive": [
      {
        "effect": "string",
        "ingredient_ids": [
          42
        ]
      }
    ],
    "harmful": [
      {
        "effect": "string",
        "ingredient_ids": [
          42
        ]
      }
    ],
    "notable": [
      {
        "effect": "string",
        "ingredient_ids": [
          42
        ]
      }
    ]
  }
}
Response examples (200)
{
  "ingredient_counts": {
    "liked": 42,
    "disliked": 42
  },
  "effect_counts": {
    "positive": 42,
    "harmful": 42,
    "notable": 42
  },
  "ingredients": {
    "liked": [
      {
        "id": 42,
        "title": "string",
        "alias": "string"
      }
    ],
    "disliked": [
      {
        "id": 42,
        "title": "string",
        "alias": "string"
      }
    ]
  },
  "effects": {
    "positive": [
      {
        "effect": "string",
        "ingredient_ids": [
          42
        ]
      }
    ],
    "harmful": [
      {
        "effect": "string",
        "ingredient_ids": [
          42
        ]
      }
    ],
    "notable": [
      {
        "effect": "string",
        "ingredient_ids": [
          42
        ]
      }
    ]
  }
}