Untitled

 avatar
unknown
yaml
3 years ago
18 kB
2
Indexable
swagger: "2.0"
info:
  description: This is the cloud-runner API definition
  version: 0.1.0
  title: Publisher Portal API
tags:
  - name: orders
    description: Operations about creative orders
  - name: assets
    description: Operations about the assets / creative briefs associated with a creative order
  - name: statements
    description: Operations about the programs revenue statements
  - name: pacing reports
    description: Operations about the programs pacing reports
  - name: shows
    description: Operations about shows
  - name: download
    description: Operations about downloading generic files (Assets, Statements, Reports)
host: pubportal.dev.us-1.veritone.com
basePath: /api/v1
schemes:
  - https
paths:
  /statements:
    get:
      tags:
        - statements
      summary: Get statements
      description: Returns the list of statements for the logged in user
      produces:
        - application/json
      parameters:
        - name: X-Veritone-Session-ID
          in: header
          type: string
          format: uuid
          required: true
        - name: page
          in: query
          type: integer
          minimum: 1
          description: The selected page
          default: 1
        - name: pageSize
          in: query
          type: integer
          minimum: 1
          maximum: 100
          description: The numbers of items to return in one page
          default: 100
      responses:
        "200":
          description: List of Statements
          schema:
            type: object
            properties:
              metadata:
                $ref: "#/definitions/DmhMetadata"
              items:
                type: array
                items:
                  $ref: "#/definitions/Asset"
        "400":
          description: Bad Request
          schema:
            $ref: "#/definitions/Generic400Error"
        "401":
          description: Unauthorized
          schema:
            $ref: "#/definitions/Generic401Error"
        "403":
          description: Forbidden
          schema:
            $ref: "#/definitions/Generic403Error"
        "404":
          description: Not Found
          schema:
            $ref: "#/definitions/Generic404Error"
        "500":
          description: Internal Server Error
          schema:
            $ref: "#/definitions/Generic500Error"
  /pacing-reports:
    get:
      tags:
        - pacing reports
      summary: Get pacing reports for the logged in user
      description: Returns the list of orders for a given vendor
      produces:
        - application/json
      parameters:
        - name: X-Veritone-Session-ID
          in: header
          type: string
          format: uuid
          required: true
        - name: page
          in: query
          type: integer
          minimum: 1
          description: The selected page
          default: 1
        - name: pageSize
          in: query
          type: integer
          minimum: 1
          maximum: 100
          description: The numbers of items to return in one page
          default: 100
      responses:
        "200":
          description: List of Pacing Reports
          schema:
            type: object
            properties:
              metadata:
                $ref: "#/definitions/DmhMetadata"
              items:
                type: array
                items:
                  $ref: "#/definitions/Asset"
        "400":
          description: Bad Request
          schema:
            $ref: "#/definitions/Generic400Error"
        "401":
          description: Unauthorized
          schema:
            $ref: "#/definitions/Generic401Error"
        "403":
          description: Forbidden
          schema:
            $ref: "#/definitions/Generic403Error"
        "404":
          description: Not Found
          schema:
            $ref: "#/definitions/Generic404Error"
        "500":
          description: Internal Server Error
          schema:
            $ref: "#/definitions/Generic500Error"
  /orders:
    get:
      tags:
        - orders
      summary: Get orders by vendorId
      description: Returns the list of orders for a given vendor
      produces:
        - application/json
      parameters:
        - name: X-Veritone-Session-ID
          in: header
          type: string
          format: uuid
          required: true
        - name: page
          in: query
          type: integer
          minimum: 1
          description: The selected page
          default: 1
        - name: pageSize
          in: query
          type: integer
          minimum: 1
          maximum: 100
          description: The numbers of items to return in one page
          default: 100
        - name: sortBy
          in: query
          type: string
          description: Name of field you want to sort by (must be provided in snake_case)
          default: run_date_start
        - name: direction
          in: query
          type: string
          description: Define sort direction ASC or DESC
          default: desc
      responses:
        "200":
          description: List of Creative Orders
          schema:
            type: object
            properties:
              metadata:
                $ref: "#/definitions/Metadata"
              orders:
                type: array
                items:
                  $ref: "#/definitions/Order"
        "400":
          description: Bad Request
          schema:
            $ref: "#/definitions/Generic400Error"
        "401":
          description: Unauthorized
          schema:
            $ref: "#/definitions/Generic401Error"
        "403":
          description: Forbidden
          schema:
            $ref: "#/definitions/Generic403Error"
        "404":
          description: Not Found
          schema:
            $ref: "#/definitions/Generic404Error"
        "500":
          description: Internal Server Error
          schema:
            $ref: "#/definitions/Generic500Error"
  /shows:
    get:
      tags:
        - shows
      summary: Get list of shows
      description: Returns the list of shows collected from engage and ITunes
      produces:
        - application/json
      parameters:
        - name: X-Veritone-Session-ID
          in: header
          type: string
          format: uuid
          required: true
        - name: page
          in: query
          type: integer
          minimum: 1
          description: The selected page
          default: 1
        - name: pageSize
          in: query
          type: integer
          minimum: 1
          maximum: 100
          description: The numbers of items to return in one page
          default: 100
        - name: showName
          in: query
          type: string
          description: Partial search by show name
        - name: sortBy
          in: query
          type: string
          description: Name of field you want to sort by (must be provided in snake_case)
          default: show_name
        - name: direction
          in: query
          type: string
          description: Define sort direction ASC or DESC
          default: asc
      responses:
        "200":
          description: List of Shows
          schema:
            type: object
            properties:
              metadata:
                $ref: "#/definitions/Metadata"
              shows:
                type: array
                items:
                  $ref: "#/definitions/Show"
        "400":
          description: Bad Request
          schema:
            $ref: "#/definitions/Generic400Error"
        "401":
          description: Unauthorized
          schema:
            $ref: "#/definitions/Generic401Error"
        "403":
          description: Forbidden
          schema:
            $ref: "#/definitions/Generic403Error"
        "404":
          description: Not Found
          schema:
            $ref: "#/definitions/Generic404Error"
        "500":
          description: Internal Server Error
          schema:
            $ref: "#/definitions/Generic500Error"
  /orders/{orderId}:
    get:
      tags:
        - orders
      summary: Get order details by orderId
      description: Returns one Creative Order info
      produces:
        - application/json
      parameters:
        - name: X-Veritone-Session-ID
          in: header
          type: string
          format: uuid
          required: true
        - name: orderId
          in: path
          description: Get order details by Id
          required: true
          type: string
      responses:
        "200":
          description: Order Details
          schema:
            $ref: "#/definitions/Order"
        "400":
          description: Bad Request
          schema:
            $ref: "#/definitions/Generic400Error"
        "401":
          description: Unauthorized
          schema:
            $ref: "#/definitions/Generic401Error"
        "403":
          description: Forbidden
          schema:
            $ref: "#/definitions/Generic403Error"
        "404":
          description: Not Found
          schema:
            $ref: "#/definitions/Order404Error"
        "500":
          description: Internal Server Error
          schema:
            $ref: "#/definitions/Generic500Error"
  /orders/{orderId}/assets:
    get:
      tags:
        - assets
      summary: Get creative assets by orderId
      description: Returns Order details with assets for a given order
      produces:
        - application/json
      parameters:
        - name: X-Veritone-Session-ID
          in: header
          type: string
          format: uuid
          required: true
        - name: orderId
          in: path
          description: Get order details by Id
          required: true
          type: string
        - name: page
          in: query
          type: integer
          minimum: 1
          description: The selected page
          default: 1
        - name: pageSize
          in: query
          type: integer
          minimum: 1
          maximum: 100
          description: The numbers of items to return in one page
          default: 100
      responses:
        "200":
          description: Order Details
          schema:
            type: array
            items:
              $ref: "#/definitions/Asset"
        "400":
          description: Bad Request
          schema:
            $ref: "#/definitions/Generic400Error"
        "401":
          description: Unauthorized
          schema:
            $ref: "#/definitions/Generic401Error"
        "403":
          description: Forbidden
          schema:
            $ref: "#/definitions/Generic403Error"
        "404":
          description: Not Found
          schema:
            $ref: "#/definitions/Order404Error"
        "500":
          description: Internal Server Error
          schema:
            $ref: "#/definitions/Generic500Error"
  /download:
    post:
      tags:
        - download
      summary: Get zip file for list of assets
      description: Returns the zip file location of the selected assets
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: X-Veritone-Session-ID
          in: header
          type: string
          format: uuid
          required: true
        - in: body
          name: body
          description: List of assets urls and file name
          required: true
          schema:
            $ref: "#/definitions/Download"
      responses:
        "102":
          description: Processing
          schema:
            type: string
            example: Creating a zip file for the requested assets
        "200":
          description: A zip file contains assets
          schema:
            type: string
            example: zip file url
        "400":
          description: Bad Request
          schema:
            $ref: "#/definitions/DownloadAssets400Error"
        "401":
          description: Unauthorized
          schema:
            $ref: "#/definitions/Generic401Error"
        "403":
          description: Forbidden
          schema:
            $ref: "#/definitions/Generic403Error"
        "500":
          description: Internal Server Error
          schema:
            $ref: "#/definitions/Generic500Error"
  /email-assets:
    post:
      tags:
        - assets
      summary: Email the zip file for list of assets
      description: Returns the zip file location of the selected assets
      consumes:
        - application/json
      produces:
        - application/json
      parameters:
        - name: X-Veritone-Session-ID
          in: header
          type: string
          format: uuid
          required: true
        - in: body
          name: body
          description: List of assets urls
          required: true
          schema:
            $ref: "#/definitions/EmailAssets"
      responses:
        "102":
          description: Processing
          schema:
            type: string
            example: Sending an email with the zip file for the requested assets
        "200":
          description: Assets zip file location
          schema:
            type: object
            properties:
              message:
                type: string
                example: Email has been sent successfully
        "400":
          description: Bad Request
          schema:
            $ref: "#/definitions/DownloadAssets400Error"
        "401":
          description: Unauthorized
          schema:
            $ref: "#/definitions/Generic401Error"
        "403":
          description: Forbidden
          schema:
            $ref: "#/definitions/Generic403Error"
        "500":
          description: Internal Server Error
          schema:
            $ref: "#/definitions/Generic500Error"
