Quick Start
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.
This endpoint is used to get a challenge token for login.
The operation to be performed. In this case, it should be "getchallenge".
getchallengeThe username of the user trying to get the challenge.
[email protected]Challenge Response
Bad Request
GET /webservice.php?operation=getchallenge?operation=text&username=text HTTP/1.1
Host:
Accept: */*
{
"success": true,
"result": {
"token": "text",
"serverTime": "text",
"expireTime": "text"
}
}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.
The operation to be performed. In this case, it should be "login".
loginThe access key for the user. This should be a MD5 hash of the concatenation of the token and the user access key.
Login Response
Bad Request
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);
?>var axios = require('axios');
var crypto = require('crypto');
axios.get('https://app.abms.co/webservice.php?operation=getchallenge&[email protected]')
.then(function (response) {
var token = response.data.result.token;
console.log(response.data);
})
.catch(function (error) {
console.log(error);
});
var qs = require('qs');
var accessKey = crypto.createHash('md5').update(token + 'your-access-key').digest('hex');
var data = qs.stringify({
'username': '[email protected]',
'accessKey': accessKey
});
axios.post('https://app.abms.co/webservice.php?operation=login', data)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error);
});
import requests
import hashlib
response = requests.get('https://app.abms.co/webservice.php?operation=getchallenge&[email protected]')
data = response.json()
token = data['result']['token']
print(response.text)
accessKey = hashlib.md5((token + 'your-access-key').encode()).hexdigest()
data = {
'username': '[email protected]',
'accessKey': accessKey
}
response = requests.post('https://app.abms.co/webservice.php?operation=login', data=data)
print(response.text)
curl -X GET 'https://app.abms.co/webservice.php?operation=getchallenge&[email protected]'
curl -X POST 'https://app.abms.co/webservice.php?operation=login' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d '[email protected]&accessKey=calculated-access-key'Last updated