...
Let's look at a sample endpoint definition and break down the parts. We'll go into each part in greater detail on other pages.
Code Block |
---|
language | js |
---|
title | CountryEndpoint.json |
---|
linenumbers | true |
---|
| {
"endpoints": {
"getAllCountries": {
"route": {
"httpMethod": "GET",
"segments": {
"Countries": {
"isLiteral": true,
"type": "string"
}
}
},
"inputEntityDefinition": null,
"outputEntityDefinition": {
"isCollection": true,
"name": "Country",
"fields": {
"id": {
"type": "long"
},
"country": {
"type": "string"
},
"ISOCode": {
"type": "string"
}
}
},
"businessLogic": {
"allCountriesRetrieval": {
"executionType": "processFlow",
"processFlowProperties": {
"processFlowName": "Execute Data Object",
"processFlowParameters": {
"DataObjectName": "spGeteBusiness6_0CountryList"
}
}
}
},
"security": {
"AllowAnonymous": {
"type": "AllowAnonymous"
}
}
}
}
} |
|
---|
|
Code Block |
---|
|
All Endpoint.json files have a single 'endpoints' block. Its children are the end points we're defining.
Here we have one endpoint named 'getAllCountries' and we see its 5 parts: route, input, output, business logic and security.
This end point accepts no input.
The output for this end point is a collection of objects with fields for the id, country, and ISO code.
This end point executes a single process flow that calls a database object. The output from that process flow will be translated into
the output entity definition.
Anyone is allowed to call this end point. By default all end points require authentication. |
|
---|
Info |
---|
|
Aptify will take the metadata in the JSON files and generate code that exposes the desired endpoint. By default, controllers are compiled in a random directory within the Windows temp directory. After compilation the output (cs, dll, and pdb) is copied into the bin directory. If problems arise with using the Windows temp directory this can be overridden by specifying a different path in the application setting 'Aptify.Services.TempDirectory' in web.config. All generated files end with the name 'GeneratedController.<fileExtension>'. Metadata files are examined during application startup. If they are newer than the output files in the bin directory they will be regenerated. |
...
Attached please find a set of sample JSON calls for e-Business services (filename: Ebiz6EndpointsCollection.zip)
View file |
---|
name | Ebiz6EndpointsCollection.zip |
---|
height | 250 |
---|
|