Soft1 Web Services reference

Web Services
login authenticate changePassword getObjects
getObjectTables getTableFields getDialog getFormDesign
getBrowserInfo getBrowserData getReportInfo getReportData
getData setData calculate delData
getSelectorData selectorFields SqlData .

Hints

			
On successful installation the URL address for calls is:
    http://[Registered Name or Serial Number].oncloud.gr/s1services
example :
    http://demo.oncloud.gr/s1services
	 
If you call:
    http://[Registered Name or Serial Number].oncloud.gr/s1services?ping
you have to see the following message:
    Ping from Softone WebModule
    ISAPI is working - Module configured
    Running in TCP mode [127.0.0.1:22099 Connected]
	
Also :
  1. In the Web Accounts there should be or you have to open an account for a Web Service (AppID).
  2. Call the login service with account details (UserName, Password, AppID) 
  3. Call the authenticate service with the cliectID, company, branch,etc from the login call.
  4. Call any other service, using the cliectID from the authenticate service.
		

login

To authenticate the web login account (Web Account -> UserName, Password) for a web service. Returns the possible login selections together with a temporary key (clientID) for using the "authenticate" function

Request

{
  "service": "login",
  "username": "john",
  "password":"aitis",
  "appId": "2001"
}

Response

{
    "success": true,
    "clientID": "Wj8T3tvs...  ...tlrT8",	
    "objs": [
        {
            "COMPANY": "1000",
            "COMPANYNAME": "Demo Company SA",
            "BRANCH": "1000",
            "BRANCHNAME": "Athens",
            "MODULE": "0",
            "MODULENAME": "Center",
            "REFID": "1",
            "REFIDNAME": "Administrator"
        }
    ]
}

authenticate

Access to the application with selected login data. Returns the code (clientID), needed for all subsequent calls.

Request

{
    "service": "authenticate",
    "clientID": "Wj8T3tvs...  ...tlrT8",	
    "COMPANY": "1000",
    "BRANCH": "1000",
    "MODULE": "0",
    "REFID": "1"
}

Response

{
    "success": true,
    "clientID": "Wj8Te8EqWghDM.........   .....wYGtzlyc1At%2bPrG8t"
}

changePassword

Change web user login password

Request

{
    "service": "changePassword",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OLD": "aitis",
    "NEW": "aidalxa"
}

Response

{
    "success": true
}

getObjects

Returns all application Business Objects

Request

{
    "service": "getObjects",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001"
}

Response

