Uploads offline messages
| Method | upload.offline_messages |
|---|---|
| Description | Uploads offline messages |
| Available to | Agent, Client |
| Required components | Data API and Upload Offline Messages from an External System |
| Maximum offline messages per request | 50 |
Required parameter combinations
-
Provide at least one of visitor_session_id, campaign_id, or site_id. If you provide more than one, the values must refer to the same context.
-
Provide at least one of phone or email.
Request parameters
| Name | Type | Required | Valid values | Description |
|---|---|---|---|---|
access_token |
string | yes | Access token used to authenticate the request. | |
user_id |
number | no | Unique ID of the client user on whose behalf the agent is making the request. Required for agents. To retrieve a list of client users, use the "get.customer_users" method. | |
offline_messages |
array | yes | Offline messages to upload. Maximum: 50. | |
date_time |
iso8601 | yes | YYYY-MM-DD hh:mm:ss | Date and time when the offline message was created. Must not be in the future and must be later than the associated visitor session. If omitted, the upload time is used. |
phone |
string | yes, unless email is provided | Visitor phone number in E.164 format. | |
email |
string | yes, unless phone is provided | Visitor email address. | |
message |
string | no | Message submitted by the visitor. | |
visitor_session_id |
number | yes, unless campaign_id or site_id is provided | CallGear visitor session ID, obtained using Comagic.getSessionId(). The session must have been created no more than 180 days before date_time. | |
campaign_id |
number | yes, unless visitor_session_id or site_id is provided | CallGear advertising campaign ID. Use "get.campaigns" to retrieve campaign IDs. If campaign_id is -1, site_id is required. | |
source_id |
number | no | CallGear traffic source ID. Only active sources belonging to the client account can be specified. When visitor_session_id is provided, source_id is derived from the session. | |
site_id |
number | yes, unless campaign_id or visitor_session_id is provided | CallGear site ID. | |
form_name |
string | no | Name of the custom JavaScript form. | |
user_fields |
array | no | Custom fields to attach to the offline message. Create the fields first using "create.offline_message_user_field". |
Example request
{
"jsonrpc": "2.0",
"id": "number",
"method": "upload.offline_messages",
"params": {
"access_token": "string",
"user_id": "number",
"offline_messages": [
{
"date_time": "iso8601",
"name": "string",
"phone": "string",
"email": "string",
"message": "string",
"visitor_session_id": "number",
"campaign_id": "number",
"source_id": "number",
"site_id": "number",
"form_name": "string",
"ext_id": "string",
"user_fields": [
{
"ext_id": "string",
"value": "string"
},
{
"ext_id": "string",
"value": "string"
}
]
}
]
}
}
Example response
{
"jsonrpc": "2.0",
"id": "number",
"result": {
"data": [
{
"id": "number"
}
],
"metadata": "object"
}
}
Possible errors
See the "Errors for upload methods" section.