chore: Swagger documentation for public APIs (#2417)
This commit is contained in:
@@ -67,6 +67,55 @@ platform/api/v1/users/{id}/login:
|
||||
|
||||
# ---------------- end of platform path -----------#
|
||||
|
||||
# ------------ Public API routes ------------#
|
||||
|
||||
# Contacts
|
||||
|
||||
public/api/v1/inboxes/{inbox_identifier}/contacts:
|
||||
parameters:
|
||||
- $ref: '#/parameters/public_inbox_identifier'
|
||||
post:
|
||||
$ref: ./public/inboxes/contacts/create.yml
|
||||
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}:
|
||||
parameters:
|
||||
- $ref: '#/parameters/public_inbox_identifier'
|
||||
- $ref: '#/parameters/public_contact_identifier'
|
||||
get:
|
||||
$ref: './public/inboxes/contacts/show.yml'
|
||||
patch:
|
||||
$ref: ./public/inboxes/contacts/update.yml
|
||||
|
||||
|
||||
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations:
|
||||
parameters:
|
||||
- $ref: '#/parameters/public_inbox_identifier'
|
||||
- $ref: '#/parameters/public_contact_identifier'
|
||||
post:
|
||||
$ref: ./public/inboxes/conversations/create.yml
|
||||
get:
|
||||
$ref: ./public/inboxes/conversations/index.yml
|
||||
|
||||
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages:
|
||||
parameters:
|
||||
- $ref: '#/parameters/public_inbox_identifier'
|
||||
- $ref: '#/parameters/public_contact_identifier'
|
||||
- $ref: '#/parameters/conversation_id'
|
||||
post:
|
||||
$ref: ./public/inboxes/messages/create.yml
|
||||
get:
|
||||
$ref: ./public/inboxes/messages/index.yml
|
||||
public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}:
|
||||
parameters:
|
||||
- $ref: '#/parameters/public_inbox_identifier'
|
||||
- $ref: '#/parameters/public_contact_identifier'
|
||||
- $ref: '#/parameters/conversation_id'
|
||||
- $ref: '#/parameters/message_id'
|
||||
patch:
|
||||
$ref: ./public/inboxes/messages/update.yml
|
||||
|
||||
# ---------------- end of public api routes-----------#
|
||||
|
||||
# ------------ Application API routes ------------#
|
||||
# AgentBots
|
||||
|
||||
/api/v1/accounts/{account_id}/agent_bots:
|
||||
|
||||
20
swagger/paths/public/inboxes/contacts/create.yml
Normal file
20
swagger/paths/public/inboxes/contacts/create.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
tags:
|
||||
- Contacts API
|
||||
operationId: create-a-contact
|
||||
summary: Create a contact
|
||||
description: Create a contact
|
||||
security:
|
||||
- nil
|
||||
parameters:
|
||||
- name: data
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/public_contact_create_update_payload'
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/public_contact'
|
||||
401:
|
||||
description: Unauthorized
|
||||
16
swagger/paths/public/inboxes/contacts/show.yml
Normal file
16
swagger/paths/public/inboxes/contacts/show.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
tags:
|
||||
- Contacts API
|
||||
operationId: get-details-of-a-contact
|
||||
summary: Get a contact
|
||||
description: Get the details of a contact
|
||||
security:
|
||||
- nil
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/public_contact'
|
||||
401:
|
||||
description: Unauthorized
|
||||
404:
|
||||
description: The given contact does not exist
|
||||
20
swagger/paths/public/inboxes/contacts/update.yml
Normal file
20
swagger/paths/public/inboxes/contacts/update.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
tags:
|
||||
- Contacts API
|
||||
operationId: update-a-contact
|
||||
summary: Update a contact
|
||||
description: Update a contact's attributes
|
||||
security:
|
||||
- nil
|
||||
parameters:
|
||||
- name: data
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/public_contact_create_update_payload'
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/public_contact'
|
||||
401:
|
||||
description: Unauthorized
|
||||
14
swagger/paths/public/inboxes/conversations/create.yml
Normal file
14
swagger/paths/public/inboxes/conversations/create.yml
Normal file
@@ -0,0 +1,14 @@
|
||||
tags:
|
||||
- Conversations API
|
||||
operationId: create-a-conversation
|
||||
summary: Create a conversation
|
||||
description: Create a conversation
|
||||
security:
|
||||
- nil
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/public_conversation'
|
||||
401:
|
||||
description: Unauthorized
|
||||
15
swagger/paths/public/inboxes/conversations/index.yml
Normal file
15
swagger/paths/public/inboxes/conversations/index.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
tags:
|
||||
- Conversations API
|
||||
operationId: list-all-contact-conversations
|
||||
summary: List all conversations
|
||||
description: List all conversations for the contact
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
type: array
|
||||
description: 'Array of conversations'
|
||||
items:
|
||||
$ref: '#/definitions/public_conversation'
|
||||
401:
|
||||
description: Unauthorized
|
||||
20
swagger/paths/public/inboxes/messages/create.yml
Normal file
20
swagger/paths/public/inboxes/messages/create.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
tags:
|
||||
- Messages API
|
||||
operationId: create-a-message
|
||||
summary: Create a message
|
||||
description: Create a message
|
||||
security:
|
||||
- nil
|
||||
parameters:
|
||||
- name: data
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/public_message_create_payload'
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/public_message'
|
||||
401:
|
||||
description: Unauthorized
|
||||
15
swagger/paths/public/inboxes/messages/index.yml
Normal file
15
swagger/paths/public/inboxes/messages/index.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
tags:
|
||||
- Messages API
|
||||
operationId: list-all-converation-messages
|
||||
summary: List all messages
|
||||
description: List all messages in the conversation
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
type: array
|
||||
description: 'Array of messages'
|
||||
items:
|
||||
$ref: '#/definitions/public_message'
|
||||
401:
|
||||
description: Unauthorized
|
||||
20
swagger/paths/public/inboxes/messages/update.yml
Normal file
20
swagger/paths/public/inboxes/messages/update.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
tags:
|
||||
- Messages API
|
||||
operationId: update-a-message
|
||||
summary: Update a message
|
||||
description: Update a message
|
||||
security:
|
||||
- nil
|
||||
parameters:
|
||||
- name: data
|
||||
in: body
|
||||
required: true
|
||||
schema:
|
||||
$ref: '#/definitions/public_message_update_payload'
|
||||
responses:
|
||||
200:
|
||||
description: Success
|
||||
schema:
|
||||
$ref: '#/definitions/public_message'
|
||||
401:
|
||||
description: Unauthorized
|
||||
Reference in New Issue
Block a user