Zum Hauptinhalt springen
POST
/
conversations
/
v3
/
conversations
/
threads
/
{threadId}
/
messages
Send a message to a thread
curl --request POST \
  --url https://api.hubapi.com/conversations/v3/conversations/threads/{threadId}/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "type": "MESSAGE",
  "text": "<string>",
  "richText": "<string>",
  "attachments": [
    {
      "type": "FILE",
      "fileId": "<string>"
    }
  ],
  "recipients": [
    {
      "deliveryIdentifiers": [
        {
          "type": "<string>",
          "value": "<string>"
        }
      ],
      "actorId": "<string>",
      "name": "<string>",
      "deliveryIdentifier": {
        "type": "<string>",
        "value": "<string>"
      },
      "recipientField": "<string>"
    }
  ],
  "senderActorId": "<string>",
  "channelId": "<string>",
  "channelAccountId": "<string>",
  "subject": "<string>"
}'
{
  "type": "MESSAGE",
  "id": "<string>",
  "conversationsThreadId": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "createdBy": "<string>",
  "client": {
    "clientType": "HUBSPOT",
    "integrationAppId": 123
  },
  "senders": [
    {
      "actorId": "<string>",
      "name": "<string>",
      "senderField": "<string>",
      "deliveryIdentifier": {
        "type": "<string>",
        "value": "<string>"
      }
    }
  ],
  "recipients": [
    {
      "actorId": "<string>",
      "name": "<string>",
      "deliveryIdentifier": {
        "type": "<string>",
        "value": "<string>"
      },
      "recipientField": "<string>"
    }
  ],
  "archived": true,
  "text": "<string>",
  "richText": "<string>",
  "attachments": [
    {
      "fileUsageType": "<string>",
      "name": "<string>",
      "type": "FILE",
      "url": "<string>",
      "fileId": "<string>"
    }
  ],
  "subject": "<string>",
  "truncationStatus": "NOT_TRUNCATED",
  "inReplyToId": "<string>",
  "status": {
    "statusType": "SENT",
    "failureDetails": {
      "errorMessageTokens": {},
      "errorMessage": "<string>"
    }
  },
  "direction": "INCOMING",
  "channelId": "<string>",
  "channelAccountId": "<string>"
}

Produits pris en charge

Exige l'un des produits suivants ou un produit supérieur.
Marketing HubMarketing Hub -Gratuit
Sales HubSales Hub -Gratuit
Service HubService Hub -Gratuit
Content HubContent Hub -Gratuit
Cette API requiert l'une des portées suivantes :
conversations.write

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

threadId
integer
required

The unique ID of the thread.

Body

application/json
  • Option 1
  • Option 2
type
enum<string>
default:MESSAGE
required
Verfügbare Optionen:
MESSAGE
text
string
required
attachments
(FILE · object | QUICK_REPLIES · object | SOCIAL_MEDIA_METADATA · object)[]
required
  • FILE
  • QUICK_REPLIES
  • SOCIAL_MEDIA_METADATA
recipients
object[]
required
senderActorId
string
required
channelId
string
required
channelAccountId
string
required
richText
string
subject
string

Response

successful operation

  • Option 1
  • Option 2
  • Option 3
  • Option 4
  • Option 5
  • Option 6
type
enum<string>
default:MESSAGE
required
Verfügbare Optionen:
MESSAGE
id
string
required
conversationsThreadId
string
required
createdAt
string<date-time>
required
createdBy
string
required
client
object
required
senders
object[]
required
recipients
object[]
required
archived
boolean
required
text
string
required
attachments
(FILE · object | LOCATION · object | CONTACT · object | UNSUPPORTED_CONTENT · object | MESSAGE_HEADER · object | QUICK_REPLIES · object | WHATSAPP_TEMPLATE_METADATA · object | SOCIAL_MEDIA_METADATA · object)[]
required
  • FILE
  • LOCATION
  • CONTACT
  • UNSUPPORTED_CONTENT
  • MESSAGE_HEADER
  • QUICK_REPLIES
  • WHATSAPP_TEMPLATE_METADATA
  • SOCIAL_MEDIA_METADATA
truncationStatus
enum<string>
required
Verfügbare Optionen:
NOT_TRUNCATED,
TRUNCATED_TO_MOST_RECENT_REPLY,
TRUNCATED
direction
enum<string>
required
Verfügbare Optionen:
INCOMING,
OUTGOING
channelId
string
required
channelAccountId
string
required
updatedAt
string<date-time>
richText
string
subject
string
inReplyToId
string
status
object