@jokoor/sdk
Version:
Jokoor SMS API SDK for JavaScript/TypeScript
71 lines • 2.25 kB
TypeScript
/**
* SMS resource - User-friendly wrapper for SMS API
*/
import { BaseResource, PaginatedResponse } from './base';
import type { SMSResponse, SMSMessage, SMSSendParams } from '../types/responses';
import { Result } from '../types/result';
export declare class SMS extends BaseResource {
private api;
constructor(configuration: any);
/**
* Send an SMS message
*
* Recipient specification:
* - Can use `to` (phone number) alone
* - Can use `contactId` alone (service fetches phone from contact)
* - If both provided, `contactId` takes precedence
*
* Message content:
* - Can use `message` alone
* - Can use `templateId` alone (service fetches template content)
* - If both provided, `message` takes precedence
*
* @param params SMS parameters
* @returns SMS response with message ID
*/
send(params: SMSSendParams): Promise<Result<SMSResponse>>;
/**
* Get SMS message details
* @param id SMS message ID
* @returns SMS message details
*/
get(id: string): Promise<Result<SMSMessage>>;
/**
* List SMS messages with filtering and pagination
* @param options List options
* @returns Paginated list of SMS messages
*/
list(options?: {
limit?: number;
offset?: number;
status?: string;
startDate?: string;
endDate?: string;
search?: string;
sort?: string;
}): Promise<Result<PaginatedResponse<SMSMessage>>>;
/**
* Resend a failed SMS message
* @param id SMS message ID
* @returns Resend response
*/
resend(id: string): Promise<Result<SMSResponse>>;
/**
* Resend multiple failed SMS messages
* @param messageIds Array of message IDs to resend
* @returns Batch resend results
*/
resendBatch(messageIds: string[]): Promise<Result<{
successful: string[];
failed: string[];
total: number;
}>>;
/**
* Send a draft SMS message
* @param id Draft SMS ID
* @param scheduledAt Optional scheduled time
* @returns Send response
*/
sendDraft(id: string, scheduledAt?: string): Promise<Result<SMSResponse>>;
}
//# sourceMappingURL=sms.d.ts.map