الانتقال إلى المحتوى
القائمة
DocsSDKالدعم (Helpdesk)

الدعم (Helpdesk)

تم التحديث أكتوبر 2026·1 min

اقرأ محادثات الدعم عبر القنوات وأرسل الردود، مسار الكتابة idempotent فلا تتكرر الرسائل عند إعادة المحاولة.

صندوق مشغلي Helpdesk مع قائمة المحادثات.صندوق مشغلي Helpdesk مع قائمة المحادثات.

مثال سريع

مُدقّق الأنواع مقابل ‎@medalsocial/sdk v1.3.0 (2026-07-20). أي إصدار يغيّر توقيعًا يوقف بناء هذه الصفحة.

ts
import { Medal } from '@medalsocial/sdk';

const medal = new Medal(process.env.MEDAL_API_KEY as string);

// Open conversations, newest first
const { data: conversations } = await medal.helpdesk.conversations.list({ limit: 10 });
const first = conversations[0];

// Read the thread
const { data: messages } = await medal.helpdesk.conversations.messages(first.id);
console.log(messages.length, 'messages');

// Reply (idempotency key required for capability-scoped tokens)
await medal.helpdesk.replies.create(
  { conversation_id: first.id, body: 'On it — checking your channel connection now.' },
  { idempotencyKey: `reply-${first.id}-1` }
);

medal.helpdesk.conversations.list()

List/search conversations with cursor-based pagination and optional filters.

ts
list(options?: ListConversationsOptions): Promise<PaginatedResponse<Conversation>>
أُضيف في v1.3.0

medal.helpdesk.conversations.get()

Get a conversation by ID.

ts
get(id: string): Promise<ApiResponse<Conversation>>
أُضيف في v1.3.0

medal.helpdesk.conversations.update()

Update a conversation's status and/or assignee (pass `assignee_user_id: null` to unassign).

ts
update(id: string, input: UpdateConversationInput, options?: RequestOptions): Promise<ApiResponse<ConversationUpdateResult>>
أُضيف في v1.3.0

medal.helpdesk.conversations.messages()

Read a conversation's messages with cursor-based pagination.

ts
messages(id: string, options?: PaginationOptions): Promise<PaginatedResponse<ConversationMessage>>
أُضيف في v1.3.0

medal.helpdesk.replies.create()

Send an operator reply or internal note. Returns HTTP 201.

Pass an `idempotencyKey` so retried requests do not create duplicate
messages. It is REQUIRED for capability-scoped tokens.

ts
create(input: CreateReplyInput, options?: RequestOptions): Promise<ApiResponse<ReplyCreateResult>>
أُضيف في v1.3.0