Skip to content
This repository has been archived by the owner on Sep 8, 2022. It is now read-only.

working-group-two/wgtwo-kotlin-code-snippets

Repository files navigation

Working Group Two API examples for Kotlin

Setup

  • You will need either a personal API key or an operator API key.
    • Supply this client id and secret as environment variables WGTWO_CLIENT_ID and WGTWO_CLIENT_SECRET.
  • You will need a msisdn to target on the platform (and for which you are authorized to manage)

Run

Run via an IDE like IntelliJ or Visual Studio Code to launch the example *Main.kt files, or via command line.

In any case you must supply the needed parameters as program arguments.

Command line examples

Setup
Setting the required environment variables

Before running the other commands it's helpful to set the needed credentials so you don't need to include them in each command.

$ export WGTWO_CLIENT_ID=YOUR_CLIENT_ID
$ export WGTWO_CLIENT_SECRET=YOUR_CLIENT_SECRET
Build the project

Before running the examples you need to build the project.

$ ./mvnw package
List and play voicemail
$ java -jar target/wgtwo.jar voicemail list --e164 <e164> # lists all the voicemails.
$ java -jar target/wgtwo.jar voicemail play <voicemail_id> # play a voicemail by id given in the above command.
Send SMS
$ java -jar target/wgtwo.jar sendsms --from=4799900111 4799900111 This is a test SMS # sends sms to and from 4799900111
Receive SMS
$ java -jar target/wgtwo.jar receivesms 4799900111 # shows sms activity for 4799900111

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •