...
How to Create Service Data Object
...
Name: Name given is genrally identical to name of database Object.it is used to accessing service data object.
SQL: it is SQL Object that should be executed. Here you can pass SQL query or any stored procedure name available in database.
Enable Application Filter: if we select enable application filter it will restrict to use SDO to a particular service application. If selected enable application filter option then we need to add alteast one Service Application on Application tab.
...
Enable Security: if you want to apply security you can select enable security option. If selected it will restrict the use of SDO to selected users, groups and web groups. So as to apply security we need to add atleast one record on security Tab.
If database object (Stored Procedure, SQL) require parameters then we need to add each parameter in parameter tab.
Finally you need to save the record to create Service Data Object. You can call it by Aptify Services API or via http request to Aptify Javascript API.
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
End Point
Cached? | Yes |
---|
Service Data Object uses GET action. parameter defined for the object.
Code Block |
---|
https://<service base>/services/DataObjects/<Service DataObject Name> |
...
Parameters defined in SDO object need to append as query string. Parameters should be same
Code Block |
---|
https://<service base>/services/DataObjects/spGetCompanyAccountSummary<Service DataObject Name>?ParameterName1=value1&ParameterName2=Value2.... |
Headers
In order to receive search results, you must send the AptifyAuthorization header.
Header Name | Header Value |
---|---|
AptifyAuthorization | <AuthType> <TokenId> |
Sample End Point
Following example illustrate how to execute "spGetCompanyAccountSummary" stored procedure as end point
Code Block |
---|
https://<service base>/services/DataObjects/spGetCompanyAccountSummary |
For the Above sample End point expect two parameters which are defined in Web service Application.The parameters are CompanyId and Convermulticurrency.
Parameters
Parameter | Query Param? | Description | Example |
---|---|---|---|
CompanyId | Yes | ID of Company | 10 |
Convertmulticurrency | false | Boolean value represent Convert Multi currency | false |
Here is sample data from Company Entity
Code Block | ||
---|---|---|
| ||
https://<service base>/services/DataObjects/spGetCompanyAccountSummary?CompanyID=10&Convertmulticurrency=false |
Sample Response
...
Body
The search results are represented as a JSON array of JSON objects, where each object contains record data. The properties of the objects will be some of the fields of the record, always including the ID and Name field.
Here is sample result for above spGetCompanyAccountSummary data object.
Code Block | ||
---|---|---|
| ||
{ "dataObjectName":"spGetCompanyAccountSummary", "results": [ { "OrderTotal":39414.6200, "PaymentTotal":4407.2000, "BalanceTotal":35007.4200 } ] } |