Jump to: navigation, search

AddAttachment

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

Add Existing Document

Overview

This request adds a document that was previously saved in UCS database to the specified chat.

Request URL /api/v2/me/chats/{id}
HTTP Method POST
Required Features api-multimedia

Parameters

Parameter Value
operationName AddAttachment
documentId The document's ID.
size Optional. The file size of the document.
name Optional. The name of the document.
mime Optional. The mime type of the document.

Sample

POST api/v2/me/chats/0001PaBMYY3600R8 
 
{
 "operationName": "AddAttachment", 
 "documentId": "0000YaB6ARKB0019"
}

Response

{
  "statusCode": 0
}

Notification

{ 
    "chat": {
        "attachments": [
	     {
                "id": "0001PaBMYY3600RC",
                "mime": "text/plain",
                "name": "testfileUploadAgent.txt",
                "path": "/attachments/0001PaBMYY3600RC",
                "size": 46,
                "uri": "http://.../api/v2/chats/0001PaBMYY3600R8/attachments/0001PaBMYY3600RC"
            },
	     {
                "id": "0000YaB6ARKB0019",
                "mime": "application/octet-stream",
                "name": "cloud-2015-12-01.log",
                "path": "/attachments/0000YaB6ARKB0019",
                "size": 20053630,
                "uri": "http://.../api/v2/chats/0001PaBMYY3600R8/attachments/0000YaB6ARKB0019"
            }
        ],
        "capabilities": [
            "Transfer",
            "Leave",
            "Invite",
            "Consult",
            "SetInFocus",
            "SetDisposition",
            "AttachUserData",
            "DeleteUserData",
            "UpdateUserData",
            "Complete",
            "SendMessage",
            "SendUrl",
            "SendStartTypingNotification",
            "SendStopTypingNotification",
            "SendCustomNotice"
        ],
        "chatType": "Inbound",
        "id": "0001PaBMYY3600R8",
        "interactionQueue": "CloudPoDSimpleChatInQ",
        "participants": [
            {
                 "id": "009F5790F75F009A",
                 "nickname": "FirstStep",
                 "participantId": "009F5790F75F009A",
                 "type": "Customer",
                 "visibility": "All"
            },
            {
                 "id": "009F5790F3F9008A",
                 "nickname": "PoD service",
                 "participantId": "009F5790F3F9008A",
                 "type": "External",
                 "visibility": "All"
            },
            {
                 "id": "009F5790F765009C",
                 "nickname": "TestName",
                 "participantId": "009F5790F765009C",
                 "path": "/users/0bcb93c9854f41d6ad89344047ec3223",
                 "type": "Agent",
                 "uri": "http://.../api/v2/users/0bcb93c9854f41d6ad89344047ec3223",
                 "visibility": "All"
            }
        ],
        "receivedDate": "2016-07-21 19:25:03.000+0300",
        "state": "Chatting",
        "suggestedQueueUris": [
            "http://192.168.83.63:8090/api/v2/queues/62464e99-53c8-4fda-9cfd-c63dee679c6d"
        ],
        "threadId": "0001PaBMYY3600T9",
        "uri": "http://.../api/v2/chats/0001PaBMYY3600R8",
        "userData": {
            "CBR-IT-path_DBIDs": "",
            "CBR-Interaction_cost": "",
            "CBR-actual_volume": "",
            "CBR-contract_DBIDs": "",
            "ChatServerAppName": "esv_chat_srv_851",
            "ChatServerDBID": "159",
            "ChatServerHost": "dev-ip9-152.gws.genesys.com",
            "ChatServerPort": "7160",
            "CustomerSegment": "default",
            "IW_BundleUid": "0ceb38e6-c3dc-412d-1d55-9f9c13a2af9e",
            "IW_CaseUid": "6d1f299c-4b0e-4766-2631-86641b43ed1b",
            "IdentifyCreateContact": "3",
            "OccuredAt": "2016-07-21T16:25:06Z",
            "PegAG?:2>1": 1,
            "RRequestedSkillCombination": "",
            "RRequestedSkills": null,
            "RStrategyDBID": "472",
            "RStrategyName": "CloudPoDSimpleChatInStrategy",
            "RTargetAgentGroup": "?:2>1",
            "RTargetAgentSelected": "a1",
            "RTargetObjSelDBID": "",
            "RTargetObjectSelected": "?:2>1",
            "RTargetPlaceSelected": "a1",
            "RTargetRequested": "?:2>1",
            "RTargetRuleSelected": "",
            "RTargetTypeSelected": "2",
            "RTenant": "Environment",
            "RVQDBID": "",
            "RVQID": "",
            "ServiceObjective": 0,
            "ServiceType": "default",
            "Subject": "Test_V2",
            "TimeZone": "120"
        }
    },
    "messageType": "ChatStateChangeMessage",
    "notificationType": "AttachmentAdded",
    "referenceId": 43
}

