public class ConnectoAPI extends Object
| Constructor and Description |
|---|
ConnectoAPI()
Constructs a ConnectoAPI object associated with the production, Connecto services.
|
ConnectoAPI(String endpoint,
String rulesendpoint,
int timeout)
Create a ConnectoAPI associated with custom URLS for the Connecto service.
|
| Modifier and Type | Method and Description |
|---|---|
void |
deliver(ClientDelivery toSend)
Attempts to send a given delivery to the Connecto servers.
|
SegmentResponse |
getSegments(String readKey,
String userId)
This api will get the user segment that is a list of matched segment rules.
|
void |
sendMessage(org.json.JSONObject message)
Sends a single message to Connecto servers.
|
void |
setTimeout(int timeoutInMs)
Set timeout for HTTP cals.
|
public ConnectoAPI()
public ConnectoAPI(String endpoint, String rulesendpoint, int timeout)
endpoint - a URL that will accept Connecto events and identify messagesConnectoAPI()public void setTimeout(int timeoutInMs)
timeoutInMs - an integer representing millisecondspublic void sendMessage(org.json.JSONObject message)
throws ConnectoMessageException,
IOException
deliver(ClientDelivery)message - A JSONObject formatted by #MessageBuilderConnectoMessageException - if the given JSONObject is not (apparently) a Connecto message. This is a RuntimeException, callers should take care to submit only correctly formatted messages.IOException - ifpublic void deliver(ClientDelivery toSend) throws IOException
toSend - a ClientDelivery containing a number of Connecto messagesIOException - if its unable to parse messagesClientDeliverypublic SegmentResponse getSegments(String readKey, String userId) throws IOException
readKey - an authorization key provided to you in Connecto adminuserId - a user id whose segments are being requested.IOExceptionCopyright © 2015. All rights reserved.