Zum Hauptinhalt springen

Get all message of the conversation

GET/v2/conversations/{conversationId}/messages
API-Version
v2
Request-Methode
GET
Operation-ID
conversation-list-messages-by-conversation

Request​

  • conversationIdstring (uuid)required

Responses​

Format
application/json
Beschreibung
  • Array[
    • *eine von 3 Alternativen
      • Alternativeobject
        • conversationIdstring (uuid)required
        • createdAtstring (date-time)required
        • createdByobject
          • activeboolean
          • avatarRefIdstring
          • clearNamestring
          • isEmployeeboolean
          • userIdstringrequired
        • filesArray von eine von 3 Alternativen
          • Array[
            • *eine von 3 Alternativen
              • Alternativeobject
                • idstring (uuid)required
                • status"requested"required
              • Alternativeobject
                • idstring (uuid)required
                • namestringrequired
                • status"uploaded"required
                • typestringrequired
              • Alternativeobject
                • deletionDatestring (date-time)required
                • idstring (uuid)required
                • namestringrequired
                • status"deleted"required
                • typestringrequired
            ]
        • internalboolean
        • messageContentstring
        • messageIdstring (uuid)required
        • type"MESSAGE"required
      • Alternativeeine von 2 Alternativen
        • Alternativeobject
          • conversationIdstringrequired
          • createdAtstring (date-time)required
          • internalboolean
          • messageContentstring (einer von: RESUBMISSION_CREATED, RESUBMISSION_RESUBMIT_AT_CHANGED)required
          • metaobject
            • groupAcronymstringrequired
            • groupIdstringrequired
            • groupNamestringrequired
            • resubmitAtstring (date-time)required
            • userobject
              • activeboolean
              • avatarRefIdstring
              • clearNamestring
              • isEmployeeboolean
              • userIdstringrequired
          • type"STATUS_UPDATE"required
        • Alternativeobject
          • conversationIdstringrequired
          • createdAtstring (date-time)required
          • internalboolean
          • messageContentstringrequired
          • metaobject
            • userobject
              • activeboolean
              • avatarRefIdstring
              • clearNamestring
              • isEmployeeboolean
              • userIdstringrequired
          • type"STATUS_UPDATE"required
      • Alternative
        • *
    ]
Content-Type: application/json

