Max
Max

Reputation: 91

Open API 3.0 how to add API body elements?

I am trying to create a swagger doc for a post meetings call. I am unsure how to add body fields under parameters (like meeting.name, meeting.time, meeting.duration etc). I get the error in the parameters "allowedValues: path, query, header, cookie". I am unsure which one to pick from here? I am done this previously by writing "-in: body" but body doesn't seem to be an option here.

 openapi: '3.0.0'
info:
  title: WebcastCreateMeeting
  version: "1.1"
servers:
  - url: https://api.webcasts.com/api
paths:
  '/event/create/{event_title}/{folder_id}/{type}/{scheduled_start_time}/{scheduled_duration}/{timezone}/{region}/{acquisition_type}/{audience_capacity}/{event_expiration_months}/{token}':
    post:
      tags:
       - CreateMeetingCallbody
      summary: EventGM
      parameters:  
        - in: path
          name: token
          description: the auth token
          required: true
          schema:
            type: string
            example: 123j1lkj3lk1j3i1j23l1kj3k1j2l3j12l3j1l2
        - in: path
          name: event_title
          description: Name of the event from Cvent
          required: true
          schema:
            type: string
        - in: body
          name: user
          description: this is a test user
          schema:
            type: object
            required: 
              - username
            properties:
              username:
               type: string
        - in: path
          name: folder_id
          description: ID of the folder under whihc the Meeting is to be added
          required: true
          schema:
            type: string
        - in: path
          name: type
          description: Type of the Meeting
          required: true
          schema:
            type: string
        - in: path
          name: scheduled_start_time
          description: Start time of
          required: true
          schema:
            type: string
            format: date-time
        - in: path
          name: scheduled_duration
          description: Duration
          required: true
          schema:
            type: integer
            example: 60
        - in: path
          name: timezone
          description: TimeZone of the event LU table
          required: true
          schema:
            type: string
        - in: path
          name: region
          description: Region from Zoom
          required: true
          schema:
            type: integer
            example: 1
        - in: path
          name: acquisition_type
          description: To be added from GM
          required: true
          schema:
            type: integer
            example: 0
        - in: path
          name: audience_capacity
          description: To be added for capacity
          required: true
          schema:
            type: integer
        - in: path
          name: event_expiration_months
          description: the month it expires on.
          required: true
          schema:
            type: integer
            example: 3
      responses:
        200:
          description: This would be the response.
          content:
            application/json;charset=utf-8:
              schema:
                type: array
                items:
                  properties:
                    scheduled_duration:
                      type: integer
                      example: 30
                    event_id:
                      type: integer
                      example: 0000000
                    audience_capacity:
                     type: integer
                     example: 30
                    folder_name:
                      type: string
                      example: Folder_Name
                    viewer_link:
                      type: string
                      example: https://viewer_link
                    scheduled_start_time:
                     type: string
                     format: date-time
                     example: 1541674800000
                    scheduled_player_close_time:
                     type: integer
                     example: 10
                    event_title:
                      type: string
                    
  [![enter image description here][1]][1]

Kindly advise on how to describe the body fields I am supposed to pass in the code.

Thanks

Upvotes: 1

Views: 1954

Answers (1)

Max
Max

Reputation: 91

Got it, its passed separately in "requestbody" check here

Thanks.

Upvotes: 1

Related Questions