Chore: Inbox Members API improvements (#3008)

- New Inbox Member APIs
- Return JSON errors for Platform APIs
This commit is contained in:
Sojan Jose
2021-09-14 11:55:02 +05:30
committed by GitHub
parent ccd0dc39ad
commit 22d1c8baf2
25 changed files with 767 additions and 131 deletions

View File

@@ -1920,7 +1920,7 @@
"tags": [
"Inbox"
],
"operationId": "GetInboxe",
"operationId": "GetInbox",
"summary": "Get an inbox",
"description": "Get an inbox available in the current account",
"parameters": [
@@ -2198,6 +2198,213 @@
}
}
},
"/api/v1/accounts/{account_id}/inbox_members": {
"get": {
"tags": [
"Inbox"
],
"operationId": "get-inbox-members",
"summary": "List Agents in Inbox",
"description": "Get Details of Agents in an Inbox",
"security": [
{
"userApiKey": [
]
}
],
"parameters": [
{
"$ref": "#/parameters/inbox_id"
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"description": "Array of all active agents",
"items": {
"$ref": "#/definitions/agent"
}
}
},
"404": {
"description": "Inbox not found"
},
"403": {
"description": "Access denied"
}
}
},
"post": {
"tags": [
"Inbox"
],
"operationId": "add-new-agent-to-inbox",
"summary": "Add a New Agent",
"description": "Add a new Agent to Inbox",
"security": [
{
"userApiKey": [
]
}
],
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"inbox_id": {
"type": "string",
"description": "The ID of the inbox",
"required": true
},
"user_ids": {
"type": "array",
"description": "IDs of users to be added to the inbox",
"required": true
}
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"description": "Array of all active agents",
"items": {
"$ref": "#/definitions/agent"
}
}
},
"404": {
"description": "Inbox not found"
},
"403": {
"description": "Access denied"
},
"422": {
"description": "User must exist"
}
}
},
"patch": {
"tags": [
"Inbox"
],
"operationId": "update-agents-in-inbox",
"summary": "Update Agents in Inbox",
"description": "All agents execept the one passed in params will be removed",
"security": [
{
"userApiKey": [
]
}
],
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"inbox_id": {
"type": "string",
"description": "The ID of the inbox",
"required": true
},
"user_ids": {
"type": "array",
"description": "IDs of users to be added to the inbox",
"required": true
}
}
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"type": "array",
"description": "Array of all active agents",
"items": {
"$ref": "#/definitions/agent"
}
}
},
"404": {
"description": "Inbox not found"
},
"403": {
"description": "Access denied"
},
"422": {
"description": "User must exist"
}
}
},
"delete": {
"tags": [
"Inbox"
],
"operationId": "delete-agent-in-inbox",
"summary": "Remove an Agent from Inbox",
"description": "Remove an Agent from Inbox",
"security": [
{
"userApiKey": [
]
}
],
"parameters": [
{
"name": "data",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"inbox_id": {
"type": "string",
"description": "The ID of the inbox",
"required": true
},
"user_ids": {
"type": "array",
"description": "IDs of users to be deleted from the inbox",
"required": true
}
}
}
}
],
"responses": {
"200": {
"description": "Success"
},
"404": {
"description": "Inbox not found"
},
"403": {
"description": "Access denied"
},
"422": {
"description": "User must exist"
}
}
}
},
"/api/v1/accounts/{account_id}/conversations/{id}/messages": {
"post": {
"tags": [
@@ -3193,6 +3400,46 @@
}
}
},
"agent": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"uid": {
"type": "string"
},
"name": {
"type": "string"
},
"available_name": {
"type": "string"
},
"display_name": {
"type": "string"
},
"email": {
"type": "string"
},
"account_id": {
"type": "number"
},
"role": {
"type": "string",
"enum": [
"agent",
"administrator"
]
},
"confirmed": {
"type": "boolean"
},
"custom_attributes": {
"type": "object",
"description": "Available for users who are created through platform APIs and has custom attributes associated."
}
}
},
"inbox": {
"type": "object",
"properties": {
@@ -4128,6 +4375,15 @@
"required": true,
"description": "The ID of the team to be updated"
},
"inbox_id": {
"in": "path",
"name": "inbox_id",
"schema": {
"type": "integer"
},
"required": true,
"description": "The ID of the Inbox"
},
"hook_id": {
"in": "path",
"name": "hook_id",