Skip to main content

Sending SMS

Description

To send an SMS, it is necessary to make a POST request to the Submit SMS API endpoint.

Production Endpoint URL: https://api.cpaas.symphony.rakuten.net/sms/v1/submit

Methods: POST

HTTP Headers

ParameterRequiredValue
AuthenticationYType: Bearer
Token: JWT Token
AcceptYapplication/json
Content-TypeYapplication/json; charset=UTF-8

Request Body Schema: application/json

ParameterRequiredDescription/Values
fromYThis can be either a Sender ID or Number depending on requirement and configuration.

Sender addresses must be registered with the operators.

Please refer to Sender Addresses.
toYThe destination phone number should be in the format: Country Code + Mobile Number (MSISDN)
  • DO NOT prefix "+" or "0"
  • Example: Japanese Mobile Number 070-9830-2393 should be formatted "817098302393"
message_typeYThis can be either
  • text
  • unicode
  • binary
Depending on the value supplied here, it is mandatory to include
  • text_message
  • unicode_message
  • binary_message
element in the JSON document.
text_messageConditionalIf message_type = text, then include this element
┗textThis describes a regular 7/8 bit text message sent using the GSM Alphabet. (GSM Alphabet is used for English alphabet) By default, the text field is split over multiple concatenated messages automatically, however, if you wish to handle concatenation manually, you may send individual message parts by specifying the text of the individual segment here along with its corresponding UDH as a hex string.

For concatenated messages, maximum characters allowed: 1520

For line breaks add "/n" which is counted as 1 character

Note: Refer to the Concatenated Message Splitting section for the details on how concatenated messages are split as per message type and character length
┗udhHEX string for UDH
unicode_messageConditionalIf message_type = unicode, then include this element
┗textThis describes a Unicode text message sent using the UCS-2 Alphabet (UCS-2 Alphabet is used for Japanese text). By default, the text field is split over multiple concatenated messages automatically, however, if you wish to handle concatenation manually, you may send individual message parts by specifying the text of the individual segment here along with its corresponding UDH as a hex string.

For concatenated messages, maximum characters allowed: 660

For line breaks add "/n" which is counted as 1 character

Note: Refer to the Concatenated Message Splitting section for the details on how concatenated messages are split as per message type and character length
┗udhHEX string for UDH
binary_messageConditionalIf message_type = binary, then include this element
┗bodyThis describes a binary message. There is no automatic concatenation with a binary message so the body and udh content specified here should fit within a single 140 byte GSM message. Binary messages are used to send data rather than plan text and will not be used for standard SMS use-cases.
┗udhHEX string for UDH
validity_periodOptionalThis allows you to specify the validity period for this message, i.e., how long it will remain in the network attempting to reach the destination handset before giving up. This period can be expressed in hours, minutes, seconds, or with a raw SMPP format validity period string, passing either an absolute or relative time period.

The fields in this element (days, hours, minutes, or seconds) may be combined.

Note: Refer to the Maximum Validity Period section for the details per MNO
┗days
┗hours
┗minutes
┗seconds
┗smpp_validity_period_stringValidity period expressed in SMPP format

Note: To be used by advanced users only - refer appropriate GSM specifications for more details e.g. http://smpp.org/SMPP_v3_4_Issue1_2.pdf
delivery_receiptsOptionalThis element is required if you wish to receive a delivery receipt relating to this SMS message submission. You can specify whether or not you wish to receive a delivery receipt (the default is false if this is not specified), optionally you can also elect to receive intermediate delivery receipts where these are supported by the downstream network. Intermediate delivery receipts are delivery receipts when messages are in the process of reaching the handset, thus the message has still not been received by the handset.

Finally, you have the option here to specify a Webhook URL to receive the delivery receipt. If specified, this overrides the URL that was configured in the user dashboard as part of the account setup. By default, the URL from the user dashboard will be used if nothing is specified here in the API request
┗requiredtrue or false
┗intermediate_dlrtrue or false
┗custom_callback_urlThe callback URL where delivery receipt should be received e.g. https://<WEBHOOK URL>
advanced_settingsOptionalThese elements allow additional control over the message that is being sent. These values may need to be set for specialist use cases. If you are making use of this element, it is assumed that you are familiar with the meaning of the fields within and of the supported values.

Note: To be used by advanced users only - refer appropriate GSM specifications for more details e.g. http://smpp.org/SMPP_v3_4_Issue1_2.pdf
┗message_class0, 1, 2 or 3
┗message_waiting_indicator1 or 2
┗protocol_id0 – 255
metadataOptionalThis element allows you to attach a unique client reference to the message. This value will be reflected and passed back in the API response, as well as in any subsequent delivery receipt Webhook calls that are related to this message.
┗client_referenceThe client_reference field is a free form text field that may contain up to 50 characters.

Sample Request

{
"from": "sender address",
"to": "...destination phone number...",
"message_type": "text",
"text_message": {
"text": "...message body goes here..."
}
"validity_period": {
"days": "1",
"hours": "2",
"minutes": "45",
"seconds": "32"
}
"metadata": {
"client_reference": "client-ref-1",
}
}

Response:

If successful, the API call will return an HTTP 200 OK with a JSON document as a response. Please see section "Errors/Rejections of Submit SMS API Request" for a description of the failure responses.

ParameterDescription
result_codeRefer Result Code List
result_messageDescription of the result code
client_referenceClient reference is returned only when specified in request. Information on attaching "client reference" can be found under "Additional/Advanced Options".
message_idAuto-generated Id
how_many_message_partsThis shows how many parts the message was split into e.g., for 1520 chars’ long message, the value will be 10

Sample Response

{
"result_code": "0",
"result_message": "Message successfully submitted",
"client_reference": "...if provided during original request...",
"message_id": "0000001"
"how_many_message_parts": 1
}