Skip to main content

Send a new message in the conversation

POST/v2/conversations/{conversationId}/messages
API version
v2
Request method
POST
Operation ID
conversation-create-message

Request​

  • conversationIdstring (uuid)required

Responses​

Format
application/json
Description
  • conversationIdstring (uuid)required
  • messageIdstring (uuid)required
Content-Type: application/json

{
"conversationId": "f0f86186-0a5a-45b2-aa33-502777496347",
"messageId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
{
"properties": {
"conversationId": {
"format": "uuid",
"type": "string"
},
"messageId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"conversationId",
"messageId"
],
"type": "object"
}

Usage examples​

$ curl \
--fail \
--location \
-X POST \
-d '{"fileIds":["f0f86186-0a5a-45b2-aa33-502777496347"],"messageContent":"string"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
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.createMessage({
"conversationId": "f0f86186-0a5a-45b2-aa33-502777496347",
"data": {
"fileIds": [
"f0f86186-0a5a-45b2-aa33-502777496347"
],
"messageContent": "string"
}
});

assertStatus(response, 201);

use \Mittwald\ApiClient\Generated\V2\Clients\Conversation\CreateMessage\CreateMessageRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\Conversation\CreateMessage\CreateMessageRequestBody;

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

// TODO: Please consult the properties and constructor signature of
// CreateMessageRequestBody to learn how to construct a valid instance
$body = new CreateMessageRequestBody(/* TODO: ... */);

$request = (new CreateMessageRequest(
conversationId: "f0f86186-0a5a-45b2-aa33-502777496347",
body: $body
));
$response = $client->conversation()->createMessage($request);

var_dump($response->getBody();

On this page