-
Notifications
You must be signed in to change notification settings - Fork 1
/
caap-message.json
175 lines (173 loc) · 4.71 KB
/
caap-message.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Microsoft CaaP (Conversation as a Platform) Message Schema",
"description": "Message envelope schema for Bot Framework and Skype.",
"type": "object",
"required": [ "type", "timestamp", "from", "conversation", "recipient" ],
"additionalProperties": false,
"properties": {
"type": {
"$ref": "#/definitions/messageType",
"description": "Defines what kind of message is being sent."
},
"id": {
"type": "string",
"description": "The unique identifier of a user message the bot message is a reply to (needed in certain scenarios)."
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Timestamp of the message in ISO8601 format, e.g. '2016-06-15T03:48:50.3817037Z'."
},
"serviceUrl": {
"$ref": "#/definitions/uri",
"description": "The channel-specific endpoint to which replies to the message should be sent."
},
"channelId": {
"$ref": "#/definitions/channelIds",
"description": "The unique identifier for the channel from which a message was sent."
},
"from": {
"$ref": "#/definitions/conversationParticipant",
"description": "The person or bot sending the message."
},
"conversation": {
"$ref": "#/definitions/conversationInfo",
"description": "Metadata about the conversation the message is a part of."
},
"recipient": {
"$ref": "#/definitions/conversationParticipant",
"description": "The person or bot receiving the message."
},
"text": {
"type": "string",
"description": "The text of the message."
},
"textFormat": {
"$ref": "#/definitions/textFormats",
"description": "Describes the format of the text property (plain, markdown, xml, etc.)."
},
"summary": {
"type": "string",
"description": "Describes the contents of complex messages."
},
"replyToId": {
"type": "string",
"description": "The ID of the message this message is in reply to. Optional if the message is not a reply."
},
"entities": {
"type": "array",
"items": {
"type": "object"
},
"description": "Array of schema.org entities"
},
"attachments": {
"type": "array",
"items": {
"$ref": "#/definitions/attachment"
},
"description": "Array of attachments to the message."
},
"attachmentLayout": {
"$ref": "#/definitions/attachmentLayouts",
"description": "Layout hints for attachments (e.g. list, carousel, etc.)"
},
"channelData": {
"type": [ "boolean", "integer", "number", "string", "array", "object", "null" ],
"description": "Channel-specific metadata."
}
},
"definitions": {
"messageType": {
"enum": [
"message",
"conversationUpdate",
"contactUpdate",
"typing"
],
"description": "The set of valid types for a message."
},
"channelIds": {
"enum": [
"emulator",
"email",
"facebookMessenger",
"groupMe",
"kik",
"skype",
"skypeTeams",
"slack",
"telegram",
"text/sms",
"web"
],
"description": "The set of valid channel identifiers."
},
"conversationParticipant": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier of the person or bot sending or receiving the message."
},
"name": {
"type": "string",
"description": "User-visible name for the person or bot sending or receiving the message."
}
},
"required": [ "id", "name" ]
},
"conversationInfo": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the conversation."
},
"isGroup": {
"type": "boolean",
"description": "Indicates whether the conversation is 1:1 or 1:M."
}
},
"required": [ "id" ]
},
"textFormats": {
"enum": [
"plain",
"markdown",
"xml"
],
"description": "The set of types for the text property of the message."
},
"attachmentLayouts": {
"enum": [
"list",
"carousel"
],
"description": "The set of layout hints for cards in the attachment collection."
},
"attachment": {
"type": "object",
"properties": {
"contentType": {
"type": "string",
"description": "MIME type of the attachment."
},
"content": {
"type": "object",
"description": "Object schema of contentType."
},
"contentUrl": {
"$ref": "#/definitions/uri",
"description": "Reference to location of attachment content."
}
},
"required": [ "contentType" ]
},
"uri": {
"type": "string",
"format": "uri"
}
}
}