Generic API
Generic API
For Interfacing
AXPERT GENERIC API
Table of Contents
1 Introduction ............................................................................................................................. 2
1.1 Purpose ............................................................................................................................. 2
1.2 Scope ................................................................................................................................ 2
2 Webservices ............................................................................................................................ 2
2.1 Login ................................................................................................................................ 3
2.1.1 Request ...................................................................................................................... 3
Request format ........................................................................................................................ 3
Response ................................................................................................................................. 4
Response format ...................................................................................................................... 5
2.2 GetIView .......................................................................................................................... 6
2.2.1 Request ...................................................................................................................... 6
Request format ........................................................................................................................ 6
2.2.2 Response ................................................................................................................... 7
Response format ...................................................................................................................... 9
2.3 SaveData......................................................................................................................... 11
2.3.1 Request .................................................................................................................... 11
Request format ...................................................................................................................... 11
2.3.2 Response ................................................................................................................. 13
Response format .................................................................................................................... 13
2.4 ChangePassword ............................................................................................................ 14
1.1.1 Request .................................................................................................................... 14
Request format ...................................................................................................................... 14
1.1.2 Response ................................................................................................................. 16
Response format .................................................................................................................... 16
AXPERT GENERIC API
1 Introduction
1.1 Purpose
This document explains about the available Axpert restful services and how to use them to
interface with axpert application.
1.2 Scope
This document is intended for users who want to consume the restful services provided by
Axpert for projects that uses the Axpert as back end.
2 Webservices
The Login should validate the username/password and return the menu information which
assigned for user.
The web service request parameter formats are mentioned into “_parameter” json array. The web service not
requires sending the “_parameter” json array from the client application.
AXPERT GENERIC API
2.1 Login
Login validates the username/password and returns either error or menu details. The current login
functionality will work as mentioned below,
2.1.1 Request
Method URL
POST https://{AxpertScriptsfolder}/ASBMenuRest.dll/datasnap/rest/TASBMenuREST/Login
Request format
{
"_parameters": [{
"login": {
"axpapp": "{projectname}",
"username": "{username}",
"password": "{md5hash}",
"seed": "1983",
"other": "Chrome"
}
}]
}
password string 50 The password uses double MD5 encryption. The logic is
MD5(seed + MD5(password))
other string 200 Anything needed record about the login session. In the web
service call from web, this column will have info about the
browser.
AXPERT GENERIC API
Response
Status Sample Response
200 Success
{
"result": {
"status": "Success",
"s": "906614.400080.110709",
"ugroup":"default",
"uroles":"default",
"globalvars": {
"m_courtname": "ACEM ,जयपरु (द्वीतीय)",
"m_courttype": "ACEM",
"hello": "Hai, Mobile WS!",
"responsibilies": "default",
"rolename": "default",
"ax_evalcopy": "F"
},
"uservars": {
},
"axmmenu": {
"row": [{
"axmpagehdrid": "13776000000000",
"menu_caption": "City Master",
"sname": "City",
"struct_type": "S",
"modifiedon": "15\/07\/2015 10:30:19 AM",
"html_view": "",
"button_param": "",
"mapview": "",
"forcecamera": "",
"geo": "F"
}]
}
}
}
200 Error
{
"error": {
"status": "Failed",
"msg": "Specified project not available"
}
}
AXPERT GENERIC API
Response format
Params Values Length Remarks
2.2 GetIView
This webservice is used to fetch the data from an Iview.
2.2.1 Request
Method URL
POST http://{AxpertWebScripts}/ASBIViewRest.dll/datasnap/rest/TASBIViewREST/getiview
Request format
{
"_parameters": [{
"getiview": {
"name": "{iviewname}",
"axpapp": "{projectname}",
"username":"",
"password":"",
"seed":"",
"s": "906614.400080.110709",
"pageno": "1",
"pagesize": "5",
"sqlpagination": "true",
"params": {
"gen": "Male"
}
}
}]
}
2.2.2 Response
Status Response
200 {
"headrow": {
"rowno": {
"hide": "false"
},
"axrowtype": {
"hide": "true",
"width": "80",
"dec": "0",
"type": "c"
},
"axp__font": {
"axp__font": "axp__fontdetails",
"hide": "true",
"width": "80",
"dec": "0",
"type": "c"
},
"citymsid": {
"citymsid": "ID",
"width": "80",
"dec": "0",
"align": "Right",
"type": "n",
"hide": "false"
},
"cityname": {
AXPERT GENERIC API
"cityname": "CITY",
"width": "125",
"dec": "0",
"align": "Left",
"type": "c",
"hide": "false"
},
"reccount": "5",
"totalrows": "16",
"datarows": "16"
},
"row": [{
"citymsid": "12662000000000",
"cityname": "New Delhi",
"pincode": "110001",
"country": "INDIA"
},
{
"citymsid": "12662000000001",
"cityname": "Mumbai",
"pincode": "400001",
"country": "INDIA"
},
{
"citymsid": "12662000000002",
"cityname": "Chennai",
"pincode": "600001",
"country": "INDIA"
},
{
"citymsid": "12662000000003",
"cityname": "Kolkata",
"pincode": "700001",
"country": "INDIA"
},
{
"citymsid": "12729000000000",
"cityname": "aaa",
"pincode": "1111",
"country": "INDIA"
}]
}
200 {
"error": {
"status": "Failed",
"msg": "Specified project not available"
}
}
AXPERT GENERIC API
Response format
Params Values Length Remarks
Columns String We will get the columns properties from this section
(JSON Pair). For each column, we added one JSON Pair.
Under this we are giving following details,
1. Column caption
2. Column width (in pixels)
3. Decimal (No of decimal places)
4. Alignment
5. Type of column data (n – numeric / c –
character / d – Datetime)
6. Hide
For example,
"citymsid": "12662000000000",
"cityname": "New Delhi",
"pincode": "110001",
"country": "INDIA"
2.3 SaveData
This web service is used for save the data into tstructs
2.3.1 Request
Method URL
POST http://{axpertwebscripts}/ASBTStructRest.dll/datasnap/rest/TASBTStruct/savedata
Request format
{
"_parameters": [
{
"savedata": {
"axpapp": "{projectname}",
"username": "",
"password": "",
"seed": "1983",
"s": "906614.400080.110709",
"transid": "{transid}",
"recordid": "0",
"recdata": [
{
"axp_recid1": [
{
"rowno": "001",
"text": "0",
"columns": {
"name": "Student Name",
"dob": "07/05/1991",
"photo": "sample.jpg",
"address": "BANGALORE",
"pincode": {
"text": "400001",
"id": "12662000000001"
}
}
}
]
}
]
}
}
]
}
2.3.2 Response
Status Response
200 {
"message": [{
"msg": "Student Master Saved",
"recordid": "13329000000000"
}]
}
200 {
"error": {
"status": "Failed",
"msg": "Specified project not available"
}
}
Response format
2.4 ChangePassword
This web service is used for change the user’s password and forget password. The process will be differentiated by
sending “service” value. Axprops table has to be configured in axpert for mailing process.
The client has to call the web service with user details and mail content. The web service will be validating the user
details and updated the latest password and it will send the mail to intimate the user.
1.1.1 Request
Method URL
POST http://{axpertwebscripts}/ASBUserRest.dll/datasnap/rest/TASBUser/ChangePassword
Request format
{
"changepassword": {
"direct": "t",
"axpapp": "{projectname}",
"service": "f",
"username": "admin",
"password": "22723bbd4217a0abf6d3e68073c7603d",
"seed": "",
"s": "996000.454333.329006",
"user": "john",
"usermailid": "john@asdf.com",
"subject": "Reset Password",
"body": {
"l0": "Hi John,",
"l1": "Your password has been changed 4141 as per your request",
"l2": "Please login immediately and change the password of your choice for security",
"l3": "Regards",
"l4": "Support Team."
},
"pwd": "22723bbd4217a0abf6d3e68073c7603d",
"changebyadmin": "yes"
}
}
password string 50 If there is a value present in the seed, the password uses
double MD5 encryption. The logic is MD5(seed +
MD5(password)). If seed is empty, it assumes the value to
be MD5(password).
1.1.2 Response
Status Response
200 {
"result": {
"status": "Success",
"msg": "Password is reset and sent to your email"
}
}
200 {
"error": {
"status": "Failed",
"msg": "Invalid Username / email"
}
}
Response format
Params Values Length Remarks