|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.twilio.sdk.TwilioClient
public abstract class TwilioClient
The abstract class TwilioClient.
| Field Summary | |
|---|---|
static String |
DEFAULT_VERSION
The Constant DEFAULT_VERSION. |
| Constructor Summary | |
|---|---|
TwilioClient(String accountSid,
String authToken)
Explicitly construct a TwilioClient with the given API credentials. |
|
TwilioClient(String accountSid,
String authToken,
String endpoint)
Explicitly construct a TwilioClient with the given API credentials and endpoint. |
|
| Method Summary | |
|---|---|
TwilioRestResponse |
get(String fullUri)
Perform a GET request against the given fully qualified uri. |
String |
getAccountSid()
|
String |
getEndpoint()
Get the current endpoint this client is pointed at. |
org.apache.http.client.HttpClient |
getHttpClient()
|
int |
getNumRetries()
Gets the num retries. |
TwilioRestResponse |
request(String path,
String method,
List<org.apache.http.NameValuePair> paramList)
|
TwilioRestResponse |
request(String path,
String method,
Map<String,String> paramMap)
sendRequst Sends a REST Request to the Twilio REST API. |
InputStream |
requestStream(String path,
String method,
List<org.apache.http.NameValuePair> paramList)
Request stream. |
InputStream |
requestStream(String path,
String method,
Map<String,String> vars)
Request stream. |
TwilioRestResponse |
safeRequest(String path,
String method,
List<org.apache.http.NameValuePair> paramList)
Make a request, handles retries + back-off for server/network errors |
TwilioRestResponse |
safeRequest(String path,
String method,
Map<String,String> vars)
Make a request, handles retries + back-off for server/network errors |
void |
setHttpClient(org.apache.http.client.HttpClient httpclient)
|
void |
setNumRetries(int numRetries)
Sets the num retries. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String DEFAULT_VERSION
| Constructor Detail |
|---|
public TwilioClient(String accountSid,
String authToken)
accountSid - the 34 character Account identifier (starting with 'AC'). This can be found on your Twilio
dashboard page.authToken - the 32 character AuthToken. This can be found on your Twilio dashboard page.
public TwilioClient(String accountSid,
String authToken,
String endpoint)
accountSid - the 34 character Account identifier (starting with 'AC'). This can be found on your Twilio
dashboard page.authToken - the 32 character AuthToken. This can be found on your Twilio dashboard page.endpoint - the url of API endpoint you wish to use. (e.g. - 'https://api.twilio.com')| Method Detail |
|---|
public int getNumRetries()
public void setNumRetries(int numRetries)
numRetries - the new num retriespublic void setHttpClient(org.apache.http.client.HttpClient httpclient)
public org.apache.http.client.HttpClient getHttpClient()
public TwilioRestResponse request(String path,
String method,
Map<String,String> paramMap)
throws TwilioRestException
path - the URL (absolute w.r.t. the endpoint URL - i.e. /2010-04-01/Accounts)method - the HTTP method to use, defaults to GETparamMap - for POST or PUT, a map of data to send, for GET will be appended to the URL as querystring
params
This method is public for backwards compatibility with the old twilio helper library
TwilioRestException
public TwilioRestResponse request(String path,
String method,
List<org.apache.http.NameValuePair> paramList)
throws TwilioRestException
TwilioRestException
public InputStream requestStream(String path,
String method,
Map<String,String> vars)
path - the pathmethod - the methodvars - the vars
public InputStream requestStream(String path,
String method,
List<org.apache.http.NameValuePair> paramList)
path - the pathmethod - the methodparamList - the list of POST params
public TwilioRestResponse safeRequest(String path,
String method,
Map<String,String> vars)
throws TwilioRestException
path - the URL (absolute w.r.t. the endpoint URL - i.e. /2010-04-01/Accounts)method - the HTTP method to use, defaults to GETvars - for POST or PUT, a map of data to send, for GET will be appended to the URL as querystring params
TwilioRestException - if there's an client exception returned by the TwilioApi
public TwilioRestResponse safeRequest(String path,
String method,
List<org.apache.http.NameValuePair> paramList)
throws TwilioRestException
path - the URL (absolute w.r.t. the endpoint URL - i.e. /2010-04-01/Accounts)method - the HTTP method to use, defaults to GETparamList - for POST or PUT, a list of data to send, for GET will be appended to the URL as querystring
params
TwilioRestException - if there's an client exception returned by the TwilioApi
public TwilioRestResponse get(String fullUri)
throws TwilioRestException
request(String,
String, Map) with method "GET" and no parameters
fullUri - The full uri, including protocol://hostname/path
TwilioRestResponse the response from the query
TwilioRestException - the twilio rest exceptionpublic String getEndpoint()
public String getAccountSid()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||