Kitchen Stories User Meal Plan API

The User Meal Plan API from Kitchen Stories — 2 operation(s) for user meal plan.

OpenAPI Specification

kitchenstories-user-meal-plan-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  version: '3'
  title: Kitchen Stories Internal Articles Admin User Meal Plan API
  description: ''
  contact:
    email: hello@kitchenstories.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
servers:
- url: https://api.kitchenstories.io/api
  description: LIVE Environment
- url: https://api.dev.kitchenstories.io/api
  description: Development Environment
- url: http://localhost:8000/api
  description: Local Environment
security:
- bearerAuth: []
- ApiKeyAuth: []
tags:
- name: User Meal Plan
paths:
  /users/me/mealplan/:
    get:
      summary: Get all meal plan items for the currently authenticated user
      operationId: mealplan-list
      tags:
      - User Meal Plan
      parameters:
      - name: week
        in: query
        description: Calendar week number
        schema:
          type: integer
      - name: year
        in: query
        description: Year
        schema:
          type: integer
      - name: start
        in: query
        description: Start date (YYYY-MM-DD)
        schema:
          type: string
          format: date
      - name: end
        in: query
        description: End date (YYYY-MM-DD)
        schema:
          type: string
          format: date
      responses:
        '200':
          description: Successful response with meal plan items
          content:
            application/vnd.ajns.kitchenstories+json; version=3:
              schema:
                $ref: '#/components/schemas/mealplan'
        '403':
          description: User not authenticated
    post:
      summary: Create a meal plan item for the currently authenticated user
      operationId: mealplan-create
      tags:
      - User Meal Plan
      requestBody:
        description: Feed item is mandatory. Either target_date or year and calendar_week must be provided.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/mealplan_add_json'
      responses:
        '201':
          description: Operation successful
          content:
            application/vnd.ajns.kitchenstories+json; version=3:
              schema:
                $ref: '#/components/schemas/mealplan_item'
        '403':
          description: Forbidden. When user is not logged in
  /users/me/mealplan/{mealplan-item-uuid}/:
    get:
      summary: Get the given meal plan item for the currently authenticated user
      operationId: mealplan-detail
      tags:
      - User Meal Plan
      parameters:
      - name: mealplan-item-uuid
        in: path
        description: Meal plan item uuid
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '200':
          description: Get this Meal Plan item details
          content:
            application/vnd.ajns.kitchenstories+json; version=3:
              schema:
                $ref: '#/components/schemas/mealplan_item'
        '404':
          description: Meal plan item not found
    put:
      summary: Update a Meal Plan item for the currently authenticated User
      operationId: mealplan-update
      tags:
      - User Meal Plan
      parameters:
      - name: mealplan-item-uuid
        in: path
        description: Meal plan item uuid
        required: true
        schema:
          type: string
          format: uuid
      requestBody:
        description: Updates the meal plan item
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/mealplan_update'
      responses:
        '200':
          description: Operation successful
          content:
            application/vnd.ajns.kitchenstories+json; version=3:
              schema:
                $ref: '#/components/schemas/mealplan_item'
        '403':
          description: Forbidden. When user is not logged in
        '404':
          description: Meal plan item not found
    delete:
      summary: Delete a Meal Plan item for the currently authenticated User
      operationId: mealplan-delete
      tags:
      - User Meal Plan
      parameters:
      - name: mealplan-item-uuid
        in: path
        description: Meal plan item uuid
        required: true
        schema:
          type: string
          format: uuid
      responses:
        '204':
          description: Operation successful
        '403':
          description: Forbidden. When user is not logged in
        '404':
          description: NotFound. When Meal Plan item does not exist
