Quick Start

Good to know: A quick start guide can be good to help folks get up and running with your API in a few steps.

Get your Access key

Access key is defined for each user and can be get in user preference page

Your IP must be whitelisted before you can call API so be sure to contact us first for whitelisting

Make your first request

To make your first request, send an authenticated request to the pets endpoint. This will create a pet, which is nice.

Get Challenge

get

This endpoint is used to get a challenge token for login.

Query parameters
operationstringRequired

The operation to be performed. In this case, it should be "getchallenge".

Example: getchallenge
usernamestringRequired

The username of the user trying to get the challenge.

Example: [email protected]
Responses
200

Challenge Response

application/json
get
/webservice.php?operation=getchallenge
GET /webservice.php?operation=getchallenge?operation=text&username=text HTTP/1.1
Host: 
Accept: */*
{
  "success": true,
  "result": {
    "token": "text",
    "serverTime": "text",
    "expireTime": "text"
  }
}

Good to know: accessKey has capital K. The accessKey should be a MD5 hash of the concatenation of the token and the user access key

Login

post

This endpoint is used to login to the system. The accessKey should be a MD5 hash of the concatenation of the token and the user access key.

Body
operationstringOptional

The operation to be performed. In this case, it should be "login".

Example: login
usernamestringOptional

The username of the user trying to login.

Example: [email protected]
accessKeystringOptional

The access key for the user. This should be a MD5 hash of the concatenation of the token and the user access key.

Responses
200

Login Response

application/json
post
/webservice.php?operation=login
POST /webservice.php?operation=login HTTP/1.1
Host: 
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 66

"operation='login'&username='[email protected]'&accessKey='text'"
{
  "success": true,
  "result": {
    "sessionId": "text",
    "userId": "text",
    "version": "text",
    "vtigerVersion": "text"
  }
}

Take a look at how you might call this method using our official libraries, or via curl:

<?php
//Get challenge
<?php
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://app.abms.co/webservice.php?operation=getchallenge&[email protected]');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$output = curl_exec($ch);
$data = json_decode($output, true);
$token = $data['result']['token'];

curl_close($ch);      
print_r($output);

//Login
$accessKey = md5($token . 'your-access-key');

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://app.abms.co/webservice.php?operation=login');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, '[email protected]&accessKey=' . $accessKey);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$output = curl_exec($ch);

curl_close($ch);      
print_r($output);
?>

Last updated