Skip to content

Latest commit

 

History

History
524 lines (341 loc) · 13.1 KB

MessagesApi.md

File metadata and controls

524 lines (341 loc) · 13.1 KB

TheSmsWorksApi.MessagesApi

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

Method HTTP request Description
messageSchedulePost POST /message/schedule
messageSendPost POST /message/send
messagesFailedPost POST /messages/failed
messagesInboxPost POST /messages/inbox
messagesMessageidDelete DELETE /messages/{messageid}
messagesMessageidGet GET /messages/{messageid}
messagesPost POST /messages
messagesScheduleGet GET /messages/schedule
messagesScheduleMessageidDelete DELETE /messages/schedule/{messageid}
sendFlashMessage POST /message/flash

messageSchedulePost

[ScheduledMessageResponse] messageSchedulePost(smsMessage)

Schedules an SMS message to be sent at the date-time you specify

Example

import TheSmsWorksApi from 'the_sms_works_api';
let defaultClient = TheSmsWorksApi.ApiClient.instance;
// Configure API key authorization: JWT
let JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

let apiInstance = new TheSmsWorksApi.MessagesApi();
let smsMessage = new TheSmsWorksApi.Message(); // Message | Message properties
apiInstance.messageSchedulePost(smsMessage, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
smsMessage Message Message properties

Return type

[ScheduledMessageResponse]

Authorization

JWT

HTTP request headers

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

messageSendPost

SendMessageResponse messageSendPost(smsMessage)

Send an SMS Message

Example

import TheSmsWorksApi from 'the_sms_works_api';
let defaultClient = TheSmsWorksApi.ApiClient.instance;
// Configure API key authorization: JWT
let JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

let apiInstance = new TheSmsWorksApi.MessagesApi();
let smsMessage = new TheSmsWorksApi.Message(); // Message | Message properties
apiInstance.messageSendPost(smsMessage, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
smsMessage Message Message properties

Return type

SendMessageResponse

Authorization

JWT

HTTP request headers

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

messagesFailedPost

[MessageResponse] messagesFailedPost(query)

Get failed messages matching your search criteria

Example

import TheSmsWorksApi from 'the_sms_works_api';
let defaultClient = TheSmsWorksApi.ApiClient.instance;
// Configure API key authorization: JWT
let JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

let apiInstance = new TheSmsWorksApi.MessagesApi();
let query = new TheSmsWorksApi.Query(); // Query | 
apiInstance.messagesFailedPost(query, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
query Query

Return type

[MessageResponse]

Authorization

JWT

HTTP request headers

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

messagesInboxPost

[MessageResponse] messagesInboxPost(query)

Get unread uncoming messages matching your search criteria

Example

import TheSmsWorksApi from 'the_sms_works_api';
let defaultClient = TheSmsWorksApi.ApiClient.instance;
// Configure API key authorization: JWT
let JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

let apiInstance = new TheSmsWorksApi.MessagesApi();
let query = new TheSmsWorksApi.Query(); // Query | 
apiInstance.messagesInboxPost(query, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
query Query

Return type

[MessageResponse]

Authorization

JWT

HTTP request headers

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

messagesMessageidDelete

DeletedMessageResponse messagesMessageidDelete(messageid)

Delete the message with the mathcing messageid

Example

import TheSmsWorksApi from 'the_sms_works_api';
let defaultClient = TheSmsWorksApi.ApiClient.instance;
// Configure API key authorization: JWT
let JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

let apiInstance = new TheSmsWorksApi.MessagesApi();
let messageid = "messageid_example"; // String | The ID of the message you would like returned
apiInstance.messagesMessageidDelete(messageid, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
messageid String The ID of the message you would like returned

Return type

DeletedMessageResponse

Authorization

JWT

HTTP request headers

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

messagesMessageidGet

MessageResponse messagesMessageidGet(messageid)

Retrieve a logged message by the message ID

Example

import TheSmsWorksApi from 'the_sms_works_api';
let defaultClient = TheSmsWorksApi.ApiClient.instance;
// Configure API key authorization: JWT
let JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

let apiInstance = new TheSmsWorksApi.MessagesApi();
let messageid = "messageid_example"; // String | The ID of the message you would like returned
apiInstance.messagesMessageidGet(messageid, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
messageid String The ID of the message you would like returned

Return type

MessageResponse

Authorization

JWT

HTTP request headers

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

messagesPost

[MessageResponse] messagesPost(query)

Retrieve up to 1000 messages matching your search criteria

Example

import TheSmsWorksApi from 'the_sms_works_api';
let defaultClient = TheSmsWorksApi.ApiClient.instance;
// Configure API key authorization: JWT
let JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

let apiInstance = new TheSmsWorksApi.MessagesApi();
let query = new TheSmsWorksApi.Query(); // Query | 
apiInstance.messagesPost(query, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
query Query

Return type

[MessageResponse]

Authorization

JWT

HTTP request headers

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

messagesScheduleGet

ScheduledMessagesResponse messagesScheduleGet()

Returns a list of messages scheduled from your account, comprising any messages scheduled in the last 3 months and any scheduled to send in the future

Example

import TheSmsWorksApi from 'the_sms_works_api';
let defaultClient = TheSmsWorksApi.ApiClient.instance;
// Configure API key authorization: JWT
let JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

let apiInstance = new TheSmsWorksApi.MessagesApi();
apiInstance.messagesScheduleGet((error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

This endpoint does not need any parameter.

Return type

ScheduledMessagesResponse

Authorization

JWT

HTTP request headers

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

messagesScheduleMessageidDelete

CancelledMessageResponse messagesScheduleMessageidDelete(messageid)

Cancels a scheduled SMS message

Example

import TheSmsWorksApi from 'the_sms_works_api';
let defaultClient = TheSmsWorksApi.ApiClient.instance;
// Configure API key authorization: JWT
let JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

let apiInstance = new TheSmsWorksApi.MessagesApi();
let messageid = "messageid_example"; // String | The ID of the message you would like returned
apiInstance.messagesScheduleMessageidDelete(messageid, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
messageid String The ID of the message you would like returned

Return type

CancelledMessageResponse

Authorization

JWT

HTTP request headers

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

sendFlashMessage

SendMessageResponse sendFlashMessage(smsMessage)

Sends an SMS flash message, which appears on the recipients lock screen

Example

import TheSmsWorksApi from 'the_sms_works_api';
let defaultClient = TheSmsWorksApi.ApiClient.instance;
// Configure API key authorization: JWT
let JWT = defaultClient.authentications['JWT'];
JWT.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//JWT.apiKeyPrefix = 'Token';

let apiInstance = new TheSmsWorksApi.MessagesApi();
let smsMessage = new TheSmsWorksApi.Message(); // Message | Message properties
apiInstance.sendFlashMessage(smsMessage, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
smsMessage Message Message properties

Return type

SendMessageResponse

Authorization

JWT

HTTP request headers

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