INTRODUCTION
Kapture Provides Application Programming Interface (API) to query and update their Insightly data. Our integrating Kapture CRM API’s with all kind third-party applications ie: SAP, Oracle, Quickbooks, NetSuite, Tally ERP etc. it will customizable with any kind e-commerce, accounting, ERP, self-service portals and others. The API provides a simple, predictable, standardized, resource-oriented, RESTful interface with JSON-formatted responses to use Kapture’s features, including enquire, leads, contacts, tasks, as well as filtering and searching.
Kapture’s API is programming independent languages, it can support any kind of programming language such as Java, PHP, etc.
We embrace built-in HTTP features, so our API is easily managed with off-the-shelf HTTP clients. Every request to the Base API can be easily performed using the curl command line tool.
API Methods
- Pull requests to Search information
- Push to Add new records
- PUT to update records
- DELETE requests to remove records
- The Resources sections below include detailed samples of Request bodies and Responses
API
This API is built around open standards and secure technologies to streamline development and maintain the integrity of your data. The Kapture’s API designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. JSON will be returned in all responses from the API, including errors.
RESOURCES
Once you’re set up, you can browse through the reference library of resources and actions that we expose in the API. Each action is explained with possible parameters, sample requests and sample responses.
API LIMITS
To prevent abuse, requests to the Kapture API are rate limited. If your account is over the limit, you will get back
- This quota applies to write (e.g., insert, update, patch, and delete) requests
ESSENTIALS
- Accessing the API service should have valid permission
- All APIs will be authenticated through Auth Key, if Auth key expired will not be proceed further
CODE EXAMPLES
Kapture’s API is programming independent languages, Kapture’s API can support any kind of programming language such as Java, PHP, etc.
We have enclosed the few sample of Programming languages which can access the API’s
JAVA SAMPLE CODE
@RequestMapping("enquiry-pull-api")
public String enquiryPullApi(HttpServletRequest request, HttpServletResponse response) throws Exception {
String msg = ERROR_MESSAGE;
Gson gson = new GsonBuilder().setPrettyPrinting().create();
Map responseMap = new HashMap();
boolean isValidAuthKey = false;
try {
String authKey = request.getParameter("auth_key") != null ? request.getParameter("auth_key") : "";
String startDate = request.getParameter("start_date") != null ? request.getParameter("start_date") : "";
String endDate = request.getParameter("end_date") != null ? request.getParameter("end_date") : "";
int configurationId = WhiteLabelUtils.getInteger(request, "api_id", 0);
Timestamp sDate = DateUtils.stringToTimestampNew(startDate + " 00:00:00");
Timestamp eDate = DateUtils.stringToTimestampNew(endDate + " 23:59:59");
List cmApiConfigurationList = CMApiConfigurationBean.getCMApiConfigurationFromAuthKey(authKey);
if (cmApiConfigurationList != null) {
for (CMApiConfiguration cmApiConfiguration : cmApiConfigurationList) {
if (cmApiConfiguration != null && cmApiConfiguration.getApiType().equalsIgnoreCase(CMApiConfiguration.KEYS_MANAGEMENT)) {
isValidAuthKey = true;
}
}
}
if (isValidAuthKey) {
for (CMApiConfiguration cmApiConfiguration : cmApiConfigurationList) {
if (cmApiConfiguration.getId() == configurationId
&& cmApiConfiguration.getApiType().equalsIgnoreCase(CMApiConfiguration.ENQUIRY_PULL_API)) {
List cmEnquiries = CMEnquiryBean.getEnquiryListFromGenDate(cmApiConfiguration.getCmId(), sDate, eDate);
responseMap.put("status", "success");
responseMap.put("message", cmEnquiries);
msg = gson.toJson(responseMap);
}
}
} else {
responseMap.put("status", "failed");
responseMap.put("message", "Invalid Auth Key");
msg = gson.toJson(responseMap);
}
} catch (Exception e) {
logger.error("Error inside enquiryPullApi method ", e);
}
response.addHeader("Access-Control-Allow-Origin", "*");
response.setContentType("application/json");
try {
response.setContentLength(msg.length());
response.getWriter().write(msg);
} catch (IOException e) {
logger.error("Error while responding ", e);
}
return "";
}
PHP SAMPLE CODE
<?php
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$company=$_POST['company'];
$auth_key =$_POST['auth_key'];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://www.adjetter.com/home/example.html");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query(array('name' => $name,'email' => $email,'company_name' => $company,'phone' => $phone,'token' => $auth_key)));
// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec ($ch);
curl_close ($ch);
// echo $server_output;
?>