Package dev.array21.espocrm.client
Class EspoApiClient
- java.lang.Object
-
- dev.array21.espocrm.client.EspoApiClient
-
public class EspoApiClient extends java.lang.ObjectA client for the EspoCRM API- Since:
- 1.0.0
-
-
Constructor Summary
Constructors Constructor Description EspoApiClient()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.lang.Stringrequest(Method method, java.lang.String action, T payload)Send a POST, PUT or DELETE request to EspoCRMjava.lang.StringrequestGet(java.lang.String action, Params params)Send a GET request to EspoCRM
-
-
-
Method Detail
-
requestGet
public java.lang.String requestGet(java.lang.String action, Params params) throws java.security.InvalidKeyException, java.io.IOException, RequestExceptionSend a GET request to EspoCRM- Parameters:
action- The action (i.e URL path)params- The parameters to use- Returns:
- Returns the JSON response
- Throws:
java.security.InvalidKeyException- Thrown only when using HMAC authorization, if the key is invalidjava.io.IOExceptionRequestException
-
request
public <T> java.lang.String request(Method method, java.lang.String action, T payload) throws java.security.InvalidKeyException, java.io.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:
java.security.InvalidKeyException- Thrown only when using HMAC authorization, if the key is invalidjava.io.IOExceptionRequestException
-
-