Skip to content

coralewh/whispir-java

 
 

Repository files navigation

whispir-java

Whispir Platform API

  • API version: 1.0.0
    • Build date: 2022-09-14T10:37:13.711751+10:00[Australia/Melbourne]

Whispir Platform API for cross channel and multi channel communications. Documentation on each endpoint is available at https://developers.whispir.com.

For more information, please visit https://www.whispir.com/support

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven (3.8.3+)/Gradle (7.2+)

Installation

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

./gradlew clean build

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

./gradlew publishToMavenLocal

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.whispir</groupId>
  <artifactId>whispir-java</artifactId>
  <version>1.0.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

  repositories {
    mavenCentral()     // Needed if the 'whispir-java' jar has been published to maven central.
    mavenLocal()       // Needed if the 'whispir-java' jar has been published to the local maven repo.
  }

  dependencies {
     implementation "com.whispir:whispir-java:1.0.0"
  }

Others

At first generate the JAR by executing:

./gradlew assemble

Then manually install the following JARs:

  • target/whispir-java-1.0.0.jar
  • target/lib/*.jar

Getting Started

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

// Import classes:
import whispir_sdk_java.ApiClient;
import whispir_sdk_java.ApiException;
import whispir_sdk_java.Configuration;
import whispir_sdk_java.auth.*;
import whispir_sdk_java.models.*;
import org.whispir.api.ActivitiesApi;

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

    // Configure HTTP basic authorization: BasicAuth
    HttpBasicAuth BasicAuth = (HttpBasicAuth) defaultClient.getAuthentication("BasicAuth");
    BasicAuth.setUsername("YOUR USERNAME");
    BasicAuth.setPassword("YOUR PASSWORD");

    ActivitiesApi apiInstance = new ActivitiesApi(defaultClient);
    String xApiKey = "xApiKey_example"; // String | The API key for authentication.
    String accept = "application/vnd.whispir.activity-v1+json"; // String | Application specific mime-type.
    BigDecimal limit = new BigDecimal("20"); // BigDecimal | The number of records to be returned.
    BigDecimal offset = new BigDecimal("0"); // BigDecimal | The record number to start returning from.
    String sortOrder = "asc"; // String | The order in which you require the results to be returned. Either ‘asc’ or ‘desc’
    String sortFields = "lastName,jobTitle"; // String | The fields that you require the ordering to be performed on. Multiple fields can be provided, separated by a comma.
    String action = "Create"; // String | /activities?action=Map
    String module = "System"; // String | /activities?module=Message
    String user = "james"; // String | /activities?user=james
    String workspace = "{{workspaceName}}"; // String | /activities?workspace=Whispir.
    String status = "Successful"; // String | /activities?status=Successful
    String description = "Sample Activity"; // String | /activities?description=Imported
    String startTime = "{{startTime}}"; // String | The date and time to start searching from in the format:dd/mm/yyyy hh:mm. This will search on the `time` field <p>/activities?startTime=01/01/2015%2000:00</p>
    String endTime = "{{endTime}}"; // String | The date and time to start searching from in the format:dd/mm/yyyy hh:mm <p>/activities?endTime=01/01/2015%2000:00</p>
    try {
      GetActivities200Response result = apiInstance.getActivities(xApiKey, accept, limit, offset, sortOrder, sortFields, action, module, user, workspace, status, description, startTime, endTime);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling ActivitiesApi#getActivities");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Documentation for API Endpoints

All URIs are relative to https://api.au.whispir.com

Class Method HTTP request Description
ActivitiesApi getActivities GET /activities List activities
ActivitiesApi getWorkspaceActivities GET /workspaces/{workspaceId}/activities List workspace activities
ActivitiesApi postActivities POST /activities Create an activity
AuthApi getAuthVerification GET /auth/verify Verify an auth token
AuthApi postAuth POST /auth Create an auth token
CallbacksApi deleteCallbackById DELETE /callbacks/{callbackId} Delete a callback
CallbacksApi getCallbackById GET /callbacks/{callbackId} Get a callback
CallbacksApi getCallbackInstances GET /callbacks/{callbackId}/calls List callback instances
CallbacksApi getCallbacks GET /callbacks List callbacks
CallbacksApi postCallbacks POST /callbacks Create a callback
CallbacksApi putCallbackById PUT /callbacks/{callbackId} Update a callback
CallbacksApi putCallbackInstanceStatus PUT /callbacks/{callbackId}/calls Update a callback instance status
ContactsApi deleteContactsById DELETE /workspaces/{workspaceId}/contacts/{contactId} Delete a contact
ContactsApi getContacts GET /workspaces/{workspaceId}/contacts List contacts
ContactsApi getContactsById GET /workspaces/{workspaceId}/contacts/{contactId} Retrieve a contact
ContactsApi postContacts POST /workspaces/{workspaceId}/contacts Create a contact
ContactsApi putContactsById PUT /workspaces/{workspaceId}/contacts/{contactId} Update a contact
CustomListsApi getCustomLists GET /customlists List custom lists
CustomListsApi getCustomListsById GET /customlists/{customlistId} Retrieve a custom list
DistributionListsApi deleteDistributionListsById DELETE /workspaces/{workspaceId}/distributionlists/{distributionlistId} Delete a distribution list
DistributionListsApi getDistributionLists GET /workspaces/{workspaceId}/distributionlists List distribution lists
DistributionListsApi getDistributionListsById GET /workspaces/{workspaceId}/distributionlists/{distributionlistId} Retrieve a distribution list
DistributionListsApi postDistributionLists POST /workspaces/{workspaceId}/distributionlists Create a distribution list
DistributionListsApi putDistributionListsById PUT /workspaces/{workspaceId}/distributionlists/{distributionlistId} Update a distribution list
EventsApi createEvent POST /workspaces/{workspaceId}/events Create an event
EventsApi getEventById GET /workspaces/{workspaceId}/events/{eventId} Retrieve an event
EventsApi getEvents GET /workspaces/{workspaceId}/events List events
EventsApi putEventById PUT /workspaces/{workspaceId}/events/{eventId} Update an event
ImportsApi postImports POST /workspaces/{workspaceId}/imports Create an import
MessagesApi getMessageById GET /workspaces/{workspaceId}/messages/{messageId} Retrieve a message
MessagesApi getMessageResponsesById GET /workspaces/{workspaceId}/messages/{messageId}/messageresponses Retrieve a message response
MessagesApi getMessageStatus GET /workspaces/{workspaceId}/messages/{messageId}/messagestatus Retrieve a message status
MessagesApi getMessages GET /workspaces/{workspaceId}/messages List messages
MessagesApi postMessages POST /workspaces/{workspaceId}/messages Send a message
ResourcesApi deleteResourcesById DELETE /workspaces/{workspaceId}/resources/{resourceId} Delete a resource
ResourcesApi getResources GET /workspaces/{workspaceId}/resources List resources
ResourcesApi getResourcesById GET /workspaces/{workspaceId}/resources/{resourceId} Retrieve a resource
ResourcesApi postResources POST /workspaces/{workspaceId}/resources Create a resource
ResourcesApi putResourcesById PUT /workspaces/{workspaceId}/resources/{resourceId} Update a resource
ResponseRulesApi deleteResponseRulesById DELETE /workspaces/{workspaceId}/responserules/{responseRuleId} Delete a response rule
ResponseRulesApi getResponseRules GET /workspaces/{workspaceId}/responserules List response rules
ResponseRulesApi getResponseRulesById GET /workspaces/{workspaceId}/responserules/{responseRuleId} Retrieve a response rule
ResponseRulesApi postResponseRules POST /workspaces/{workspaceId}/responserules Create a response rule
ResponseRulesApi putResponseRulesById PUT /workspaces/{workspaceId}/responserules/{responseRuleId} Update a response rule
ScenariosApi deleteScenariosById DELETE /workspaces/{workspaceId}/scenarios/{scenarioId} Delete a scenario
ScenariosApi getScenarios GET /workspaces/{workspaceId}/scenarios List scenarios
ScenariosApi getScenariosById GET /workspaces/{workspaceId}/scenarios/{scenarioId} Retrieve a scenario
ScenariosApi postScenarios POST /workspaces/{workspaceId}/scenarios Create a scenario
ScenariosApi postScenariosById POST /workspaces/{workspaceId}/scenarios/{scenarioId} Run a scenario
ScenariosApi putScenariosById PUT /workspaces/{workspaceId}/scenarios/{scenarioId} Update a scenario
TemplatesApi deleteTemplatesById DELETE /workspaces/{workspaceId}/templates/{templateId} Delete a template
TemplatesApi getTemplates GET /workspaces/{workspaceId}/templates List templates
TemplatesApi getTemplatesById GET /workspaces/{workspaceId}/templates/{templateId} Retrieve a template
TemplatesApi postTemplates POST /workspaces/{workspaceId}/templates Create a template
TemplatesApi putTemplatesById PUT /workspaces/{workspaceId}/templates/{templateId} Update a template
UsersApi deleteUsers DELETE /users Delete all users
UsersApi deleteUsersById DELETE /users/{userId} Delete a user
UsersApi getUsers GET /users List users
UsersApi getUsersById GET /users/{userId} Retrieve a user
UsersApi getWorkspaceUsers GET /workspaces/{workspaceId}/users List workspace users
UsersApi postUsers POST /users Create a user
UsersApi putUsersById PUT /users/{userId} Update a user
WorkspacesApi getWorkspaces GET /workspaces List workspaces
WorkspacesApi getWorkspacesById GET /workspaces/{workspaceId} Retrieve a workspace
WorkspacesApi postWorkspaces POST /workspaces Create a workspace
WorkspacesApi putWorkspaceById PUT /workspaces/{workspaceId} Update a workspace

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: Api-Key
  • Location: HTTP header

BasicAuth

  • Type: HTTP basic authentication

Recommendation

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

Author

support@whispir.com

About

Whispir Java SDK generated from whispir/openapi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%