Skip to content

Latest commit

 

History

History
367 lines (278 loc) · 11.6 KB

BatchMessagesApi.md

File metadata and controls

367 lines (278 loc) · 11.6 KB

BatchMessagesApi

All URIs are relative to https://api.thesmsworks.co.uk/v1

Method HTTP request Description
batchAnyPost POST /batch/any
batchBatchidGet GET /batch/{batchid}
batchSchedulePost POST /batch/schedule
batchSendPost POST /batch/send
batchesScheduleBatchidDelete DELETE /batches/schedule/{batchid}

batchAnyPost

BatchMessageResponse batchAnyPost(messages)

Sends a collection of unique SMS messages. Batches may contain up to 5000 messages at a time.

Example

// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.BatchMessagesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.thesmsworks.co.uk/v1");
    
    // Configure API key authorization: JWT
    ApiKeyAuth JWT = (ApiKeyAuth) defaultClient.getAuthentication("JWT");
    JWT.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //JWT.setApiKeyPrefix("Token");

    BatchMessagesApi apiInstance = new BatchMessagesApi(defaultClient);
    Object messages = null; // Object | An array of messages
    try {
      BatchMessageResponse result = apiInstance.batchAnyPost(messages);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling BatchMessagesApi#batchAnyPost");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
messages Object An array of messages

Return type

BatchMessageResponse

Authorization

JWT

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

HTTP response details

Status code Description Response headers
201 Success -
402 Error -
0 Error -

batchBatchidGet

List<MessageResponse> batchBatchidGet(batchid)

Retrieve all messages in a batch with the given batch ID

Example

// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.BatchMessagesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.thesmsworks.co.uk/v1");
    
    // Configure API key authorization: JWT
    ApiKeyAuth JWT = (ApiKeyAuth) defaultClient.getAuthentication("JWT");
    JWT.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //JWT.setApiKeyPrefix("Token");

    BatchMessagesApi apiInstance = new BatchMessagesApi(defaultClient);
    String batchid = "batchid_example"; // String | The ID of the batch you would like returned
    try {
      List<MessageResponse> result = apiInstance.batchBatchidGet(batchid);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling BatchMessagesApi#batchBatchidGet");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
batchid String The ID of the batch you would like returned

Return type

List<MessageResponse>

Authorization

JWT

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json;charset=UTF-8

HTTP response details

Status code Description Response headers
200 Success -
404 Error -
0 Error -

batchSchedulePost

ScheduledBatchResponse batchSchedulePost(smsMessage)

Schedules a batch of SMS messages to be sent at the date time you specify

Example

// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.BatchMessagesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.thesmsworks.co.uk/v1");
    
    // Configure API key authorization: JWT
    ApiKeyAuth JWT = (ApiKeyAuth) defaultClient.getAuthentication("JWT");
    JWT.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //JWT.setApiKeyPrefix("Token");

    BatchMessagesApi apiInstance = new BatchMessagesApi(defaultClient);
    BatchMessage smsMessage = new BatchMessage(); // BatchMessage | Message properties
    try {
      ScheduledBatchResponse result = apiInstance.batchSchedulePost(smsMessage);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling BatchMessagesApi#batchSchedulePost");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
smsMessage BatchMessage Message properties

Return type

ScheduledBatchResponse

Authorization

JWT

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

HTTP response details

Status code Description Response headers
201 Success -
402 Error -
0 Error -

batchSendPost

BatchMessageResponse batchSendPost(smsMessage)

Send a single SMS message to multiple recipients. Batches may contain up to 5000 messages at a time.

Example

// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.BatchMessagesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.thesmsworks.co.uk/v1");
    
    // Configure API key authorization: JWT
    ApiKeyAuth JWT = (ApiKeyAuth) defaultClient.getAuthentication("JWT");
    JWT.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //JWT.setApiKeyPrefix("Token");

    BatchMessagesApi apiInstance = new BatchMessagesApi(defaultClient);
    BatchMessage smsMessage = new BatchMessage(); // BatchMessage | Message properties
    try {
      BatchMessageResponse result = apiInstance.batchSendPost(smsMessage);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling BatchMessagesApi#batchSendPost");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
smsMessage BatchMessage Message properties

Return type

BatchMessageResponse

Authorization

JWT

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json;charset=UTF-8

HTTP response details

Status code Description Response headers
201 Success -
402 Error -
0 Error -

batchesScheduleBatchidDelete

CancelledMessageResponse batchesScheduleBatchidDelete(batchid)

Cancels a scheduled SMS message

Example

// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.BatchMessagesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = Configuration.getDefaultApiClient();
    defaultClient.setBasePath("https://api.thesmsworks.co.uk/v1");
    
    // Configure API key authorization: JWT
    ApiKeyAuth JWT = (ApiKeyAuth) defaultClient.getAuthentication("JWT");
    JWT.setApiKey("YOUR API KEY");
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //JWT.setApiKeyPrefix("Token");

    BatchMessagesApi apiInstance = new BatchMessagesApi(defaultClient);
    String batchid = "batchid_example"; // String | The ID of the batch you would like returned
    try {
      CancelledMessageResponse result = apiInstance.batchesScheduleBatchidDelete(batchid);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling BatchMessagesApi#batchesScheduleBatchidDelete");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Parameters

Name Type Description Notes
batchid String The ID of the batch you would like returned

Return type

CancelledMessageResponse

Authorization

JWT

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json;charset=UTF-8

HTTP response details

Status code Description Response headers
200 Success -
0 Error -