8x8

Chapi - Chat API

8x8 Chapi chat API for programmatic creation of chat conversations against the contact center chat service.

OpenAPI Specification

8x8-actions-events-chapi---chat-api.json Raw ↑
{
  "openapi": "3.0.0",
  "info": {
    "description": "8x8 Work Chat API",
    "version": "0.1",
    "title": "Chapi - Chat API"
  },
  "tags": [
    {
      "name": "chat",
      "description": "Send and receive public Chat Room messages"
    },
    {
      "name": "health",
      "description": "Publicly available health metrics"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "x-samples-languages": ["curl", "node", "ruby", "java", "php"],
  "paths": {
    "/api/chat/v1/messages/": {
      "post": {
        "tags": ["chat"],
        "summary": "Send a message to a public chat room.",
        "description": "This will send a message to a room. If the room does not exist Chapi will create the room, then send the message to it. This endpoint is unable to send messages if the room is private.",
        "operationId": "sendmessageusingpost",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendMessageVO"
              }
            }
          },
          "description": "message",
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SendMessageResponseVO"
                }
              },
              "application/json": {
                "examples": {
                  "response": {
                    "value": {
                      "parsed": "Hello World!"
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Created"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "deprecated": false
      }
    },
    "/api/chat/v1/messages": {
      "get": {
        "tags": ["chat"],
        "summary": "Fetches messages for a room. Defaults to `CHAPI sandbox` room.",
        "description": "Fetches a list of messages from the room.",
        "operationId": "getmessagesusingget_1",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "description": "pageSize",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 30
            }
          },
          {
            "name": "room",
            "in": "query",
            "description": "room",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ts",
            "in": "query",
            "description": "ts",
            "required": false,
            "schema": {
              "type": "integer",
              "format": "int64",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MessageVO"
                  }
                }
              },
              "application/json": {
                "examples": {
                  "response": {
                    "value": {
                      "authorUser": {
                        "avatarUrl": "https://roombot.s3.us-west-1.amazonaws.com/chapi.png",
                        "email": "developer@8x8.com",
                        "id": "94y4Kq619DeqY30EiGVkdxlU2CpNYJ0E4aAguR46mvc",
                        "name": "Chapi"
                      },
                      "messageParsed": "Hello world",
                      "id": "RqQ_b5wiFutWmGlzZCrsSdsmQhdZV6iPu_P5CrPSoDs",
                      "timestamp": 1594918006814947
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "404": {
            "description": "Not Found"
          }
        },
        "deprecated": false
      }
    }
  },
  "servers": [
    {
      "url": "//api.8x8.com/chat"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "ChatSpaceInfoVO": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string"
          },
          "roomId": {
            "type": "string"
          },
          "room": {
            "type": "string"
          }
        },
        "title": "ChatSpaceInfoVO"
      },
      "ChatUserVO": {
        "type": "object",
        "properties": {
          "avatarUrl": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "title": "ChatUserVO"
      },
      "HealthVO": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["UP", "DOWN", "UNKNOWN", "OUT_OF_SERVICE"]
          }
        },
        "title": "HealthVO"
      },
      "MessageVO": {
        "type": "object",
        "properties": {
          "authorUser": {
            "$ref": "#/components/schemas/ChatUserVO"
          },
          "id": {
            "type": "string"
          },
          "parsed": {
            "type": "string"
          },
          "timestamp": {
            "type": "integer",
            "format": "int64"
          }
        },
        "title": "MessageVO",
        "description": "The Message Object"
      },
      "SendMessageResponseVO": {
        "type": "object",
        "properties": {
          "parsed": {
            "type": "string"
          }
        },
        "title": "SendMessageResponseVO"
      },
      "SendMessageVO": {
        "type": "object",
        "properties": {
          "messageRaw": {
            "type": "string"
          },
          "room": {
            "type": "string"
          }
        },
        "title": "SendMessageVO"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true,
    "samples-enabled": true
  }
}