GET /analyze/:token/rules

GET /analyze/{token}/rules

Get product fit results

Path parameters

  • token string(uuid) Required

    token reference to desired resource

Query parameters

  • category string Required

    rules based on category

    Values are cleanser, toner, serum, moisturizer, spf, or other.

  • time_of_day string

    rules based on time of day

    Values are AM, PM, or BOTH. Default value is BOTH.

  • is_living_hot_summer boolean

    rules based on is_living_hot_summer

  • is_living_cold_winter boolean

    rules based on is_living_cold_winter

  • is_living_dry_climate boolean

    rules based on is_living_dry_climate

  • is_living_urban_area boolean

    rules based on is_living_urban_area

  • is_constrained_budget boolean

    rules based on is_constrained_budget

  • is_constrained_time boolean

    rules based on is_constrained_time

  • is_high_sun_exposure boolean

    rules based on is_high_sun_exposure

  • is_concerned_parabens boolean

    rules based on is_concerned_parabens

    Default value is true.

  • is_concerned_sulfates boolean

    rules based on is_concerned_sulfates

    Default value is true.

  • is_concerned_silicones boolean

    rules based on is_concerned_silicones

    Default value is true.

  • is_concerned_gluten boolean

    rules based on is_concerned_gluten

  • is_condition_acne boolean

    rules based on is_condition_acne

  • is_condition_eczema boolean

    rules based on is_condition_eczema

  • is_condition_rosacea boolean

    rules based on is_condition_rosacea

  • is_condition_dehydration boolean

    rules based on is_condition_dehydration

  • rating_persona_oily integer Required

    rules based on rating_persona_oily

    Values are 0, 1, 2, 3, 4, or 5.

  • rating_persona_sensitive integer Required

    rules based on rating_persona_sensitive

    Values are 0, 1, 2, 3, 4, or 5.

  • rating_persona_uneven integer Required

    rules based on rating_persona_uneven

    Values are 0, 1, 2, 3, 4, or 5.

  • rating_persona_wrinkled integer Required

    rules based on rating_persona_wrinkled

    Values are 0, 1, 2, 3, 4, or 5.

Responses

  • 200

    successful operation

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • bad_ingredients object
        Hide bad_ingredients attributes Show bad_ingredients attributes object
        • reason string
        • ingredient object
          Hide ingredient attributes Show ingredient attributes object
          • id integer
          • title string
          • alias string
        • explanation string
      • is_good_for_you boolean
      • failed_product_rules array[object]
        Hide failed_product_rules attributes Show failed_product_rules attributes array[object]
        • explanation string
        • identifier string
        • label string
      • suggestion object
        Hide suggestion attributes Show suggestion attributes object
        • explanations array[string]
        • products array[object]
          Hide products attributes Show products attributes array[object]
          • id integer
          • title string
          • alias string
  • 400

    Bad Request

  • 401

    Authorization information is missing or invalid.

  • 404

    Ingredient List Analysis Not Found

  • 422

    Failed to infer product category

    Hide response attribute Show response attribute object
    • error string

      Value is unknown.

  • 500

    Server Error

GET /analyze/{token}/rules
curl \
 -X GET https://api.cosmily.com/api/v1/analyze/{token}/rules?category=cleanser&rating_persona_oily=0&rating_persona_sensitive=0&rating_persona_uneven=0&rating_persona_wrinkled=0 \
 -H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "data": {
    "bad_ingredients": {
      "reason": "string",
      "ingredient": {
        "id": 42,
        "title": "string",
        "alias": "string"
      },
      "explanation": "string"
    },
    "is_good_for_you": true,
    "failed_product_rules": [
      {
        "explanation": "string",
        "identifier": "string",
        "label": "string"
      }
    ],
    "suggestion": {
      "explanations": [
        "string"
      ],
      "products": [
        {
          "id": 42,
          "title": "string",
          "alias": "string"
        }
      ]
    }
  }
}
Response examples (200)
{
  "data": {
    "bad_ingredients": {
      "reason": "string",
      "ingredient": {
        "id": 42,
        "title": "string",
        "alias": "string"
      },
      "explanation": "string"
    },
    "is_good_for_you": true,
    "failed_product_rules": [
      {
        "explanation": "string",
        "identifier": "string",
        "label": "string"
      }
    ],
    "suggestion": {
      "explanations": [
        "string"
      ],
      "products": [
        {
          "id": 42,
          "title": "string",
          "alias": "string"
        }
      ]
    }
  }
}
Response examples (422)
{
  "error": "unknown"
}
Response examples (422)
{
  "error": "unknown"
}