Package com.sendly
Class Sendly
java.lang.Object
com.sendly.Sendly
Sendly API Client
Official Java SDK for the Sendly SMS API.
Sendly client = new Sendly("sk_live_v1_xxx");
Message message = client.messages().send("+15551234567", "Hello!");
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for Sendly client configuration. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new Sendly client with default settings.Sendly(String apiKey, Sendly.Builder builder) Create a new Sendly client with custom configuration. -
Method Summary
Modifier and TypeMethodDescriptionaccount()Get the Account resource.com.google.gson.JsonObjectMake a DELETE request.com.google.gson.JsonObjectMake a GET request.com.google.gson.GsongetGson()Get the Gson instance.messages()Get the Messages resource.com.google.gson.JsonObjectMake a PATCH request.com.google.gson.JsonObjectMake a POST request.webhooks()Get the Webhooks resource.
-
Field Details
-
VERSION
- See Also:
-
DEFAULT_BASE_URL
- See Also:
-
DEFAULT_TIMEOUT
-
-
Constructor Details
-
Sendly
Create a new Sendly client with default settings.- Parameters:
apiKey- Your Sendly API key
-
Sendly
Create a new Sendly client with custom configuration.- Parameters:
apiKey- Your Sendly API keybuilder- Configuration builder
-
-
Method Details
-
messages
Get the Messages resource.- Returns:
- Messages resource
-
webhooks
Get the Webhooks resource.- Returns:
- Webhooks resource
-
account
Get the Account resource.- Returns:
- Account resource
-
get
public com.google.gson.JsonObject get(String path, Map<String, String> params) throws SendlyExceptionMake a GET request.- Parameters:
path- API endpoint pathparams- Query parameters- Returns:
- Response as JsonObject
- Throws:
SendlyException- if the request fails
-
post
Make a POST request.- Parameters:
path- API endpoint pathbody- Request body- Returns:
- Response as JsonObject
- Throws:
SendlyException- if the request fails
-
patch
Make a PATCH request.- Parameters:
path- API endpoint pathbody- Request body- Returns:
- Response as JsonObject
- Throws:
SendlyException- if the request fails
-
delete
Make a DELETE request.- Parameters:
path- API endpoint path- Returns:
- Response as JsonObject
- Throws:
SendlyException- if the request fails
-
getGson
public com.google.gson.Gson getGson()Get the Gson instance.
-