[
{
"conversationId": "f0f86186-0a5a-45b2-aa33-502777496347",
"createdAt": "1985-10-26T01:21:00.000Z",
"createdBy": {
"active": true,
"avatarRefId": "string",
"clearName": "string",
"isEmployee": true,
"userId": "string"
},
"files": [
{
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"status": "requested"
}
],
"internal": true,
"messageContent": "string",
"messageId": "f0f86186-0a5a-45b2-aa33-502777496347",
"type": "MESSAGE"
}
]
{
"items": {
"oneOf": [
{
"properties": {
"conversationId": {
"format": "uuid",
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"createdBy": {
"properties": {
"active": {
"type": "boolean"
},
"avatarRefId": {
"type": "string"
},
"clearName": {
"type": "string"
},
"isEmployee": {
"type": "boolean"
},
"userId": {
"type": "string"
}
},
"required": [
"userId"
],
"type": "object"
},
"files": {
"items": {
"oneOf": [
{
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"status": {
"enum": [
"requested"
],
"type": "string"
}
},
"required": [
"id",
"status"
],
"type": "object"
},
{
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"enum": [
"uploaded"
],
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"id",
"status",
"name",
"type"
],
"type": "object"
},
{
"properties": {
"deletionDate": {
"format": "date-time",
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"enum": [
"deleted"
],
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"id",
"status",
"name",
"type",
"deletionDate"
],
"type": "object"
}
]
},
"type": "array"
},
"internal": {
"type": "boolean"
},
"messageContent": {
"type": "string"
},
"messageId": {
"format": "uuid",
"type": "string"
},
"type": {
"enum": [
"MESSAGE"
],
"type": "string"
}
},
"required": [
"messageId",
"conversationId",
"createdAt",
"type"
],
"type": "object"
},
{
"oneOf": [
{
"properties": {
"conversationId": {
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"internal": {
"type": "boolean"
},
"messageContent": {
"enum": [
"RESUBMISSION_CREATED",
"RESUBMISSION_RESUBMIT_AT_CHANGED"
],
"type": "string"
},
"meta": {
"properties": {
"groupAcronym": {
"type": "string"
},
"groupId": {
"type": "string"
},
"groupName": {
"type": "string"
},
"resubmitAt": {
"format": "date-time",
"type": "string"
},
"user": {
"properties": {
"active": {
"type": "boolean"
},
"avatarRefId": {
"type": "string"
},
"clearName": {
"type": "string"
},
"isEmployee": {
"type": "boolean"
},
"userId": {
"type": "string"
}
},
"required": [
"userId"
],
"type": "object"
}
},
"required": [
"resubmitAt",
"groupId",
"groupAcronym",
"groupName"
],
"type": "object"
},
"type": {
"enum": [
"STATUS_UPDATE"
],
"type": "string"
}
},
"required": [
"conversationId",
"messageContent",
"createdAt",
"type"
],
"type": "object"
},
{
"properties": {
"conversationId": {
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"internal": {
"type": "boolean"
},
"messageContent": {
"not": {
"enum": [
"RESUBMISSION_CREATED",
"RESUBMISSION_RESUBMIT_AT_CHANGED"
]
},
"type": "string"
},
"meta": {
"properties": {
"user": {
"properties": {
"active": {
"type": "boolean"
},
"avatarRefId": {
"type": "string"
},
"clearName": {
"type": "string"
},
"isEmployee": {
"type": "boolean"
},
"userId": {
"type": "string"
}
},
"required": [
"userId"
],
"type": "object"
}
},
"type": "object"
},
"type": {
"enum": [
"STATUS_UPDATE"
],
"type": "string"
}
},
"required": [
"conversationId",
"messageContent",
"createdAt",
"type"
],
"type": "object"
}
]
},
{
"allOf": [
{
"properties": {
"conversationId": {
"format": "uuid",
"type": "string"
},
"createdAt": {
"format": "date-time",
"type": "string"
},
"files": {
"items": {
"oneOf": [
{
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"status": {
"enum": [
"requested"
],
"type": "string"
}
},
"required": [
"id",
"status"
],
"type": "object"
},
{
"properties": {
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"enum": [
"uploaded"
],
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"id",
"status",
"name",
"type"
],
"type": "object"
},
{
"properties": {
"deletionDate": {
"format": "date-time",
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"enum": [
"deleted"
],
"type": "string"
},
"type": {
"type": "string"
}
},
"required": [
"id",
"status",
"name",
"type",
"deletionDate"
],
"type": "object"
}
]
},
"maxItems": 0,
"type": "array"
},
"messageId": {
"format": "uuid",
"type": "string"
},
"type": {
"enum": [
"SERVICE_REQUEST"
],
"type": "string"
}
},
"required": [
"conversationId",
"messageId",
"createdAt",
"type"
],
"type": "object"
},
{
"properties": {
"messageContent": {
"enum": [
"relocation",
"call",
"mailSendLimitIncrease"
],
"type": "string"
},
"meta": {
"oneOf": [
{
"properties": {
"contact": {
"properties": {
"email": {
"type": "string"
},
"firstname": {
"type": "string"
},
"lastname": {
"type": "string"
},
"phone": {
"type": "string"
}
},
"required": [
"firstname",
"lastname",
"email"
],
"type": "object"
},
"domain": {
"properties": {
"allDomains": {
"type": "boolean"
},
"domains": {
"items": {
"properties": {
"authCode": {
"type": "string"
},
"domainName": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"email": {
"properties": {
"emailInboxes": {
"items": {
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
},
"required": [
"email",
"password"
],
"type": "object"
},
"type": "array"
}
},
"type": "object"
},
"notes": {
"type": "string"
},
"preferredRelocationDate": {
"format": "date-time",
"type": "string"
},
"redirectusKey": {
"type": "integer"
},
"source": {
"properties": {
"providerName": {
"type": "string"
},
"providerPassword": {
"type": "string"
},
"providerUrl": {
"type": "string"
},
"providerUsername": {
"type": "string"
},
"sourceAccount": {
"type": "string"
}
},
"required": [
"sourceAccount",
"providerName",
"providerUrl",
"providerUsername",
"providerPassword"
],
"type": "object"
},
"target": {
"properties": {
"accountShortId": {
"type": "string"
},
"application": {
"type": "string"
},
"articleType": {
"type": "string"
},
"organisation": {
"type": "string"
},
"prices": {
"items": {
"properties": {
"name": {
"type": "string"
},
"price": {
"type": "number"
}
},
"type": "object"
},
"type": "array"
},
"product": {
"type": "string"
},
"withDataCompare": {
"type": "boolean"
}
},
"required": [
"organisation",
"accountShortId",
"product",
"articleType"
],
"type": "object"
},
"userId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"redirectusKey",
"source",
"target",
"contact",
"userId"
],
"type": "object"
},
{
"properties": {
"mailAddressId": {
"format": "uuid",
"type": "string"
},
"rateLimitId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"mailAddressId",
"rateLimitId"
],
"type": "object"
}
]
}
},
"required": [
"messageContent",
"meta"
],
"type": "object"
}
]
}
]
},
"type": "array"
}

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/conversations/f0f86186-0a5a-45b2-aa33-502777496347/messages
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.conversation.listMessagesByConversation({
"conversationId": "f0f86186-0a5a-45b2-aa33-502777496347"
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\Conversation\ListMessagesByConversation\ListMessagesByConversationRequest;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

$request = (new ListMessagesByConversationRequest(
conversationId: "f0f86186-0a5a-45b2-aa33-502777496347"
));
$response = $client->conversation()->listMessagesByConversation($request);

var_dump($response->getBody();

Auf dieser Seite