Add New Document

Overview

This request adds a new document to the specified chat. UCS creates a document record and associates it with the specified chat.

Request URL /api/v2/me/chats/{id}
HTTP Method POST
Required Features api-multimedia

Parameters

Parameter Value
attachment The uploaded document in the request.

Sample

POST api/v2/me/chats/0001PaBMYY3600R8 
 
{
 "operationName": "AddAttachment", 
 "documentId": "0000YaB6ARKB0019"
}

Response

{
  "statusCode": 0,
  "referenceId": 3,
}

Notification

{ 
    "chat": {
        "attachments": [
	     {
                "id": "0000TaBTNRPW01GY",
                "mime": "text/plain",
                "name": "testfileUploadAgent.txt",
                "path": "/attachments/0001PaBMYY3600RC",
                "size": 46,
                "uri": "http://.../api/v2/chats/0001PaBMYY3600R8/attachments/0000TaBTNRPW01GY"
            },
        ],
        "capabilities": [
            "Transfer",
            "Leave",
            "Invite",
            "Consult",
            "SetInFocus",
            "SetDisposition",
            "AttachUserData",
            "DeleteUserData",
            "UpdateUserData",
            "Complete",
            "SendMessage",
            "SendUrl",
            "SendStartTypingNotification",
            "SendStopTypingNotification",
            "SendCustomNotice"
        ],
        "chatType": "Inbound",
        "id": "0001PaBMYY3600R8",
        "interactionQueue": "CloudPoDSimpleChatInQ",
        "participants": [
            {
                 "id": "009F5790F75F009A",
                 "nickname": "FirstStep",
                 "participantId": "009F5790F75F009A",
                 "type": "Customer",
                 "visibility": "All"
            },
            {
                 "id": "009F5790F3F9008A",
                 "nickname": "PoD service",
                 "participantId": "009F5790F3F9008A",
                 "type": "External",
                 "visibility": "All"
            },
            {
                 "id": "009F5790F765009C",
                 "nickname": "TestName",
                 "participantId": "009F5790F765009C",
                 "path": "/users/0bcb93c9854f41d6ad89344047ec3223",
                 "type": "Agent",
                 "uri": "http://.../api/v2/users/0bcb93c9854f41d6ad89344047ec3223",
                 "visibility": "All"
            }
        ],
        "receivedDate": "2016-07-21 19:35:03.000+0300",
        "state": "Chatting",
        "suggestedQueueUris": [
            "http://.../api/v2/queues/62464e99-53c8-4fda-9cfd-c63dee679c6d"
        ],
        "threadId": "0001PaBMYY3600T9",
        "uri": "http://.../api/v2/chats/0001PaBMYY3600R8",
        "userData": {
            "CBR-IT-path_DBIDs": "",
            "CBR-Interaction_cost": "",
            "CBR-actual_volume": "",
            "CBR-contract_DBIDs": "",
            "ChatServerAppName": "esv_chat_srv_851",
            "ChatServerDBID": "159",
            "ChatServerHost": "dev-ip9-152.gws.genesys.com",
            "ChatServerPort": "7160",
            "CustomerSegment": "default",
            "IW_BundleUid": "0ceb38e6-c3dc-412d-1d55-9f9c13a2af9e",
            "IW_CaseUid": "6d1f299c-4b0e-4766-2631-86641b43ed1b",
            "IdentifyCreateContact": "3",
            "OccuredAt": "2016-07-21T16:25:06Z",
            "PegAG?:2>1": 1,
            "RRequestedSkillCombination": "",
            "RRequestedSkills": null,
            "RStrategyDBID": "472",
            "RStrategyName": "CloudPoDSimpleChatInStrategy",
            "RTargetAgentGroup": "?:2>1",
            "RTargetAgentSelected": "a1",
            "RTargetObjSelDBID": "",
            "RTargetObjectSelected": "?:2>1",
            "RTargetPlaceSelected": "a1",
            "RTargetRequested": "?:2>1",
            "RTargetRuleSelected": "",
            "RTargetTypeSelected": "2",
            "RTenant": "Environment",
            "RVQDBID": "",
            "RVQID": "",
            "ServiceObjective": 0,
            "ServiceType": "default",
            "Subject": "Test_V2",
            "TimeZone": "120"
        }
    },
    "messageType": "ChatStateChangeMessage",
    "notificationType": "AttachmentAdded",
    "referenceId": 3
}

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on September 2, 2016, at 11:10.