public class AskFastRestClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ENDPOINT |
static String |
KEYSERVER_PATH |
| Constructor and Description |
|---|
AskFastRestClient(String accountId,
String refreshToken)
Creates an AskFastRestClient instance.
|
AskFastRestClient(String accountId,
String refreshToken,
String accessToken)
Creates an AskFastRestClient instance.
|
AskFastRestClient(String accountId,
String refreshToken,
String accessToken,
String endpoint)
Creates an AskFastRestClient instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
buyAdapter(String adapterId)
Buy an adapter.
|
Dialog |
createDialog(Dialog dialog)
Create a dialog.
|
String |
getAccessToken()
Returns the access token.
|
Set<Adapter> |
getAdapters(String type)
Returns a set of
Adapters, optionally narrowed down by a type. |
List<DDRRecord> |
getDDRRecords(Collection<String> adapterIds,
Collection<String> adapterTypes,
String fromAddress,
String typeId,
String status,
Long startTime,
Long endTime,
String delimitedSessionKeys,
Integer offset,
Integer limit,
Boolean shouldGenerateCosts,
Boolean shouldIncludeServiceCosts)
Returns a list of
DDRRecords based on the give
parameters. |
Dialog |
getDialog(String dialogId)
Retrieve a dialog by its id.
|
Set<Dialog> |
getDialogs()
Returns the list of dialogs.
|
Set<Adapter> |
getFreeAdapters(String adapterType,
String address) |
List<Recording> |
getRecordings()
Get all the recordings of the current accountId
|
List<Recording> |
getRecordings(String accountId)
Get all the recordings linked to the specified account.
|
String |
getRefreshToken()
Returns the refresh token
|
void |
removeAdapter(String adapterId)
Remove an adapter from the logged in account.
// TODO: describe more specifically per adapter type
|
void |
removeDialog(String dialogId)
Delete a dialog.
|
Result |
startPhoneDialog(String toAddress,
String url)
Initiate a phone call from a random call adapter.
|
Result |
startPhoneDialog(String toAddress,
String adapterId,
String url)
Initiate a phone call from a given call adapter.
|
Adapter |
updateAdapter(String adapterId,
Adapter adapter)
Updates the adapter with the given
adapterId. |
Dialog |
updateDialog(String dialogId,
Dialog dialog)
Update a dialog.
|
public static final String DEFAULT_ENDPOINT
public static final String KEYSERVER_PATH
public AskFastRestClient(String accountId, String refreshToken)
accountId - Your accountIdrefreshToken - Your refreshTokenpublic AskFastRestClient(String accountId, String refreshToken, String accessToken)
accountId - Your accountIdrefreshToken - Your refreshTokenaccessToken - The access tokenpublic AskFastRestClient(String accountId, String refreshToken, String accessToken, String endpoint)
accountId - Your accountIdrefreshToken - Your refreshTokenaccessToken - The access tokenendpoint - The endpoint, the url of API endpoint you wish to use. (The default is set to: https://api.ask-fast.com)public Result startPhoneDialog(String toAddress, String url)
toAddress - The address which will be calledurl - The url used to load the dialog. This can also be a dialogIdpublic Result startPhoneDialog(String toAddress, String adapterId, String url)
toAddress - The address which will be calledadapterId - The adapterId to initiate the call fromurl - The url used to load the dialog. This can also be a dialogIdpublic Set<Adapter> getAdapters(String type)
Adapters, optionally narrowed down by a type.type - Optional. Possible values: sms, call, email or ussdtype.public Adapter updateAdapter(String adapterId, Adapter adapter)
adapterId.adapterId - The id of the adapteradapter - The adapterpublic void buyAdapter(String adapterId)
adapterId - The id of the adapterpublic void removeAdapter(String adapterId)
adapterId - The The id of the adapterpublic Dialog createDialog(Dialog dialog)
dialog - The dialogpublic Dialog getDialog(String dialogId)
dialogId - The id of the dialogpublic Dialog updateDialog(String dialogId, Dialog dialog)
dialogId - The id of the dialogdialog - The dialogpublic void removeDialog(String dialogId)
dialogId - The The id of the dialogpublic List<Recording> getRecordings()
public List<Recording> getRecordings(String accountId)
accountId - The accountId to for which all the recordings are recorded.public List<DDRRecord> getDDRRecords(Collection<String> adapterIds, Collection<String> adapterTypes, String fromAddress, String typeId, String status, Long startTime, Long endTime, String delimitedSessionKeys, Integer offset, Integer limit, Boolean shouldGenerateCosts, Boolean shouldIncludeServiceCosts) throws Exception
DDRRecords based on the give
parameters.adapterIds - adapterTypes - fromAddress - typeId - status - startTime - endTime - delimitedSessionKeys - offset - limit - shouldGenerateCosts - shouldIncludeServiceCosts - Exceptionpublic String getAccessToken() throws Exception
null, it requests the key server to give a fresh token.Exception - Thrown when refreshing the access token if the accountId or refreshToken is nullpublic String getRefreshToken()
Copyright © 2015 AskFast BV. All rights reserved.