{
    "success": true,
    "count": 1354,
    "objects": [
...
        {
             "name": "CUSTOMER",
            "type": "EditMaster",
            "caption": "Customers"
        },
...

getObjectTables

Returns all tables of a specific Business Object

Request

{
    "service": "getObjectTables",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OBJECT": "CUSTOMER"	
}

Response

{
    "success": true,
    "count": 10,
    "tables": [
        {
            "name": "CUSTOMER",
            "dbname": "TRDR",
            "caption": "Customers",
            "filltype": "SQL"
        },
        {
            "name": "CUSEXTRA",
            "dbname": "TRDEXTRA",
            "caption": "Extra customer data",
            "filltype": "SQL"
        },
...

getTableFields

Returns all fields of a specific table of a specific application Business Object

Request

{
    "service": "getTableFields",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OBJECT": "CUSTOMER",
    "TABLE":"CUSTOMER"	
}

Response

{
    "success": true,
    "count": 136,
    "fields": [
        {
            "name": "SODTYPE",
            "alias": "",
            "fullname": "CUSTOMER.SODTYPE",
            "caption": "Domain",
            "size": "2",
            "type": "Smallint",
            "edittype": "Simple",
            "defaultvalue": "",
            "decimals": "",
            "editor": "",
            "readOnly": true,
            "visible": false,
            "required": true,
            "calculated": false
        },
        {
            "name": "TRDR",
            "alias": "",
            "fullname": "CUSTOMER.TRDR",
            "caption": "Customer",
            "size": "4",
            "type": "AutoInc",
            "edittype": "Simple",
            "defaultvalue": "",
            "decimals": "",
            "editor": "",
            "readOnly": true,
            "visible": false,
            "required": true,
            "calculated": false
        },
        {
            "name": "CODE",
            "alias": "",
            "fullname": "CUSTOMER.CODE",
            "caption": "Code",
            "size": "25",
            "type": "String",
            "edittype": "Simple",
            "defaultvalue": "",
            "decimals": "",
            "editor": "",
            "readOnly": false,
            "visible": true,
            "required": true,
            "calculated": false
        },
...

getDialog

Returns all fields from a specific browser or report dialog, together with their presentation format.

Request

{
    "service": "getDialog",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OBJECT": "CUSTOMER",
    "LIST":""	
}

Response

{
    "success": true,
    "title": "Customers",
    "form": [
        {
            "xtype": "s1cont",
            "items": [
                {
                    "xtype": "s1fields",
                    "flex": 0.50,
                    "items": [
                        s1Editor("0;TRDR.CODE;From code;;;1;0;1;1;0;")
                    ]
                },
...

getFormDesign

Returns the tables and fields of a specific Business Object with their presentation format

Request

{
    "service": "getFormDesign",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OBJECT": "CUSTOMER",
    "FORM":""	
}

Response

{
    "success": true,
    "model": {
...
    "form": [
...

getBrowserInfo

Executes a browser and returns a reference code (reqID) for this, together with the browser fields, the number of records and the columns of the browser

Request

{
    "service": "getBrowserInfo",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OBJECT": "CUSTOMER",
    "LIST":"",
    "FILTERS":"CUSTOMER.CODE=30*&CUSTOMER.AFM=046156989&.....",
}

Response

{
    "success": true,
    "formDesign": "CUSTOMER",
    "reqID": "1558138811436159279",
    "totalcount": 1,
    "fields": [
        {
            "name": "ZOOMINFO",
            "type": "string"
        },
        {
            "name": "CUSTOMER.CODE",
            "type": "string"
        },
...
    ],
    "columns": [
        {
            "dataIndex": "CUSTOMER.CODE",
            "header": "Code",
            "width": 120,
            "sortable": true
        },
...

getBrowserData

Returns limited (LIMIT) number of records from the browser with reference code (reqID) starting from record START.

Request

{
    "service": "getBrowserData",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "reqID": "1558138811436159279",
    "START": 0,
    "LIMIT": 20
}

Response

{
    "success": true,
    "totalcount": 1,
    "rows": [
        [
            "CUSTOMER;47",
            "1",
            "100",
            "Soft One Technologies S.A.",
            "999863881",
            "6 Poseidonos street",
            "Kallithea",
            "17674",
            "+302109484797",
            "+302108889999",
            "9484094",
            "www.softone.gr"
        ]
...

getReportInfo

Executes the report and returns a reference code for this report (reqID), together with the number of pages.

Request

{
    "service": "getReportInfo",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OBJECT": "CUST_ADDR_BOOK",
    "LIST":"",
    "FILTERS":"CUSTOMER.CODE=30*;CUSTOMER.AFM=046156989;.....",
}

Response

{
    "success": true,
    "reqID": "1148974355437296839",
    "npages": 1
}

getReportData (GET)

Returns in HTML format the report page PAGENUM from the report with reference code (reqID).

Request

{
    "service": "getReportData",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "reqID": "1558138811436159279",
    "PAGENUM": 1
}

Response

[HTML DATA]

getData

Returns all data (or the selected ones from LOCATEINFO) of a record of a Business Object.

Request

{
    "service": "getData",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OBJECT": "CUSTOMER",
    "FORM":"",
    "KEY":47,
    "LOCATEINFO":"CUSTOMER:CODE,NAME,AFM;CUSEXTRA:VARCHAR02,DATE01"
}

Response

{
    "success": true,
    "readOnly": true,
    "data": {
        "CUSTOMER": [
            {
                "CODE": "100",
                "NAME": "Soft One Technologies S.A.",
                "AFM": "999863881"
...

setData

Insert or Modify the data of a record in a Business Object identified by a KEY. If the KEY is empty or missing a record is inserted.

Request

{
    "service": "setData",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OBJECT": "CUSTOMER",
    "KEY": "47",
    "data": {
        "CUSTOMER": [
            {
                "CODE": "100",
                "NAME": "Soft One Technologies S.A.",
                "AFM": "999863881",
                "IRSDATA": "IV Athens",
                "EMAIL": "johng@softone.gr",
                "WEBPAGE": "www.softone.gr",
                "PHONE01": "+302109484797",
                "PHONE02": "+302108889999",
                "FAX": "9484094",
                "ADDRESS": "6 Poseidonos street",
                "ZIP": "17674",
                "DISTRICT": "Kallithea",
                "DISCOUNT": 10,
                "REMARKS": "Hello World!"
            }
        ],
        "CUSEXTRA": [
            {
                "VARCHAR01": "Extra 1",
                "VARCHAR02": "Extra 2"
            }
        ]
    }
}

Response

{
    "success": true,
    "id":"47"
}

calculate

Calculates and Returns (or the selected ones from LOCATEINFO) of a record of a Business Object for which we input or modify data. It doesn’t cause any modifications, only calculations like manual input.

Request

{
    "service": "calculate",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OBJECT": "CUSTOMER",
    "KEY": "47",
    "LOCATEINFO":"CUSTOMER:CODE,NAME,AFM;CUSEXTRA:VARCHAR02,DATE01"
    "data": {
        "CUSTOMER": [
            {
                "CODE": "100",
                "NAME": "Soft One Technologies S.A.",
                "AFM": "999863881",
                "IRSDATA": "IV Athens",
                "EMAIL": "johng@softone.gr",
                "WEBPAGE": "www.softone.gr",
                "PHONE01": "+302109484797",
                "PHONE02": "+302108889999",
                "FAX": "9484094",
                "ADDRESS": "6 Poseidonos street",
                "ZIP": "17674",
                "DISTRICT": "Kallithea",
                "DISCOUNT": 10,
                "REMARKS": "Hello World!"
            }
        ],
        "CUSEXTRA": [
            {
                "VARCHAR01": "Extra 1",
                "VARCHAR02": "Extra 2"
            }
        ]
    }
}

Response

{
    "success": true,
    "readOnly": true,
    "data": {
        "CUSTOMER": [
            {
                "CODE": "100",
                "NAME": "Soft One Technologies S.A.",
                "AFM": "999863881"
...

delData

Deletes the record of a Business Object.

Request

{
    "service": "delData",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "OBJECT": "CUSTOMER",
    "FORM":"",
    "ΚΕΥ":47
}

Response

{
    "success": true,
}

getSelectorData

Returns the data from a Selector of the application.

Request

{
    "service": "getSelectorData",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "EDITOR": "1|TRDR|TRDR|SODTYPE=13 AND ISPROSP='0'|",
    "VALUE": "30*"
}

Response

[
    [
        "40",
        "30.001",
        "SoftOne SA",
        "999863881"
    ],
    [
        "41",
        "30.145",
        "Peter Smith",
        "073586841"
    ],
    [
        "42",
        "30.102",
        "Golden Foods SA",
        ""
    ],
    [
        "43",
        "30.103",
        "Holding SA",
        ""
...

selectorFields

Returns that data of the fields of a specific tables

Request

{
    "service": "selectorFields",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "TABLENAME": "CUSTOMER",
    "KEYNAME": "TRDR",
    "KEYVALUE":47,
    "RESULTFIELDS":"CODE,NAME,AFM"
}

Response

{
    "success": true,
    "totalcount": 1,
    "rows": [
        {
            "CODE": "100",
            "NAME": "Soft One Technologies S.A.",
            "AFM": "999863881"
        }
    ]
}

SqlData

Execute the SQL with code 'SqlName' from 'SQL Scripts' and get the result data.
Params in the SQL Script are declared as follows: ... AND CODE like '{param1}' AND ...

Request (ver >= 4.00.515.10762)

{
    "service": "SqlData",
    "clientID": "Wj8T3tvs...  ...tlrT8",
    "appId": "2001",
    "SqlName": "myItems",
    "param1" : "1000%"
}

Response

{
    "success": true,
    "totalcount": 9,
    "rows": [
        {
            "MTRL": "1191",
            "CODE": "10001",
            "NAME": "Τηλεόραση LCD 32\"",
            "PRICEW": "900",
            "PRICER": "900"
        },
        {