Skip to content

Latest commit

 

History

History
322 lines (214 loc) · 9.57 KB

BatchMessagesApi.md

File metadata and controls

322 lines (214 loc) · 9.57 KB

OpenAPI\Client\BatchMessagesApi

All URIs are relative to https://api.thesmsworks.co.uk/v1, except if the operation defines another base path.

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()

batchAnyPost($messages): \OpenAPI\Client\Model\BatchMessageResponse

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

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: JWT
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\BatchMessagesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$messages = array('key' => new \stdClass); // object | An array of messages

try {
    $result = $apiInstance->batchAnyPost($messages);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BatchMessagesApi->batchAnyPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
messages object An array of messages

Return type

\OpenAPI\Client\Model\BatchMessageResponse

Authorization

JWT

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

batchBatchidGet()

batchBatchidGet($batchid): \OpenAPI\Client\Model\MessageResponse[]

Retrieve all messages in a batch with the given batch ID

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: JWT
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\BatchMessagesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$batchid = 'batchid_example'; // string | The ID of the batch you would like returned

try {
    $result = $apiInstance->batchBatchidGet($batchid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BatchMessagesApi->batchBatchidGet: ', $e->getMessage(), PHP_EOL;
}

Parameters

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

Return type

\OpenAPI\Client\Model\MessageResponse[]

Authorization

JWT

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

batchSchedulePost()

batchSchedulePost($sms_message): \OpenAPI\Client\Model\ScheduledBatchResponse

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

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: JWT
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\BatchMessagesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$sms_message = new \OpenAPI\Client\Model\BatchMessage(); // \OpenAPI\Client\Model\BatchMessage | Message properties

try {
    $result = $apiInstance->batchSchedulePost($sms_message);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BatchMessagesApi->batchSchedulePost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
sms_message \OpenAPI\Client\Model\BatchMessage Message properties

Return type

\OpenAPI\Client\Model\ScheduledBatchResponse

Authorization

JWT

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

batchSendPost()

batchSendPost($sms_message): \OpenAPI\Client\Model\BatchMessageResponse

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

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: JWT
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\BatchMessagesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$sms_message = new \OpenAPI\Client\Model\BatchMessage(); // \OpenAPI\Client\Model\BatchMessage | Message properties

try {
    $result = $apiInstance->batchSendPost($sms_message);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BatchMessagesApi->batchSendPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
sms_message \OpenAPI\Client\Model\BatchMessage Message properties

Return type

\OpenAPI\Client\Model\BatchMessageResponse

Authorization

JWT

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

batchesScheduleBatchidDelete()

batchesScheduleBatchidDelete($batchid): \OpenAPI\Client\Model\CancelledMessageResponse

Cancels a scheduled SMS message

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: JWT
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new OpenAPI\Client\Api\BatchMessagesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$batchid = 'batchid_example'; // string | The ID of the batch you would like returned

try {
    $result = $apiInstance->batchesScheduleBatchidDelete($batchid);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling BatchMessagesApi->batchesScheduleBatchidDelete: ', $e->getMessage(), PHP_EOL;
}

Parameters

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

Return type

\OpenAPI\Client\Model\CancelledMessageResponse

Authorization

JWT

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]