Skip to content

THECALLR/sdk-android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ DEPRECATED — Callr API v1 (JSON-RPC)

This SDK targets the legacy Callr JSON-RPC API (v1), which is deprecated and will be shut down on 30 June 2027. After that date this SDK will stop working.

➡️ Please migrate to the new Callr REST API v2.

Your existing API credentials work with REST API v2 — no new keys required.

Official Callr REST API v2 SDKs are coming in the near future. In the meantime, you can call the REST API directly, or generate a client from the OpenAPI 3.1 spec (see Generate a REST API v2 client today below).


Generate a REST API v2 client today

An official Callr REST API v2 SDK for Android / Kotlin is coming soon. Until then, generate a fully-typed client from the OpenAPI 3.1 spec with OpenAPI Generator (requires v7.x+ for OpenAPI 3.1):

docker run --rm -v "$PWD:/local" openapitools/openapi-generator-cli generate \
  -g kotlin \
  -i https://api.callr.com/v2.0/openapi.json \
  -o /local/callr-v2-android

Authenticate with your API Key via the x-api-key header (or HTTP Basic: Account SID + API Key). The base URL https://api.callr.com/v2.0 is baked into the generated client — see its generated docs/ for the available endpoints.


sdk-android

SDK in Java (Android) for CALLR API

Dependencies

The CALLR API is in JSON which needs to be parsed. This SDK is based on google-gson to parse json, and apache commons codec to encode base64. So it need to be added as well as our SDK in you project (see jars folder).

See https://code.google.com/p/google-gson/ for more information on google-gson. and https://commons.apache.org/proper/commons-codec/ for the apache commons codec.

The jars folder contains the jar of the CALLR Java SDK.

Basic Example (Send SMS)

See full example in samples - This can be imported into Android Studio as a gradle based project.

// Set your credentials
Api tc = new Api("login", "password");

Hashtable<String, Object> param = new Hashtable<String, Object>();
param.put("flash_message", false);

try {
	JsonElement result = tc.call("sms.send", "SMS", "+33123456789", "Hello, world", param);
	System.out.println(result.getAsString());
} catch (ThecallrException e) {
	System.out.println(e.getMessage());
	System.out.println(e.data);
}

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

11 watching

Forks

Packages

 
 
 

Contributors

Languages