دریافت لیست مکالمات کاربر
| پارامتر | نوع | توضیحات |
|---|---|---|
| UserID | string (UUID) | الزامی شناسه کاربر |
{
"success": true,
"conversations": [
{
"ConversationID": "uuid",
"OtherUserID": "uuid",
"LastMessage": {
"Message": "آخرین پیام",
"IsEdited": false,
"CreatedAt": "2024-01-01T12:00:00"
},
"UnreadCount": 2,
"LastMessageAt": "2024-01-01T12:00:00"
}
]
}دریافت پیامهای یک مکالمه
| پارامتر | نوع | توضیحات |
|---|---|---|
| UserID | string (UUID) | الزامی شناسه کاربر |
| limit | integer | اختیاری تعداد پیامها (پیشفرض: 50) |
| offset | integer | اختیاری offset برای pagination (پیشفرض: 0) |
{
"success": true,
"messages": [
{
"MessageID": "uuid",
"SenderID": "uuid",
"ReceiverID": "uuid",
"Message": "متن پیام",
"MessageType": "text",
"Status": "read",
"IsEdited": true,
"EditedAt": "2024-01-01T12:00:00",
"CreatedAt": "2024-01-01T11:00:00"
}
]
}ارسال پیام جدید
| فیلد | نوع | توضیحات |
|---|---|---|
| SenderID | string (UUID) | الزامی شناسه فرستنده |
| ReceiverID | string (UUID) | الزامی شناسه گیرنده |
| Message | string | الزامی متن پیام |
| MessageType | string | اختیاری نوع پیام (پیشفرض: text) |
{
"SenderID": "uuid",
"ReceiverID": "uuid",
"Message": "سلام!",
"MessageType": "text"
}{
"success": true,
"message": {
"MessageID": "uuid",
"ConversationID": "uuid",
"SenderID": "uuid",
"ReceiverID": "uuid",
"Message": "سلام!",
"IsEdited": false,
"EditedAt": null,
"CreatedAt": "2024-01-01T12:00:00"
}
}ویرایش پیام
| فیلد | نوع | توضیحات |
|---|---|---|
| UserID | string (UUID) | الزامی شناسه کاربر (باید فرستنده پیام باشد) |
| Message | string | الزامی متن جدید پیام |
{
"success": true,
"message": {
"MessageID": "uuid",
"Message": "پیام ویرایش شده",
"IsEdited": true,
"EditedAt": "2024-01-01T12:05:00",
"UpdatedAt": "2024-01-01T12:05:00"
}
}حذف پیام
| فیلد | نوع | توضیحات |
|---|---|---|
| UserID | string (UUID) | الزامی شناسه کاربر (باید فرستنده پیام باشد) |
{
"success": true,
"message": "Message deleted"
}حذف مکالمه
| پارامتر | نوع | توضیحات |
|---|---|---|
| UserID | string (UUID) | الزامی شناسه کاربر |
{
"success": true,
"message": "Conversation deleted"
}