CloudTalk CueCard API

CueCards API ver. 1.0.2

OpenAPI Specification

cloudtalk-cuecard-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: CloudTalk Agents CueCard API
  description: "# Introduction\nWelcome to CloudTalk API reference! Many of these businesses use the CloudTalk API to automate and enhance their customer support with CloudTalk Support. With CloudTalk we are re-building telco industry from the ground and taking it to the next level with first-class customer support system. Please find below the full documenation to CloudTalk.\n\n# API Overview\n\nThe API is organized around the following resources:\n\nAPI Area | Description\n----------------|-------------\nCalls | Browse your call history, download recordings and access all your calls data.\nContacts | Create and update Contacts. Use filters to get lists of Contacts, or access their profiles individually.\nNumbers | Automate Numbers modifications. List all your numbers.\nAgents | Create or update your Agents, access their settings.\nConversation Intelligence | Get Conversation Intelligence data about your calls.\nVoiceAgent | Initiate VoiceAgent calls\n\n\n[JSON](http://www.json.org/) is returned in all responses. XML is not supported.\n\nThe API also uses common approaches for the following:\n\nFunction | Description\n----------------|-------------\nData | API data is JSON encoded with UTF-8. API JSON is either a single object or a list of objects.\nErrors | 4xx and 5xx responses returning JSON with error codes\nRate Limiting | Controls how many requests can be made in a time window\nHTTP | Methods are used in accordance with HTTP (GET POST and DELETE are the primary methods used) and resources are identified using URIs. All API requests are sent over HTTPS.\n\n\n## Authentication\n\nThis is an HTTPS-only API. Authentication is based on API Access Key ID and Access Key Secret. The API Access Key ID and Access Key Secret is passed via HTTP Basic Authentication.\n\n Basic Auth credentials are used to determine on which project should this request be executed on. List of all Basic Auth credentials for the project can be found by Administrators in the Cloudtalk Dashboard Account → Settings → API keys tab.\n\nTo try the API via curl on the command-line, the general form used would be:\n```\ncurl -u ACCESS_KEY_ID:ACCESS_KEY_SECRET API_URL\n```\n\nFor instance, you would execute:\n```\ncurl -u ABCDEFGHIJTESTKEY1:X05Dg4c331c3h61An https://my.cloudtalk.io/api/calls/index.json\n```\n\n## Usage\n\nThe API may rate limit submission of requests for your application. Such limits are managed as an allowed number of operations per time window, where an operation might be read or an update. In that case a **'429 Too Many Requests'** response code will be returned along with the following headers -\n\nHeader name | Description\n----------------|-------------\nX-CloudTalkAPI-Limit | Maximum number of API requests allowed in the current time window.\nX-CloudTalkAPI-Remaining | Number of API requests left in the current window.\nX-CloudTalkAPI-ResetTime | Time when rate limit window will be reset as a Unix timestamp.\n\nNote that the default rate limit is **60 operations per minute per company**. If you need to make more requests, please contact our support with detailed explanation of your use case.\n\n## Response Envelopes\n\n**Note:** Conversation Intelligence doesn't follow envelopes.\n\nThe API returns one of three envelopes depending upon the request issued:\n\n1. Single Item Envelope\n2. Collections Envelope\n3. Error Envelope\n\n### Single Item Envelope\n\nAll dates/times are returned in ISO8601 format and in UTC timezone.\n\n```\nStatus: 200 OK\n{\n    \"responseData\": {\n        \"id\": 123,\n        ...\n        \"created\": \"2018-01-10 12:34:56\"\n    }\n}\n```\n\n### Collections Envelope\n\nAll dates/times are returned in ISO8601 format and in UTC timezone.\n\n```\nStatus: 200 OK\n{\n    \"responseData\": {\n        \"itemsCount\": 65,\n        \"pageCount\": 3,\n        \"pageNumber\": 1,\n        \"limit\": 30,\n        \"data\": [\n            {\n                \"id\": 123,\n                ...\n                \"created\": \"2018-01-10 12:34:56\"\n            },\n            {\n                \"id\": 456,\n                ...\n                \"created\": \"2017-10-19 09:21:29\"\n            },\n            ...\n        ]\n    }\n}\n```\n\n### Error Envelope\n\n```\nStatus: 404 Not Found\n{\n    \"responseData\": {\n        \"status\": 404,\n        \"message\": \"Not Found\"\n    }\n}\n```\n\n## Encoding\n\nData is encoded as defined by JSON in [RFC4627](http://www.ietf.org/rfc/rfc4627.txt). The default encoding for APIs is UTF-8.\n\nSome query parameters may need to be [url encoded](https://www.wikiwand.com/en/Percent-encoding) when sending - for example, the email parameter value used to query users should be encoded.\n\n## Use of HTTP\n\nRequest methods are used in accordance with HTTP -\n\n- `GET` is used to access resources and perform queries. The API does not allow modifications (creates, updates, deletes) to occur via GET.\n- `PUT` is used to create resources.\n- `POST` is used to update resources. PATCH is not currently used by the API.\n- `DELETE` is used to delete resources.\n\nResponses use standard HTTP codes. Where there are client or server errors, a list of of one or more errors in JSON format is returned in the body.\n\nThe `Accept` header must be used by a client used to indicate a preferred response for `GET/HEAD` requests. Requests without an `Accept` header of `application/json` may be rejected with a client error of 404 or 406. The `Content-Type` header should be used by clients to indicate the submitted format for `POST/PUT` requests."
  contact:
    name: CloudTalk API Support
    url: https://www.cloudtalk.io/contact
  version: '1.7'
  x-logo:
    url: https://my.cloudtalk.io/img/logo-cloudtalk-color.png
