Java client SDK for The SMS Works API
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
gradle/wrapper
src
.DS_Store
README.md
build.gradle
build.sbt
git_push.sh
gradle.properties
gradlew
gradlew.bat
pom.xml
settings.gradle

README.md

swagger-java-client

Requirements

Building the API client library requires Maven to be installed.

Installation

To install the API client library to your local Maven repository, simply execute:

mvn install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn deploy

Refer to the official documentation for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
    <groupId>io.swagger</groupId>
    <artifactId>swagger-java-client</artifactId>
    <version>1.0.0</version>
    <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "io.swagger:swagger-java-client:1.0.0"

Others

At first generate the JAR by executing:

mvn package

Then manually install the following JARs:

  • target/swagger-java-client-1.0.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.AuthApi;

import java.io.File;
import java.util.*;

public class AuthApiExample {

    public static void main(String[] args) {

        AuthApi apiInstance = new AuthApi();
        String customerid = "customerid_example"; // String | The Customer ID
        try {
            ApiKeyResponse result = apiInstance.keySecret(customerid);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AuthApi#keySecret");
            e.printStackTrace();
        }
    }
}

Test calls in Postman

Run in Postman

Documentation for API Endpoints

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

Class Method HTTP request Description
AuthApi keySecret GET /auth/getApiKey
AuthApi login POST /auth/token
BatchMessagesApi cancelScheduledBatchJob DELETE /batches/schedule/{batchid}
BatchMessagesApi getBatchById GET /batch/{batchid}
BatchMessagesApi scheduleBatch POST /batch/schedule
BatchMessagesApi sendBatch POST /batch/send
MessagesApi cancelScheduledJob DELETE /messages/schedule/{messageid}
MessagesApi getInboxMessages POST /messages/inbox
MessagesApi getMessageById GET /messages/{messageid}
MessagesApi getMessages POST /messages
MessagesApi scheduleMessage POST /message/schedule
MessagesApi sendMessage POST /message/send
UtilsApi test GET /utils/test

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

JWT

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author