Package com.netlang.limecrm
Class NLimeClient
java.lang.Object
com.netlang.net.NHttpClient
com.netlang.net.NRestClient
com.netlang.limecrm.NLimeClient
- All Implemented Interfaces:
AutoCloseable
REST Client for communicating with LIME CRM systems
NLimeClient limeCrm1 = new NLimeClient("https://example.com/my_app/api/v1/","THE_API_KEY");
List<NLimeCompany> companies1 = limeCrm1.listCompanies();
limeCrm1.close();
-
Field Summary
Fields inherited from class com.netlang.net.NHttpClient
TYPE_API_KEY, TYPE_TOKEN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()ClosecreateCompany(NLimeCompany company) Create a new companyorg.json.JSONObjectcreateObjectFromJson(String objectType, org.json.JSONObject object) createPerson(NLimePerson person) booleanbooleanexists(org.json.JSONObject queryObj) getCompany(long id) Endpoint: /company/{id}/org.json.JSONObjectgetObjectAsJson(String objectType, long id) Endpoint: /{objectType}/{id}/longgetObjectId(org.json.JSONObject queryObj) getPerson(long id) Endpoint: /person/{id}/getUrl()List all companies with LIMEorg.json.JSONArraylistDeals(long companyId) Endpoint: /company/{id}/deal/listPersons(long companyId) Endpoint: /company/{id}/person/static voidupdateCompany(NLimeCompany company) org.json.JSONObjectupdateObjectFromJson(String objectType, long id, org.json.JSONObject object) updatePerson(NLimePerson person) Methods inherited from class com.netlang.net.NRestClient
deleteAsJson, getAsArray, getAsArray, getAsArray, getAsArray, getAsJson, getAsJson, getAsJson, getAsJson, getAsObject, getAsObject, getAsObject, getAsObject, getGetAsArray, makeObject, patch, patch, patchAsObject, patchAsObject, patchAsObject, patchAsObject, patchJson, patchJson, patchJsonGetArray, patchJsonGetArray, patchJsonGetEmpty, patchJsonGetEmpty, post, post, postAsObject, postAsObject, postAsObject, postAsObject, postJson, postJson, postJsonGetArray, postJsonGetArray, postJsonGetEmpty, postJsonGetEmpty, putGetAsArray, putGetAsArray, putGetAsJson, putGetAsJson, putGetAsJson, putGetAsObject, putGetAsObject, putGetAsObject, putJson, putJson, putJsonGetArray, putJsonGetArray
-
Constructor Details
-
NLimeClient
- Parameters:
baseUrl- - https://example.com/my_app/apiKey- - "x-api-key: ABC123"
-
-
Method Details
-
main
-
listCompanies
List all companies with LIME- Returns:
- Throws:
Exception
-
getCompany
Endpoint: /company/{id}/- Parameters:
id-- Throws:
Exception
-
getPerson
Endpoint: /person/{id}/- Parameters:
id-- Throws:
Exception
-
updateCompany
- Parameters:
company-- Returns:
- Throws:
Exception
-
createCompany
Create a new company- Parameters:
company-- Returns:
- Throws:
Exception
-
listDeals
Endpoint: /company/{id}/deal/- Parameters:
limit-- Returns:
- Throws:
Exception
-
listPersons
Endpoint: /company/{id}/person/- Parameters:
limit-withCoworker-- Returns:
- Throws:
Exception
-
updatePerson
- Throws:
Exception
-
createPerson
- Throws:
Exception
-
getObjectAsJson
Endpoint: /{objectType}/{id}/- Parameters:
id-- Throws:
Exception
-
createObjectFromJson
public org.json.JSONObject createObjectFromJson(String objectType, org.json.JSONObject object) throws Exception - Throws:
Exception
-
updateObjectFromJson
public org.json.JSONObject updateObjectFromJson(String objectType, long id, org.json.JSONObject object) throws Exception - Throws:
Exception
-
exists
- Throws:
Exception
-
exists
- Throws:
Exception
-
getObjectId
- Throws:
Exception
-
getUrl
-
close
public void close()Description copied from class:NHttpClientClose- Specified by:
closein interfaceAutoCloseable- Overrides:
closein classNHttpClient
-