This chapter describes the operations in the Short Messaging interface of the RESTful facade provided in Oracle Communications Services Gatekeeper.
Applications use the RESTful Short Messaging interface to send an SMS, a ringtone, or a logo, to fetch SMS messages and delivery status reports; and to start and stop a notification.
When the request body for an SMS operation contains a request for a delivery receipt, the application provides a correlator for the message being sent and includes an endpoint address for returning the delivery notification.
For such operations, the application client subscribes to and uses the Bayeux channel to which Services Gatekeeper is subscribed. The application provides the Bayeux channel name as the location for Services Gatekeeper to publish the notifications that the application client requires. See "RESTful Notifications and Publish/Subscribe" for more information about publishing and subscribing to RESTful notifications.
When the Administration Server for your Services Gatekeeper domain is in the running state, the REST service descriptions of these operations can be found at
http://host:port/rest/sms/index.html
where host and port are the host name and port of the system on which Services Gatekeeper is installed.
The Send SMS operation delivers a text message.
To send an SMS message, provide the URI of the addresses which must receive the message in the request body. If there is to be a charge for the messaging, the request body should contain the required charging object. If the sender requires a delivery receipt, specify the required parameters for the receipt.
If the Send SMS operation is successful, the Location header field in the response will contain the request identifier (which is also provided in the response body for this operation).
If the application requested a receipt for delivery of the message, the application must access the endpoint address to retrieve the delivery notifications.
http://host:port/rest/sms/messages
where host and port are the host name and port of the system on which Services Gatekeeper is installed.
The request body for the Send SMS operation accepts the following parameters:
addresses: Array of string values. Required. The set of addresses of the recipients as an array of URIs.
message: String. Required. The text of the message.
charging: A JSON object. Optional. This object defines the cost charging properties for the operation. The entry "charging": null
indicates no charge. If a charge is to be applied, provide values for the following in the charging object:
description: String. Required if the charging object is present in the body of the request. The text to be used for information and billing.
amount: Number (integer, or decimal). Optional. The amount to be charged.
code: String. Optional. The charging code, from an existing contractual description.
currency: String. Optional. The currency identifier as defined in ISO 4217 [9].
receiptRequest: A JSON object. Optional. If a delivery receipt is required, provide values for each of the following parameters which define this object:
correlator: String. Required. Used to correlate the receipt with the initial message.
If the callback reference correlator is defined in the receiptRequest object of the Send SMS request message, Services Gatekeeper will invoke the Notify SMS Delivery Receipt operation and discard the delivery status information.
endpoint: String. Required. The endpoint address (URI) to which the receipt must be delivered.
interfaceName: String. Required. A description provided to identify the type of receipt.
senderName: String. Optional. The sender's name.
The request body for this operation is represented by the following JSON structure, where the value part of each name/value pair indicates its data type:
{ "addresses": ["URI"], "message": "String", "charging": { "description": "String", "amount": "BigDecimal", "code": "String", "currency": "String" }, "receiptRequest": { "correlator": "String", "endpoint": "URI", "interfaceName": "String" }, "senderName": "String" }
The Location header field contains the URI:
http://host:port/rest/sms/delivery_status/result
where, result is the string identifier returned in the response body.
If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Understanding RESTful Errors and Exceptions".
The body of the response contains the request identifier as the string value for the result object; it is the request identifier returned in the Location header field of the response message. The application uses this request identifier (in the Get SMS Delivery Status operation) to retrieve the delivery status for the sent message.
The response body for this operation is represented by the following JSON structure, where the value part of the name/value pair indicates its data type:
{"result": "String"}
The Send SMS Ringtone operation delivers a ringtone.
To send an SMS Ringtone message, provide the URI of the addresses which must receive the message, the ringtone data and its format in the request body for this operation. If there is to be a charge for the messaging, the request body should contain the required charging object. If the sender requires a delivery receipt, specify the required parameters for the receipt.
If the Send SMS Ringtone operation is successful, the Location header field in the response will contain the request identifier (which is also provided in the response body for this operation).
If the application requested a receipt for delivery of the message, the application must access the endpoint address to retrieve the delivery notifications.
http://host:port/rest/sms/ringtones
where host and port are the host name and port of the system on which Services Gatekeeper is installed.
The request body is a nested JSON object containing the following parameters:
addresses: Array of string values. Required. The set of addresses of the recipients as an array of URIs.
ringtone: String. Required. The ringtone data in Extended Ringtone (RTX) format.
smsFormat: String. Required. The encoding format for the ringtone entered as one of the following:
Ems
SmartMessaging
charging: A JSON object. Optional. This object defines the cost charging properties for the operation. The entry "charging": null
indicates no charge. If a charge is to be applied, provide values for the following in the charging object:
description: String. Required if the charging object is present in the body of the request. The text to be used for information and billing.
amount: Number (integer, or decimal). Optional. The amount to be charged.
code: String. Optional. The charging code, from an existing contractual description.
currency: String. Optional. The currency identifier as defined in ISO 4217 [9].
receiptRequest: A JSON object. Optional. If a delivery receipt is required, provide values for each of the following parameters which define this object:
correlator: String. Required. Used to correlate the receipt with the initial message.
If the callback reference correlator is defined in the receiptRequest object of the Send SMS request message, Services Gatekeeper will invoke the Notify SMS Delivery Receipt operation and discard the delivery status information.
endpoint: String. Required. The endpoint address (URI) to which the receipt must be delivered.
interfaceName: String. Required. A description provided to identify the type of receipt.
senderName: String. Optional. The sender's name.
The request body for this operation is represented by the following JSON structure, where the value part of each name/value pair indicates its data type:
{ "addresses": ["URI"], "ringtone": "String", "smsFormat": "Ems|SmartMessaging", "charging": { "description": "String", "amount": "BigDecimal", "code": "String", "currency": "String" }, "receiptRequest": { "correlator": "String", "endpoint": "URI", "interfaceName": "String" }, "senderName": "String" }
http://host:port/rest/sms/delivery_status/result
where, result is the string identifier returned in the request body.
If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Understanding RESTful Errors and Exceptions".
The body of the response contains the result object whose value is the request identifier returned in the Location header field of the response message. The application uses this request identifier (in the Get SMS Delivery Status operation) to retrieve the delivery status for the sent message.
The response body for this operation is represented by the following JSON structure, where the value part of the name/value pair indicates its data type:
{"result": "String"}
The Send SMS Logo operation delivers a logo.
To send an SMS Logo, provide the URI of the addresses which must receive the message, the logo data and its format in the request body for this operation. If there is to be a charge for the messaging, the request body should contain the required charging object. If the sender requires a delivery receipt, specify the required parameters for the receipt.
If the Send SMS Logo operation is successful, the Location header field in the response will contain the request identifier (which is also provided in the response body for this operation).
If the application requested a receipt for delivery of the message, the application must access the endpoint address to retrieve the delivery notifications.
http://host:port/rest/sms/logo
where host and port are the host name and port of the system on which Services Gatekeeper is installed.
The request body for the Send SMS operation accepts the following parameters:
addresses: Array of string values. Required. The set of addresses of the recipients as an array of URIs.
image: String. Required. The logo data, a base64-encoded image in GIF, PNG or JPG format.
smsFormat: String. Required. The encoding format for the logo entered as one of the following:
Ems
SmartMessaging
charging: A JSON object. Optional. Use this object to define the cost charging properties for the operation. The entry "charging": null
indicates no charge. If a charge is to be applied, provide values for the following in the charging object:
description: String. Required if the charging object is present in the body of the request. The text to be used for information and billing.
amount: Number (integer, or decimal). Optional. The amount to be charged.
code: String. Optional. The charging code, from an existing contractual description.
currency: String. Optional. The currency identifier as defined in ISO 4217 [9].
receiptRequest: A JSON object. Optional. If a delivery receipt is required, provide values for each of the following parameters which define this object:
correlator: String. Required. Used to correlate the receipt with the initial message.
If the callback reference correlator is defined in the receiptRequest object of the Send SMS request message, Services Gatekeeper will invoke the Notify SMS Delivery Receipt operation and discard the delivery status information.
endpoint: String. Required. The endpoint address (URI) to which the receipt must be delivered.
interfaceName: String. Required. A description provided to identify the type of receipt.
senderName: String. Optional. The sender's name.
The request body for this operation is represented by the following JSON data structure, where the value part of each name/value pair indicates its data type:
{ "addresses": ["URI"], "image": "base64Binary", "smsFormat": "Ems|SmartMessaging", "charging": { "description": "String", "amount": "BigDecimal", "code": "String", "currency": "String" }, "receiptRequest": { "correlator": "String", "endpoint": "URI", "interfaceName": "String" }, "senderName": "String" }
The Location header field contains the URI:
http://host:port/rest/sms/delivery_status/result
where, result is the string identifier returned in the request body.
If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Understanding RESTful Errors and Exceptions".
The response body contains the result object whose value is the request identifier returned in the Location header field of the response message. The application uses this request identifier (in the Get SMS Delivery Status operation) to retrieve the delivery status for the sent message.
The response body for this operation is represented by the following JSON data structure, where the value part of the name/value pair indicates its data type:
{"result": "String"}
The Get Received SMS operation polls Services Gatekeeper for the SMS messages that have been received from the network for an application.
The request header for the Get Received SMS operation contains the registration identifier necessary to retrieve the required SMS messages intended for the application. This registration value should have been set up with the off-line provisioning step that enables the application to receive notification of SMS reception.
There is no request body.
If the Get Received SMS operation is successful, the response body will contain the message, the URI of the sender, the SMS service activation number and the date and time when the message was sent.
http://host:port/rest/sms/receive-messages/${registrationIdentifier}
where:
host and port are the host name and port of the system on which Services Gatekeeper is installed.
registrationIdentifier is the value previously set up to enable the application to receive notification of SMS reception according to specified criteria.
Standard header fields. If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Understanding RESTful Errors and Exceptions".
The response body contains an array of structures as the value for result. Each element in the array contains values for the following parameters.
message: String. The text of the SMS message.
senderAddress: String. The URI of the sender.
smsServiceActivationNumber: String. URI. The number associated with the invoked message service, that is the destination address used to send the message.
dateTime: String. The start time for the call in ISO 8601 extended format, yyyy-mm-ddThh-mm-ss
.
The response body for this operation is represented by the following JSON data structure, where the value part of each name/value pair indicates its data type:
{"result": [{ "message": "String", "senderAddress": "URI", "smsServiceActivationNumber": "URI", "dateTime": "Calendar" }]}
The Get SMS Delivery Status operation retrieves the delivery status of a message that was previously sent using Send SMS, Send SMS Ringtone or Send SMS Logo operation.
The Get SMS Delivery Status operation is valid only if the correlator callback reference was not defined in the receiptRequest object of the initial request to send the short message. In such a scenario, Services Gatekeeper stores the delivery status for a configurable period.
If the callback reference correlator is defined in the receiptRequest object of the initial request to send the short message, Services Gatekeeper will invoke the Notify SMS Delivery Receipt operation and discard the delivery status information.
The request header for Get SMS Delivery Status contains the request identifier from the initial Send operation for the short message.
If Get SMS Delivery Status is successful, the response body will contain the URIs from the address field in the request body of the Send operation for the short message and corresponding delivery status for each message.
http://host:port/rest/sms/delivery-status/${requestIdentifier}
where:
host and port are the host name and port of the system on which Services Gatekeeper is installed.
requestIdentifier is the identifier returned in the result object of the corresponding Send operation.
Standard header fields. If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Understanding RESTful Errors and Exceptions".
The response body contains an array of structures as the value for result. Each element in the array contains values for the following parameters.
address: String. The URI to which the initial message was sent.
deliveryStatus: Enumeration value. Table 8-1 lists the possible status:
Table 8-1 Enumeration Values for Delivery Status
Value | Description |
---|---|
DeliveredToNetwork |
Successful delivery to network. For concatenated messages, returned only when all the SMS-parts have been successfully delivered to the network. |
DeliveryUncertain |
Delivery status unknown; for example, if the message was handed off to another network. |
DeliveryImpossible |
Unsuccessful delivery; the message could not be delivered before it expired. |
MessageWaiting |
The message is still queued for delivery. This is a temporary state, pending transition to one of the preceding states. |
DeliveredToTerminal |
Successful delivery to terminal. For concatenated messages, returned only when all the SMS-parts have been successfully delivered to the terminal. |
DeliveryNotificationNotSupported |
Unable to provide delivery receipt notification. |
The response body for this operation is represented by the following JSON data structure, where the value part of each name/value pair indicates its data type:
{"result": [{ "address": "URI", "deliveryStatus": "DeliveredToNetwork|DeliveryUncertain|DeliveryImpossible|MessageWaiting|DeliveredToTerminal|DeliveryNotificationNotSupported" }]}
The Start SMS Notification operation starts a notification for the application.
To set up an SMS notification, provide the criteria which will trigger notifications and a reference object for the delivery of the notifications. The criteria can be a string which, when matched, could be the notification of an SMS received or of a delivery receipt. The reference object (also a JSON object) contains the correlator for the notification, the endpoint address (a specific Bayeux channel name) to which the call direction notifications must be sent and, optionally, the interface name (a string to identify the notification).
If the Start SMS Notification request is successful:
The response header will contain the URI of the publish/subscribe server.
A data object associated with the result of the short message operation will be sent to the endpoint address specified in the request body. This data object will contain the appropriate notification (that the message was received or a delivery receipt for the call).
When the Start SMS notification request is successful, the application can access the endpoint address to retrieve the specific call event notifications.
http://host:port/rest/sms/notification
where host and port are the host name and port of the system on which Services Gatekeeper is installed.
The request body for the Start SMS Notification operation accepts the following parameters:
criteria: String. Optional. The text to match against in determining whether or not the application should receive the notification:
notifySmsReception
notifySmsDeliveryReceipt
reference. JSON object. Required. Use this object to provide the following information about the endpoint that is to receive the notification:
correlator: String. Required. The correlator used to identify the notification.
endpoint: String. Required. The URI which represents the endpoint address to which the notification should be delivered. This string should be a Bayeux protocol channel name that begins with /bayeux/
appInstanceID
where appInstanceID is the client application's application instance account ID.
For more information on application instances, see the discussion on managing application instances in Services Gatekeeper Portal Developer's Guide.
interfaceName: String. Required. A descriptive string to identify the type of notification.
smsServiceActivationNumber: String. Required. The number associated with the invoked message service, that is the destination address used to send the message
The request body for this operation is represented by the following JSON data structure, where the value part of each name/value pair indicates its data type:
"reference": { "correlator": "String", "endpoint": "URI", "interfaceName": "String" }, "smsServiceActivationNumber": "URI", "criteria": "String" }
The Location header field contains the URI of the publish/subscribe server:
http://host:port/rest/sms/notifications
If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Understanding RESTful Errors and Exceptions".
There is no response body. The appropriate notifications (described below) are sent to the endpoint address provided by the application in the request body of this operation.
Notification Data Object for SMS Reception (notifySmsReception)
When an SMS message is successfully retrieved by the called party and the value for criteria in the request body is notifySmsReception, Services Gatekeeper will send a nested JSON data object to the endpoint address.
notifySmsReception is a nested JSON object and contains the following values:
correlator: String. Required. The correlator used to identify the notification.
message: Nested JSON object. Required. It contains the following:
message: String. Required. The contents of the SMS message.
senderAddress: String. Required. The URI of the sender of the SMS message.
smsServiceActivationNumber: String. Required. The number associated with the invoked message service, that is the destination address used to send the message.
dateTime: String. Optional. The time at which the message was sent in ISO 8601 extended format, yyyy-mm-ddThh-mm-ss
.
The notification data object delivered to the endpoint address when the criteria is notifySmsReception is represented by the following JSON data structure, where the value part of each name/value pair indicates its data type:
{"notifySmsReception": { "correlator": "String", "message": { "message": "String", "senderAddress": "URI", "smsServiceActivationNumber": "URI", "dateTime": "Calendar" } }}
Notification Data Object for SMS Delivery Receipt (notifySmsDeliveryReceipt)
When an SMS message is successfully retrieved by the called party and the value for criteria in the request body is , Services Gatekeeper sends a nested JSON data object to the endpoint address.
notifySmsDeliveryReceipt is a nested JSON object and contains the following values:
correlator: String. The correlator used to identify the notification.
deliveryStatus. Enumeration value. Table 8-2 lists the possible status values:
Table 8-2 Enumeration Values for Delivery Status
Value | Description |
---|---|
DeliveredToNetwork |
Successful delivery to network. For concatenated messages, this is the value only when all the parts of the SMS message have been successfully delivered to the network. |
DeliveryUncertain |
Delivery status unknown; for example, if the message was handed off to another network. |
DeliveryImpossible |
Unsuccessful delivery; the message could not be delivered before it expired. |
DeliveredToTerminal |
Successful delivery to terminal. For concatenated messages, this is the value only when all the parts of the SMS message have been successfully delivered to the terminal. |
DeliveryNotificationNotSupported |
Unable to provide delivery receipt notification. |
The notification data object delivered to the endpoint address when the criteria is notifySmsDeliveryReceipt is represented by the following JSON data structure, where the value part of each name/value pair indicates its data type:
{"notifySmsDeliveryReceipt": { "correlator": "String", "deliveryStatus": { "address": "URI", "deliveryStatus": "DeliveredToNetwork|DeliveryUncertain|DeliveryImpossible|MessageWaiting| DeliveredToTerminal|DeliveryNotificationNotSupported" } }}
The Stop SMS Notification operation terminates a previously set up SMS notification for the application.
To stop a previously set up SMS notification, provide the correlator for the notification passed earlier in the Start SMS Notification request.
There is no request or response body for the Stop SMS Notification operation. If the request fails, the body of the error response will contain the identifier for the notification and the type of exception.
http://host:port/rest/sms/notification/${correlator}
where:
host and port are the host name and port of the system on which Services Gatekeeper is installed.
correlator is the correlator for the notification provided in the reference object of the initial Start SMS Notification request body.
Standard header fields. If the request fails, the Status-Line header field will contain the status code and the reason for the failure. See "Understanding RESTful Errors and Exceptions".