## com.baidubce.services.sms
Class SmsClient

    java.lang.Object
      com.baidubce.AbstractBceClient
          com.baidubce.services.sms.SmsClientSupport
              com.baidubce.services.sms.SmsClient

    public class SmsClient

extends SmsClientSupport

The entrance class for all client access to the API of SMS(Baidu message Service).

All of the API method of SMS is included in this class.

Field Summary

Fields inherited from class com.baidubce.services.sms.SmsClientSupport
`SMS_HANDLERS`

Fields inherited from class com.baidubce.AbstractBceClient
`config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX`

Constructor Summary
`SmsClient()` Constructs a new `SmsClient` instance with default settings.
`SmsClient(SmsClientConfiguration config)` Constructs a new `SmsClient` instance with the specified configuration.

Method Summary
`CreateTemplateResponse` `createTemplate(CreateTemplateRequest request)` Create message template
`void` `deleteTemplate(DeleteTemplateRequest request)` Delete message template
`GetTemplateDetailResponse` `getTemplateDetail(GetTemplateDetailRequest request)` Get the detail of message template
`ListTemplateResponse` `listTemplate(SmsRequest request)` Get the list of message template
`QueryMessageDetailResponse` `queryMessageDetail(QueryMessageDetailRequest request)` Query message detail
`QueryQuotaResponse` `queryQuota(SmsRequest request)` Query the sending quota
`SendMessageResponse` `sendMessage(SendMessageRequest request)` Send message
`StatReceiverResponse` `statReceiver(StatReceiverRequest request)` Get the statistics about receiving message

Methods inherited from class com.baidubce.services.sms.SmsClientSupport
`assertListNotNullOrEmpty, assertStringArrayNotNullOrEmpty, assertStringNotNullOrEmpty, createRequest, fillRequestPayload`

Methods inherited from class com.baidubce.AbstractBceClient
`getClient, getEndpoint, getServiceId, invokeHttpClient, isRegionSupported, setClient, shutdown`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SmsClient

    public SmsClient()

  Constructs a new `SmsClient` instance with default settings.

### SmsClient

    public SmsClient(SmsClientConfiguration config)

  Constructs a new `SmsClient` instance with the specified configuration.

  Parameters:
    `config` - the specified configuration, default inherit super class `com.baidubce.BceClientConfiguration`
  See Also:
    `SmsClientConfiguration`

Method Detail

### sendMessage

    public SendMessageResponse sendMessage(SendMessageRequest request)

  Send message

  To send message, you have to specify a template which is built by system, or created by yourself which is audited by BCE administrator.

  One or more receiver can be specified while sending message.

  Parameters:
    `request` - The request object which includes the content to send and one or more receiver
  Returns:
    The response object which includes the id of message and the statistics of sending result
  See Also:
    `SendMessageRequest`, `SendMessageResponse`

### queryMessageDetail

    public QueryMessageDetailResponse queryMessageDetail(QueryMessageDetailRequest request)

  Query message detail

  Parameters:
    `request` - The request object which includes the id of message to query
  Returns:
    The response object which includes all the detail result, for example `id`, `content`, `receiver`, `sendTime` etc
  See Also:
    `QueryMessageDetailRequest`, `QueryMessageDetailResponse`

### createTemplate

    public CreateTemplateResponse createTemplate(CreateTemplateRequest request)

  Create message template

  The template which is created will have a unique id. after audited by BCE administrator, it can be used normally.

  Parameters:
    `request` - The request object which includes the name and content of template which is ready to be created
  Returns:
    The response object which includes the id of template which is created
  See Also:
    `CreateTemplateRequest`, `CreateTemplateResponse`

### deleteTemplate

    public void deleteTemplate(DeleteTemplateRequest request)

  Delete message template

  Parameters:
    `request` - The request object which includes the id of template which is ready to be deleted
  See Also:
    `DeleteTemplateRequest`

### getTemplateDetail

    public GetTemplateDetailResponse getTemplateDetail(GetTemplateDetailRequest request)

  Get the detail of message template

  Parameters:
    `request` - The request object which includes the id of template which is ready to be get
  Returns:
    The response object which includes all of the detail of message template, refer to `com.baidubce.services.sms.model.GetTemplateDetailResponse`
  See Also:
    `GetTemplateDetailRequest`, `GetTemplateDetailResponse`

### listTemplate

    public ListTemplateResponse listTemplate(SmsRequest request)

  Get the list of message template

  Parameters:
    `request` - The request object which is empty
  Returns:
    The response object which includes all of the detail of message template,refer to `com.baidubce.services.sms.model.ListTemplateResponse`
  See Also:
    `ListTemplateResponse`

### queryQuota

    public QueryQuotaResponse queryQuota(SmsRequest request)

  Query the sending quota

  Parameters:
    `request` - The request object which is empty
  Returns:
    The response object which includes the detail of sending quota, refer to `com.baidubce.services.sms.model.QueryQuotaResponse`
  See Also:
    `QueryQuotaResponse`

### statReceiver

    public StatReceiverResponse statReceiver(StatReceiverRequest request)

  Get the statistics about receiving message

  Parameters:
    `request` - refer to `com.baidubce.services.sms.model.StatReceiverRequest`
  Returns:
    refer to `com.baidubce.services.sms.model.StatReceiverResponse`
  See Also:
    `StatReceiverRequest`, `StatReceiverResponse`

Copyright © 2016. All rights reserved.