Jump to: navigation, search
(Overview)
 
(4 intermediate revisions by 2 users not shown)
Line 31: Line 31:
 
|-
 
|-
 
| uploadType
 
| uploadType
| Optional. The file upload type. Possible values include <tt>standard-response</tt> or <tt>file-system</tt>.  
+
| (Optional) The file upload type. Possible values include <tt>standard-response</tt> or <tt>file-system</tt>.  
 
|-
 
|-
 
| uploadPath
 
| uploadPath
| Optional. The file upload path. Possible values include:  
+
| (Optional) The file upload path. Possible values include:  
 
*ID of SR for standard-response upload type  
 
*ID of SR for standard-response upload type  
 
*Location on HDD where file was taken from for file-system upload type.
 
*Location on HDD where file was taken from for file-system upload type.
 
|-
 
|-
 
| description
 
| description
| Optional. A description of the file.
+
| (Optional) A description of the file.
 
|}
 
|}
  
Line 45: Line 45:
 
===Request===
 
===Request===
 
<source lang="text">
 
<source lang="text">
POST api/v2/me/chats/0000RaB4Q006001F
 
 
POST api/v2/me/chats/0001PaBMYY3600R8  
 
POST api/v2/me/chats/0001PaBMYY3600R8  
 
   
 
   

Latest revision as of 11:29, June 15, 2017

UploadFile

This operation is part of the Chat API section of the Web Services API.

Overview

This request uploads an attached document to the specified chat.

Important
Before executing this operation, you must link the particular chat interaction with the file that the agent wants to send. To link an existing file from standard response, use the AddAttachment operation.
Request URL /api/v2/me/chats/{id}
HTTP Method POST
Required Features api-multimedia

Parameters

Parameter Value
operationName UploadFile
documentId The ID of the document.
uploadType (Optional) The file upload type. Possible values include standard-response or file-system.
uploadPath (Optional) The file upload path. Possible values include:
  • ID of SR for standard-response upload type
  • Location on HDD where file was taken from for file-system upload type.
description (Optional) A description of the file.

Sample

Request

POST api/v2/me/chats/0001PaBMYY3600R8 
 
{
 "operationName": "UploadFile", 
 "documentId": "0001PaBMYY3600RC"
}

Response

{
  "statusCode": 0
}

Notification

{
    "chatPath": "/chats/0001PaBMYY3600R8",
    "chatUri": "http://.../api/v2/chats/0001PaBMYY3600R8",
    "messageType": "MessageLogUpdated",
    "messages": [
        {
            "attachment": {
                "fileId": "009F5790DAD80068",
                "id": "0001PaBMYY3600RC",
                "name": "testfileUploadAgent.txt",
                "path": "/attachments/0001PaBMYY3600RC",
                "size": 46,
                "uri": "http://.../api/v2/attachments/0001PaBMYY3600RC"
            },
            "from": {
                "id": "009F5790DA8D0066",
                "nickname": "TestName",
                "participantId": "009F5790DA8D0066",
                "path": "/users/0bcb93c9854f41d6ad89344047ec3223",
                "type": "Agent",
                "uri": "http://.../api/v2/users/0bcb93c9854f41d6ad89344047ec3223",
                "visibility": "All"
            },
            "index": 7,
            "noticeText": "file-uploaded",
            "timestamp": "2016-07-21 17:23:20.000+0300",
            "timestampSeconds": 1469111000000,
            "type": "SystemCommand",
            "visibility": "All"
        }
    ],
    "notificationType": "NewMessages"
}
This page was last edited on June 15, 2017, at 11:29.
Comments or questions about this documentation? Contact us for support!