definitions:
  Order:
    type: object
    properties:
      orderId:
        type: string
        example: a0D4U00001OA1zZUAT
      showName:
        type: string
        example: NFL Draft Contest
      advertiserName:
        type: string
        example: ESPN
      advertiserLogo:
        type: string
        example: https://www.veritone.com/wp-content/themes/veritone_com-theme/images/svg/veritone_color.svg
      advertiserWebsite:
        type: string
        example: www.espn.com
      mediaTypes:
        type: string
        example: "Podcast"
      runDateStart:
        type: string
        example: "2022-10-17T00:00:00Z"
  Metadata:
    type: object
    properties:
      currentPage:
        type: number
        example: "1"
      pageSize:
        type: number
        example: "10"
      totalRecords:
        type: number
        example: "50"
  DmhMetadata:
    type: object
    properties:
      currentPage:
        type: number
        example: "1"
      pageSize:
        type: number
        example: "100"
      hasNextPage:
        type: boolean
        example: "false"
      totalCount:
        type: number
        example: "10"
  Asset:
    type: object
    properties:
      id:
        type: string
        example: a0D4U00001QJjTcUAL
      type:
        type: string
        example: pdf
      name:
        type: string
        example: promo_details.pdf
      thumbnail:
        type: string
        example: asset url
      createdDate:
        type: string
        example: "2022-10-17T00:00:00Z"
  Download:
    type: object
    properties:
      fileName:
        type: string
        example: fileName
      items:
        type: array
        items:
          $ref: "#/definitions/Asset"
  EmailAssets:
    type: object
    properties:
      email:
        type: string
        example: joe@gmail.com
      message:
        type: string
        example: This is an optional message
      advertiserName:
        type: string
        example: ESPN
      showName:
        type: string
        example: NFL Draft Contest
      assets:
        type: array
        items:
          $ref: "#/definitions/Asset"
  Show:
    type: object
    properties:
      showId:
        type: integer
        example: 1561635433
      name:
        type: string
        example: "13: A Taylor Swift Fan Podcast"
      hostName:
        type: string
        example: "Nick Adams"
      imageUrl:
        type: string
        example: "https://is5-ssl.mzstatic.com/image/thumb/Podcasts114/v4/79/c8/d2/79c8d2b2-5d5a-365c-a067-8bcefc01d2db/mza_16543696634515633376.jpg/100x100bb.jpg"
      website:
        type: string
        example: www.espn.com
      genres:
        type: array
        items:
          type: string
        example: ["Music", "Podcast"]
      primaryGenre:
        type: string
        example: "Music"
      network:
        type: string
        example: "Umbrella Network"
      grossCost:
        type: integer
        example: 18000
      impressions:
        type: string
        example: "600k"
      grossCPM:
        type: string
        example: "20-30"
      modifyDate:
        type: string
        example: "2022-10-17T00:00:00Z"
  Generic404Error:
    type: object
    properties:
      error:
        type: string
        example: No records found for the requested resources
  Generic400Error:
    type: object
    properties:
      error:
        type: string
        example: The expected format for {parameter name} parameter is {format}
  Order404Error:
    type: object
    properties:
      error:
        type: string
        example: No records found for the OrderId provided
  DownloadAssets400Error:
    type: object
    properties:
      error:
        type: string
        example: Missing asset urls in body request/etc.
  Generic401Error:
    type: object
    properties:
      error:
        type: string
        example: User is missing required authentication
  Generic403Error:
    type: object
    properties:
      error:
        type: string
        example: User not authorized to access the requested resource/The {token name} provided has been expired
  Generic500Error:
    type: object
    properties:
      error:
        type: string
        example: An error occurred. {error message from server}/ The server was unable to complete your request