POST /product_pitches/create

POST /product_pitches/create

Create new product pitch

Body Required

  • product_id integer Required
  • effects array[object] Required

    JSON representation of effects

    Hide effects attributes Show effects attributes array[object]
    • effect string
    • ingredient_ids array[integer]

Responses

  • 500

    Server Error

  • 200

    successful operation

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • id integer(int32)
      • product_id integer
      • user_id integer
      • effects array[object]
        Hide effects attributes Show effects attributes array[object]
        • effect string
        • ingredient_ids array[integer]
      • preferred_ingredients array[object]
        Hide preferred_ingredients attributes Show preferred_ingredients attributes array[object]
        • effects array[string]
        • ingredient_id integer
      • affiliate_url string
      • coupon_code string
      • created_at string(DateTime)
      • updated_at string(DateTime)
  • 400

    Bad Request

  • 401

    Authorization information is missing or invalid.

  • 422

    Unprocessable Entity

POST /product_pitches/create
curl \
 -X POST https://api.cosmily.com/api/v1/product_pitches/create \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"product_id":42,"effects":[{"effect":"string","ingredient_ids":[42]}]}'
Request example
{
  "product_id": 42,
  "effects": [
    {
      "effect": "string",
      "ingredient_ids": [
        42
      ]
    }
  ]
}
Request examples
{
  "product_id": 42,
  "effects": [
    {
      "effect": "string",
      "ingredient_ids": [
        42
      ]
    }
  ]
}
Response examples (200)
{
  "data": {
    "id": 42,
    "product_id": 42,
    "user_id": 42,
    "effects": [
      {
        "effect": "string",
        "ingredient_ids": [
          42
        ]
      }
    ],
    "preferred_ingredients": [
      {
        "effects": [
          "string"
        ],
        "ingredient_id": 42
      }
    ],
    "affiliate_url": "string",
    "coupon_code": "string",
    "created_at": "string",
    "updated_at": "string"
  }
}
Response examples (200)
{
  "data": {
    "id": 42,
    "product_id": 42,
    "user_id": 42,
    "effects": [
      {
        "effect": "string",
        "ingredient_ids": [
          42
        ]
      }
    ],
    "preferred_ingredients": [
      {
        "effects": [
          "string"
        ],
        "ingredient_id": 42
      }
    ],
    "affiliate_url": "string",
    "coupon_code": "string",
    "created_at": "string",
    "updated_at": "string"
  }
}