servers:
- url: https://my.cloudtalk.io/api
tags:
- name: CueCard
  description: CueCards API ver. 1.0.2
paths:
  /cuecards:
    post:
      servers:
      - url: https://platform-api.cloudtalk.io/api/
      summary: Create CueCard request to be displayed to agent during the active call
      operationId: postCueCard
      tags:
      - CueCard
      requestBody:
        description: Cue Card request definition
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CueCardRequest'
      responses:
        '200':
          description: CueCard request processed correctly
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
              example:
                success: true
        '400':
          description: Request body not matching definition
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CueCardError'
              example:
                success: false
                errors:
                - field validation for 'CallUUID' failed (required)
        '424':
          description: No active call matching call id was found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CueCardError'
              example:
                success: false
                errors:
                - 'no such active call - call_uuid: aa-bb-cc'
        '500':
          description: Unexpected server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CueCardError'
              example:
                success: false
                errors:
                - error processing cue card
components:
  schemas:
    ContentHTML:
      type: string
      description: The value as typed in html text editor
    ContentBlockRichText:
      type: object
      properties:
        type:
          type: string
        name:
          type: string
          description: Field name to display
        value:
          type: string
          description: The value as typed in Rich text editor
    CueCardRequest:
      type: object
      required:
      - title
      - call_uuid
      - type
      - content
      properties:
        call_uuid:
          type: string
          description: unique id of the active call
        type:
          type: string
        title:
          type: string
          description: Cue card Title
        subtitle:
          type: string
          description: Cue card Subtitle
        icon_url:
          type: string
          description: Url path to the cue card icon
        content:
          oneOf:
          - $ref: '#/components/schemas/ContentHTML'
          - $ref: '#/components/schemas/ContentBlock'
    ContentBlock:
      type: array
      items:
        anyOf:
        - $ref: '#/components/schemas/ContentBlockTextField'
        - $ref: '#/components/schemas/ContentBlockRichText'
        - $ref: '#/components/schemas/ContentBlockImage'
        - $ref: '#/components/schemas/ContentBlockFile'
    CueCardError:
      type: object
      properties:
        success:
          type: boolean
        errors:
          type: array
          description: array of errors
          items:
            type: string
    ContentBlockFile:
      type: object
      properties:
        type:
          type: string
        name:
          type: string
          description: file name to display
        file_url:
          type: string
          description: url path to file
        icon_url:
          type: string
          description: url path to file icon
    ContentBlockTextField:
      type: object
      properties:
        type:
          type: string
        name:
          type: string
          description: Field name to display
        value:
          type: string
          description: text field value
    ContentBlockImage:
      type: object
      properties:
        type:
          type: string
        name:
          type: string
          description: image name to display
        image_url:
          type: string
          description: url path to image