Skip to main content
Version: Next

Comms SDK Reference

SDK Reference

The CommsSDK functions are the same across all supported SDKs. Only naming style differs by language (e.g., sendSMS in Java/C# vs send_sms in Python/Ruby).

Authentication and Environment

FunctionParametersReturnsNotes
authenticateusername, apiKeySDK instanceCreates and validates an SDK instance.
useSandBox / use_sandboxnonevoidSwitches to the sandbox API URL.
useLiveServer / use_live_servernonevoidSwitches to the live API URL.
withSenderId / with_sender_idsenderIdSDK instanceSets a default sender ID for outgoing messages.
isAuthenticated / is_authenticatednonebooleanReturns whether the SDK instance is currently authenticated.

Send SMS

FunctionParametersReturnsNotes
sendSMS / send_smsnumber or numbers, message, optional senderId, optional prioritybooleanSends SMS and returns success or failure.
querySendSMS / query_send_smsnumber or numbers, message, optional senderId, optional priorityApiResponseSends SMS and returns the full API response.

Balance

FunctionParametersReturnsNotes
getBalance / get_balanceoptional walletTypenumberReturns the account balance. Defaults to the local wallet.
queryBalance / query_balanceoptional walletTypeApiResponseReturns the full API response with balance details. Defaults to the local wallet.

Model Reference

This section summarizes the SDK response models that map to the API responses.

ApiResponseCode (Enum)

Represents the status of an API call.

  • OK – The request was successful.
  • Failed – The request failed.

ApiResponse

Responses from sdk.querySendSMS() and sdk.queryBalance() use this structure:

FieldTypeDescription
statusApiResponseCodeStatus of the request.
messageStringReason for the failure. Only populated when status is Failed.
costDoubleCost of sending the message (available only on SendSms). Not always a whole number.
messageFollowUpCodeStringUnique code for tracking each successful request.
balanceDoubleUser account balance (available only when fetching balance).

MessagePriority (Enum)

Sets SMS sending priority. Lower value = higher priority.

NameValueDescription
HIGHEST0Urgent
HIGH1High, default
MEDIUM2Normal
LOW3Low
LOWEST4Defer/send later

WalletType (Enum)

Selects which wallet to query a balance from.

NameValueDescription
LOCAL"Local"Local wallet (default if omitted).
INTERNATIONAL"International"International wallet.

ApiRequest

Represents an API request payload.

FieldTypeDescription
methodStringOne of: "SendSms" or "Balance".
userdataUserDataThe user’s credentials (username & API key).
messageDataList<MessageModel>Messages & recipients for the request.
walletTypeWalletTypeWhich wallet to query (Balance requests only). Defaults to LOCAL if omitted.

MessageModel

Describes a single message to be sent.

FieldTypeDescription
numberStringRecipient’s phone number.
messageStringMessage content.
senderIdStringSender ID shown to the recipient.
priorityMessagePriorityPriority of this message.

UserData

Credentials used to authenticate API requests.

FieldTypeDescription
usernameStringYour API username, found in Comms API settings.
apikeyStringYour API key (also called "password"), found in Comms API settings.

Next steps