components:
  schemas:
    legacy_unit:
      type: object
      properties:
        id:
          type: string
        ingredient_pluralizable:
          type: boolean
        name:
          type: object
          properties:
            rendered:
              type: string
            one:
              type: string
            many:
              type: string
          required:
          - rendered
          additionalProperties: false
      required:
      - name
    category_simplified:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        slug:
          type: string
        path:
          type: array
          items:
            $ref: '#/components/schemas/path_item'
        children:
          type: array
          items:
            $ref: '#/components/schemas/child_item'
      required:
      - slug
      - title
      - id
    content_meta_markdown:
      type: object
      properties:
        markdown:
          type: string
          minLength: 1
          maxLength: 5000
      required:
      - markdown
    step:
      type: object
      properties:
        headline:
          type: string
        text:
          type: string
        tip:
          type: object
          properties:
            title:
              type: string
            description:
              type: string
            video:
              $ref: '#/components/schemas/video'
          required:
          - description
          - title
        image:
          $ref: '#/components/schemas/image'
        video:
          $ref: '#/components/schemas/video'
        utensils:
          type: array
          items:
            $ref: '#/components/schemas/recipe_utensil'
        ingredients:
          type: array
          items:
            $ref: '#/components/schemas/recipe_ingredient'
      required:
      - text
    recipe_simplified:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        slug:
          type: string
        type:
          type: string
        content_id:
          type: string
        difficulty:
          type: string
        image:
          $ref: '#/components/schemas/image'
          nullable: true
        author:
          $ref: '#/components/schemas/user_public'
        url:
          type: string
          format: uri
        duration:
          type: object
          properties:
            preparation:
              type: number
            baking:
              type: number
            resting:
              type: number
          required:
          - preparation
          - resting
          - baking
          nullable: true
        user_reactions:
          type: object
          properties:
            rating:
              type: number
            rating_count:
              type: number
            images:
              type: array
              items:
                $ref: '#/components/schemas/comment_image'
              maxItems: 4
            comments_count:
              type: number
            images_count:
              type: number
            like_count:
              type: number
            quality:
              type: number
          required:
          - comments_count
          - images_count
          - like_count
          - quality
        publishing:
          type: object
          properties:
            created:
              type: string
              format: date-time
            updated:
              type: string
              format: date-time
            published:
              type: string
              format: date-time
            state:
              type: string
              enum:
              - draft
              - submitted
              - rejected
              - live
              - expired
              - scheduled
          required:
          - created
          - updated
          - state
        tags:
          type: array
          items:
            $ref: '#/components/schemas/tag'
      required:
      - content_id
      - type
      - publishing
      - title
      - slug
      - url
      - user_reactions
      - author
      - id
    additional_information:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
      - id
      - name
      additionalProperties: false
    characteristic:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
      required:
      - id
      - name
      additionalProperties: false
    mealplan_update:
      type: object
      properties:
        target_date:
          type: string
          format: date
        year:
          type: number
        calendar_week:
          type: number
        day_of_week:
          type: number
        pinned:
          type: boolean
    size:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        metric:
          type: string
        imperial:
          type: string
      required:
      - id
      additionalProperties: false
    unit:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
        featured_order:
          type: number
        ingredient_pluralizable:
          type: boolean
        name:
          type: object
          properties:
            one:
              type: string
            many:
              type: string
            rendered:
              type: string
          required:
          - rendered
          additionalProperties: false
      required:
      - id
      - name
      - ingredient_pluralizable
      - type
    image:
      type: object
      properties:
        id:
          oneOf:
          - type: string
          - type: number
        url:
          type: string
          format: uri
        source:
          type: string
        source_link:
          type: string
        width:
          type: number
        height:
          type: number
      required:
      - url
      additionalProperties: false
    mealplan_item:
      type: object
      properties:
        id:
          type: string
        target_date:
          type: string
          format: date
        year:
          type: number
        calendar_week:
          type: number
        day_of_week:
          type: number
        pinned:
          type: boolean
        feed_item:
          $ref: '#/components/schemas/feed_recipe'
      required:
      - year
      - id
      - feed_item
      - calendar_week
    feed_recipe:
      type: object
      properties:
        type:
          type: string
        recipe:
          oneOf:
          - $ref: '#/components/schemas/recipe_simplified'
          - $ref: '#/components/schemas/recipe'
        hide_for_web:
          type: boolean
        hide_for_app:
          type: boolean
      required:
      - type
      - recipe
    recipe_utensil:
      type: object
      properties:
        id:
          type: string
        amount:
          type: number
        name:
          type: object
          properties:
            rendered:
              type: string
            one:
              type: string
            many:
              type: string
          required:
          - rendered
          additionalProperties: false
        characteristic:
          $ref: '#/components/schemas/characteristic'
        additional_information:
          $ref: '#/components/schemas/additional_information'
        size:
          $ref: '#/components/schemas/size'
      required:
      - name
    comment_image:
      type: object
      properties:
        comment:
          type: string
        author:
          $ref: '#/components/schemas/user_public'
        original_location:
          type: string
        image:
          $ref: '#/components/schemas/image'
        created:
          type: string
          format: date-time
      required:
      - author
      - created
      - image
      - original_location
      - comment
    content_meta_faq:
      type: object
      properties:
        question:
          type: string
          minLength: 1
          maxLength: 500
        answer:
          type: string
          minLength: 1
          maxLength: 5000
      required:
      - answer
      - question
    child_item:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        path:
          type: array
          items:
            $ref: '#/components/schemas/path_item'
        slug:
          type: string
        children:
          type: array
          items:
            $ref: '#/components/schemas/child_item'
      required:
      - id
      - slug
      - title
    mealplan:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/mealplan_item'
      required:
      - data
    video:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        slug:
          type: string
        type:
          type: string
        content_id:
          type: string
        remote_id:
          type: string
        url:
          type: string
          format: uri
        recipe_url:
          type: string
          format: uri
        width:
          type: number
        height:
          type: number
        duration:
          type: number
        image:
          $ref: '#/components/schemas/image'
        meta:
          $ref: '#/components/schemas/wagtail_meta'
        publishing:
          type: object
          properties:
            created:
              type: string
              format: date-time
            updated:
              type: string
              format: date-time
            published:
              type: string
              format: date-time
            state:
              type: string
            playback-state:
              type: string
              enum:
              - not-playable
              - processing
              - ready
          required:
          - created
          - updated
          - state
          - playback-state
        user_reactions:
          type: object
          properties:
            view_count:
              type: number
          required:
          - view_count
      required:
      - content_id
      - duration
      - title
      - id
      - slug
      - meta
    mealplan_add_json:
      type: object
      properties:
        feed_item:
          type: string
        target_date:
          type: string
          format: date
        year:
          type: number
        calendar_week:
          type: number
        day_of_week:
          type: number
      required:
      - feed_item
    recipe_ingredient:
      type: object
      properties:
        id:
          type: string
        name:
          type: object
          properties:
            rendered:
              type: string
            one:
              type: string
            many:
              type: string
          required:
          - rendered
          additionalProperties: false
        measurement:
          type: object
          properties:
            imperial:
              type: object
              properties:
                amount:
                  type: number
                unit:
                  oneOf:
                  - $ref: '#/components/schemas/legacy_unit'
                  - $ref: '#/components/schemas/unit'
              additionalProperties: false
            metric:
              type: object
              properties:
                amount:
                  type: number
                unit:
                  oneOf:
                  - $ref: '#/components/schemas/legacy_unit'
                  - $ref: '#/components/schemas/unit'
              additionalProperties: false
          additionalProperties: false
        characteristic:
          $ref: '#/components/schemas/characteristic'
        additional_information:
          $ref: '#/components/schemas/additional_information'
        is_divided:
          type: boolean
        is_partner:
          type: boolean
        is_searcheable:
          type: boolean
        url:
          type: string
      required:
      - name
    user_public:
      type: object
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - community
          - contributor
          - editor
        new_type:
          type: string
          enum:
          - community
          - contributor
          - editor
          - partner
          - external
        name:
          type: string
        slug:
          type: string
        occupation:
          type: string
        description:
          type: string
        image:
          $ref: '#/components/schemas/image'
          nullable: true
        banner_image:
          $ref: '#/components/schemas/image'
        wide_banner_image:
          $ref: '#/components/schemas/image'
        website:
          type: string
          format: uri
        is_premium:
          type: boolean
        created:
          type: string
          format: date-time
      required:
      - type
      - new_type
      - name
      - id
    wagtail_meta:
      type: object
      properties:
        title:
          type: string
        description:
          type: string
        hreflang:
          type: object
          properties:
            en:
              type: string
              format: uri
            de:
              type: string
              format: uri
            zh:
              type: string
              format: uri
          required:
          - en
      required:
      - hreflang
      additionalProperties: false
    content_meta_external_product:
      type: object
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 37
        subtitle:
          type: string
          maxLength: 25
        image:
          type: string
          format: uri
        cta:
          type: string
          maxLength: 20
        url:
          type: string
          format: uri
      required:
      - image
      - url
      - title
    content_meta:
      type: object
      properties:
        key:
          type: string
        type:
          type: string
        value:
          oneOf:
          - $ref: '#/components/schemas/content_meta_external_link'
          - $ref: '#/components/schemas/content_meta_external_product'
          - $ref: '#/components/schemas/content_meta_faq'
          - $ref: '#/components/schemas/content_meta_markdown'
        campaign:
          type: string
        language:
          type: string
      required:
      - type
      - key
      - uuid
    tag:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        slug:
          type: string
        type:
          type: string
        is_hidden:
          type: boolean
    recipe:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        slug:
          type: string
        type:
          type: string
        content_id:
          type: string
        difficulty:
          type: string
        chefs_note:
          type: string
        image:
          $ref: '#/components/schemas/image'
          nullable: true
        author:
          $ref: '#/components/schemas/user_public'
        url:
          type: string
          format: uri
        duration:
          type: object
          properties:
            preparation:
              type: number
            baking:
              type: number
            resting:
              type: number
          required:
          - preparation
          - resting
          - baking
          nullable: true
        user_reactions:
          type: object
          properties:
            rating:
              type: number
            rating_count:
              type: number
            images:
              type: array
              items:
                $ref: '#/components/schemas/comment_image'
              maxItems: 4
            comments_count:
              type: number
            images_count:
              type: number
            like_count:
              type: number
            quality:
              type: number
          required:
          - comments_count
          - images_count
          - like_count
          - quality
        servings:
          type: object
          properties:
            amount:
              type: number
            type:
              type: string
          required:
          - amount
          - type
        nutrition:
          type: object
          properties:
            calories:
              type: number
            fat:
              type: number
            protein:
              type: number
            carbohydrate:
              type: number
          required:
          - protein
          - fat
          - calories
          - carbohydrate
        publishing:
          type: object
          properties:
            created:
              type: string
              format: date-time
            updated:
              type: string
              format: date-time
            published:
              type: string
              format: date-time
            state:
              type: string
              enum:
              - draft
              - submitted
              - rejected
              - live
              - expired
              - scheduled
          required:
          - created
          - updated
          - state
        meta:
          $ref: '#/components/schemas/wagtail_meta'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/tag'
        content_meta:
          type: array
          items:
            $ref: '#/components/schemas/content_meta'
        categories:
          type: object
          properties:
            main:
              $ref: '#/components/schemas/category_simplified'
            additional:
              type: array
              items:
                $ref: '#/components/schemas/category_simplified'
        video:
          $ref: '#/components/schemas/video'
        howto_videos:
          type: array
          items:
            $ref: '#/components/schemas/video'
        steps:
          type: array
          items:
            $ref: '#/components/schemas/step'
        utensils:
          type: array
          items:
            $ref: '#/components/schemas/recipe_utensil'
        ingredients:
          type: array
          items:
            type: object
            properties:
              list:
                type: array
                items:
                  $ref: '#/components/schemas/recipe_ingredient'
            required:
            - list
            additionalProperties: false
      required:
      - content_id
      - type
      - publishing
      - title
      - steps
      - slug
      - url
      - user_reactions
      - author
      - servings
      - ingredients
      - id
    content_meta_external_link:
      type: object
      properties:
        url:
          type: string
          format: uri
      required:
      - url
    path_item:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        slug:
          type: string
      required:
      - id
      - slug
      - title
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Ultron-User