Create a new chat message in a specified space. The chat can include uploaded file(s). To upload a file with a chat message:

  1. Get the upload URL from /api/files/getuploadurl and note the fileKey value from the response.
  2. Use the fileKey from step one as the fileId in the request body.

URL Parameters

NameDescriptionLocationRequiredDefault Value
spaceIdUnique identifier of the space.pathYes

Body Parameters

NameDescriptionJSON typeRequiredDefault Value
contentObject with task properties.
  • bodyText: (string) message text to send
  • data: (array) array of objects representing attached files
    • fileId: (string) fileKey from /files/getuploadurl
    • fileSize: (int) size of file in bytes
    • fileType: (string) 'image', 'video', 'audio', or (default) 'document'
    • name: (string) file name
    • provider: (string) 'native'
    • providerFileType: (string) MIME type
    • thumbnailFile: (string) fileKey of thumbnail from /files/getuploadurl
objectYes

Authentication

JwtAuthenticator, Oauth2Authenticator, AnonymousAuthenticator

Example Request

URL

POST https://spacesapis.avayacloud.com/api/spaces/{spaceId}/chats

Headers

Authorization: "jwt eyJhbGciOiJSUzI1NiIsIdfgdfgnR5cCI6IkpXVCJ9.eyJ1c2VyX2lkX3NpZyI6ImxPWHpxNzVzR3J3X0xwWEMyRGRMakhyYXJlWVhyTzFMdEZHZkhkOWNkTXciLCJwcm9kdWN0X3R5cGUiOiJhY2NvdW50cyIsImxhc3R1cGRhdGV0aW1lIjoiMjAxNy0wMS0zMFQxMzo1ODo0Ny4yMDYiLCJpc3MiOiJ6YW5nLmlvIiwicHVibGlja2V5aWQiOiJhZ3h6Zm05dVpYTnVZVEl3TVRSeUdnc1NEVWRLZDNSUWRXSnNhV05MWlhrdfgdWdJQ2dsUEtFakFvTSIsImV4cCI6MTQ5NTM5MTIwMywidXNlcl9pZCI6ImFneHpmbTl1WlhOdVlUSXdNVFJ5RVFzU0JGVnpaWElZZ0lEQXMtX25fUW9NIiwidmVyIjoiMi4wIn0.SqZpw1uPIebqW3qlDsm0-DWYFKEH0SgPwtD-tSESWOF-5hLkZMqJH28ooWux2S7s9riIew7pTVPnZpTgJa5zHcEAG0gXSEJVOqmpGp_4ufM8YtZoZMpBFjyAkwyAt-ILkGUYIo0GU5WyzMPLV8YLXfgdfgOgkE2MGGOajBkjPmC2Db3pA0D0M9k-21EL1gwWBC5YIq0PDAkgulegwl6khRmB8irJQ-dfg-d-KV9eYfFpsCdJKRGzSfqg"

Or

Authorization: "bearer f746696f5de4528u128ae2f274eea253e8a7943a"

Body

{
  "content": {
      "bodyText": "Hello world",
      "data": [{
          "fileId": "80b65d25-d960-4356-ab4d-8b09590efcd0",
          "fileSize": 3239,
          "fileType": "document",
          "icon": "",
          "name": "env2 (1)",
          "provider": "native",
          "providerFileType": ""
      }]              
  }
}

Example Response

{
    "data": [
        {
            "sender": {
                "_id": "5efc5417aa4a347af96de290",
                "type": "user",
                "username": "example@gmail.com",
                "displayname": "example example",
                "picture_url": "https://storage.googleapis.com/onesna/pictures/pfpic_testavimas1899_29bef4a8-99b0-4901-86c7-567a64d9dcbb"
            },
            "content": {
                "endTime": null,
                "mediaMode": "audio",
                "virtualEndTime": null,
                "meetingStatus": "active",
                "bodyText": "Hello world",
                "data": [
                    {
                        "metaData": {
                            "paging": 0,
                            "prvwProvd": "gcs",
                            "stgeProvd": "gcs"
                        },
                        "keywords": [],
                        "convertStatus": 0,
                        "convertStart": null,
                        "nextSchedule": null,
                        "pages": 0,
                        "recordingId": null,
                        "type": null,
                        "provider": "native",
                        "providerFileType": "",
                        "fileType": "document",
                        "name": "env2 (1)",
                        "fileId": "80b65d25-d960-4356-ab4d-8b09590efcd0",
                        "icon": "",
                        "thumbnail": "",
                        "description": "",
                        "previewFile": "",
                        "fileSize": 3239,
                        "thumbnailFile": "",
                        "path": "https://storage.googleapis.com/spaces2020/logan%2F80b65d25-d960-4356-ab4d-8b09590efcd0?GoogleAccessId=spaces2020@spaces-2018.iam.gserviceaccount.com&Expires=1596635673&Signature=fCB2u5W7B%2B%2FpeWkNKCdJFaAwETyGcaW5qBuzy2K4sbOKt6dYgRCEK9Nrs51cLas1CH0AtRlc2sk5bdRhX%2FkjYv5LFlhh2eZSSsPZ09vLAZ0L3Ul%2BRbmCHb15lmf%2Fdr9%2ByoMzKRc2eQBhsNlGjsChNRo6zIlMa%2FP0J8X9EmYbi2nOFdA3DOHbyragQvFHAITgytbW4YBK9ra%2Bkj0pxdfuxstF%2BKUWIcpy9l8WLyJGP1EBnfvMQB6OWp5JcptSVffsLM81qW2SkIdPfhQtjnOvI2xHKABSLzYi9RcKZhRGLqoMyLtP%2BMeT21%2B7oS54ikcw3FQoNiSlfbo1j%2BIFQXxT1Q%3D%3D&response-content-disposition=attachment%3B%20filename%3D%22env2%20(1)%22"
                    }
                ],
                "description": "",
                "startTime": "2020-08-05T11:54:33.297Z",
                "recordings": []
            },
            "chatCount": 0,
            "likeCount": 0,
            "status": 0,
            "_id": "5f2a9df91c85f02eb068a4e0",
            "category": "chat",
            "topicId": "5f2276a8fe5c16664f01c5be",
            "created": "2020-08-05T11:54:33.290Z",
            "modified": "2020-08-05T11:54:33.290Z"
        }
    ]
}