Body
Required
-
Specifies the message type. Supported values include
text,gif, anddocument. -
The message content. Required only when the message type is set to
text. -
URL of the GIF. Required only when the message type is set to
gif. -
Document attachment identifier. Required only when the message type is set to
document. -
Unique identifier for the document thread. Required only when
doc_idis provided. -
Unique identifier of the chat to which the message belongs. Required when no other reference (
message_id,task_id,file_id, ordoc_id) is provided. -
Unique identifier of the parent message (used for replies). Required when no
chat_id,task_id,file_id, ordoc_idis provided. -
Unique identifier of the task associated with this message. Required when no other entity (
chat_id,message_id,file_id, ordoc_id) is specified. -
Unique identifier of the file associated with this message. Required when no other entity (
chat_id,message_id,task_id, ordoc_id) is specified. -
Unique identifier of the document associated with this message. Required when no other entity (
chat_id,message_id,task_id, orfile_id) is specified. -
Details of the related task, if applicable. Optional field for embedding task data.
-
List of external file attachments associated with this message.
-
List of file identifiers from Nifty linked with this message.
-
Timestamp representing the date and time of message creation.
-
Name of the bot that created or sent the message, if applicable.
-
Avatar URL of the bot that created or sent the message, if applicable.
-
Comma-separated list of email addresses mentioned in the message, if any.
-
Identifier of the annotation linked with this message.
-
Contextual text related to the message (for example, quoted or referenced text).
-
Duration of the attached audio message, represented as a string (e.g., "00:30").
-
Specifies the type of the user who created the message (e.g., "user", "bot").
-
Unique identifier of the user who created the message.
Responses
-
The resource created successfully
-
The client request has not been completed because it lacks valid authentication credentials for the requested resource.
-
The client does not have access rights to the content.
-
The request method is known by the server but is not supported by the target resource.
curl \
--request POST 'https://openapi.niftypm.com/api/v1.0/messages' \
--header "Content-Type: application/json" \
--data '{"type":"string","text":"string","url":"string","doc_attachment":"string","entity_key":"string","chat_id":"string","message_id":"string","task_id":"string","file_id":"string","doc_id":"string","task":{},"external_files":["string"],"nifty_files":["string"],"date":"2025-05-04T09:42:00Z","bot_name":"string","bot_avatar":"string","hidden":["string"],"emails":"string","annotation_id":"string","context_text":"string","audio_duration":"string","created_by_type":"string","created_by":"string"}'
{
"type": "string",
"text": "string",
"url": "string",
"doc_attachment": "string",
"entity_key": "string",
"chat_id": "string",
"message_id": "string",
"task_id": "string",
"file_id": "string",
"doc_id": "string",
"task": {},
"external_files": [
"string"
],
"nifty_files": [
"string"
],
"date": "2025-05-04T09:42:00Z",
"bot_name": "string",
"bot_avatar": "string",
"hidden": [
"string"
],
"emails": "string",
"annotation_id": "string",
"context_text": "string",
"audio_duration": "string",
"created_by_type": "string",
"created_by": "string"
}
{
"message": "string",
"data": {}
}