PATCH /product_pitches/:id/add_ingredient_opinion

PATCH /product_pitches/{id}/add_ingredient_opinion

Add ingredient opinion to product pitch

Path parameters

  • id integer(int64) Required

    ID of the resource to fetch

Body Required

  • ingredient_opinion_uuid string Required

Responses

  • 201

    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)
      • ingredient_opinions array[object]
        Hide ingredient_opinions attributes Show ingredient_opinions attributes array[object]
        • uuid string(uuid)
        • feeling_id integer
        • created_at string(DateTime)
        • current_entry object
          Hide current_entry attributes Show current_entry attributes object
          • uuid string(uuid)
          • opinion_uuid string(uuid)
          • revision integer
          • publication string

            Values are published, unpublished, or deleted.

          • created_at string(DateTime)
          • content object
            Hide content attributes Show content attributes object
            • text string
            • entities object
              Hide entities attributes Show entities attributes object
              • hashtags array[object]
                Hide hashtags attributes Show hashtags attributes array[object]
                • text string
                • indices array[integer]

                  At least 2 but not more than 2 elements.

              • user_mentions array[object]
                Hide user_mentions attributes Show user_mentions attributes array[object]
                • username string
                • indices array[integer]

                  At least 2 but not more than 2 elements.

                • id integer
                • name string
  • 500

    Server Error

  • 401

    Authorization information is missing or invalid.

  • 400

    Bad Request

  • 404

    Requested resource not found

PATCH /product_pitches/{id}/add_ingredient_opinion
curl \
 -X PATCH https://api.cosmily.com/api/v1/product_pitches/{id}/add_ingredient_opinion \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"ingredient_opinion_uuid":"string"}'
Request example
{
  "ingredient_opinion_uuid": "string"
}
Request examples
{
  "ingredient_opinion_uuid": "string"
}
Response examples (201)
{
  "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",
    "ingredient_opinions": [
      {
        "uuid": "string",
        "feeling_id": 42,
        "created_at": "string",
        "current_entry": {
          "uuid": "string",
          "opinion_uuid": "string",
          "revision": 42,
          "publication": "published",
          "created_at": "string",
          "content": {
            "text": "working towards #sustainability with @alex",
            "entities": {
              "hashtags": [
                {
                  "text": "sustainability",
                  "indices": [
                    16,
                    31
                  ]
                }
              ],
              "user_mentions": [
                {
                  "username": "alex",
                  "indices": [
                    37,
                    42
                  ],
                  "id": 42,
                  "name": "string"
                }
              ]
            }
          }
        }
      }
    ]
  }
}
Response examples (201)
{
  "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",
    "ingredient_opinions": [
      {
        "uuid": "string",
        "feeling_id": 42,
        "created_at": "string",
        "current_entry": {
          "uuid": "string",
          "opinion_uuid": "string",
          "revision": 42,
          "publication": "published",
          "created_at": "string",
          "content": {
            "text": "working towards #sustainability with @alex",
            "entities": {
              "hashtags": [
                {
                  "text": "sustainability",
                  "indices": [
                    16,
                    31
                  ]
                }
              ],
              "user_mentions": [
                {
                  "username": "alex",
                  "indices": [
                    37,
                    42
                  ],
                  "id": 42,
                  "name": "string"
                }
              ]
            }
          }
        }
      }
    ]
  }
}