openapi: 3.2.0 info: title: Bonjoro API V2 Media API description: Bonjoro API definitions version: 1.0.0 servers: - url: https://www.bonjoro.com/ tags: - name: Media paths: /api/v2/media: get: tags: - Media summary: Get all paginated media operationId: getAllMedia responses: '200': description: ok content: application/json: schema: $ref: '#/components/schemas/allMedia' '400': description: 400 Bad Request content: application/json: schema: $ref: '#/components/schemas/badRequest' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/unauthorized' security: - OAuth: [] post: tags: - Media summary: Add a media operationId: postMedia requestBody: content: multipart/form-data: schema: properties: file: type: string format: binary tags: type: string example: logo image type: object responses: '200': description: ok content: application/json: schema: $ref: '#/components/schemas/media' '400': description: 400 Bad Request content: application/json: schema: $ref: '#/components/schemas/badRequest' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/unauthorized' security: - OAuth: [] /api/v2/media/{media_id}: delete: tags: - Media summary: Delete a media operationId: deleteMedia parameters: - name: media_id in: query required: true schema: type: string format: uuid responses: '200': description: ok content: application/json: schema: properties: message: type: string example: Deleted data: $ref: '#/components/schemas/media' type: object '400': description: 400 Bad Request content: application/json: schema: $ref: '#/components/schemas/badRequest' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/unauthorized' security: - OAuth: [] components: schemas: media: allOf: - properties: type: type: string example: Media name: type: string example: like.png tags: type: string example: logo image url: type: string format: uri example: /example-path-to-url type: object - $ref: '#/components/schemas/idUUID' - $ref: '#/components/schemas/timestamps' timestamps: properties: created_at: type: string format: datetime example: '2021-01-11 01:51:26' updated_at: type: - string - 'null' format: datetime example: '2021-01-11 01:51:26' type: object pagination: properties: current_page: type: integer example: 1 first_page_url: type: string last_page_url: type: string path: type: string from: type: integer example: 1 last_page: type: integer example: 2 next_page_url: type: string per_page: type: integer example: 15 prev_page_url: type: integer type: object idUUID: properties: id: type: string format: uuid example: a5e7c858-1f85-4fe2-8c1d-4c77cfc3204f type: object allMedia: allOf: - properties: data: type: array items: allOf: - $ref: '#/components/schemas/media' type: object - $ref: '#/components/schemas/pagination' unauthorized: properties: message: type: string example: Unauthorized. type: object badRequest: properties: error: properties: message: type: string example: Error message status_code: type: integer example: 400 type: object type: object