Package dev.array21.espocrm.client
Class EspoApiClient
java.lang.Object
dev.array21.espocrm.client.EspoApiClient
A client for the EspoCRM API
- Since:
- 1.0.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
url
-
username
-
password
-
apiKey
-
secretKey
-
-
Constructor Details
-
EspoApiClient
public EspoApiClient()
-
-
Method Details
-
requestGet
public String requestGet(String action, Params params) throws InvalidKeyException, IOException, RequestException Send a GET request to EspoCRM- Parameters:
action- The action (i.e URL path)params- The parameters to use- Returns:
- Returns the JSON response
- Throws:
InvalidKeyException- Thrown only when using HMAC authorization, if the key is invalidIOExceptionRequestException
-
request
public <T> String request(Method method, String action, T payload) throws InvalidKeyException, IOException, RequestException Send a POST, PUT or DELETE request to EspoCRM- Type Parameters:
T- The type of payload, this will be serialized using Google's GSON- Parameters:
method- The request methodaction- The action (i.e URL path)payload- The payload to send along with the request. This will be serialized using Google's GSON- Returns:
- Returns the JSON response
- Throws:
InvalidKeyException- Thrown only when using HMAC authorization, if the key is invalidIOExceptionRequestException
-