◷ Reading Time: 6 minutes
We have learned how to deploy a service as AWS Lambda. Now let’s see how to access the services.
Get Service Details Using Services URL
To demonstrate how to retrieve service information, we will be using Postman. But you can use any API testing tool for this.
Retrieve All the Available Services
You can use the Services URL to get the list of available services along with their details. For example, if your package has three services, you can retrieve the service details of all three services.

Request
- URL: <Services URL>
e.g. https://18br5c5kf2.execute-api.us-west-2.amazonaws.com/Prod/Services/?code=oxOMlZI/SEegllHhVJbmyOeVXEGIfKnIGFiCp/ODbs0dqPTA/eUgF7yoPJst7vxPk9qloFym0kLJYVZxxLIMEQ== - Request type: GET
Response
[
{
"packageId": "fda5255b65484b9ca2fb9eef0b39e779",
"packageName": "age-service",
"serviceName": "person_growing_state",
"serviceId": "7763bdfbdf7f4e8c9a8b50288aa45d18",
"packageVersion": "1",
"serviceVersion": "1",
"packageUri": "/fda5255b65484b9ca2fb9eef0b39e779/7763bdfbdf7f4e8c9a8b50288aa45d18/decision.function.frdp",
"parameters": {
"href": "/Services/age-service/1/person_growing_state/1"
},
"execute": {
"href": "/Execute/age-service/1/person_growing_state/1"
}
},
{
"packageId": "fda5255b65484b9ca2fb9eef0b39e779",
"packageName": "age-service",
"serviceName": "person_growing_state",
"serviceId": "70b88c070aa84511a148460a8b663511",
"packageVersion": "1",
"serviceVersion": null,
"packageUri": "/fda5255b65484b9ca2fb9eef0b39e779/70b88c070aa84511a148460a8b663511/decision.function.frdp",
"parameters": {
"href": "/Services/age-service/1/person_growing_state"
},
"execute": {
"href": "/Execute/age-service/1/person_growing_state"
}
}
]
Retrieve Information on Input
You can retrieve further information on the input data structure, entry URI, and concept.

Request
- URL: <Replace Services Uri /Services part with the service’s parameters.href value of its response>
e.g. https://nd2n7dbvf7.execute-api.us-west-2.amazonaws.com/Prod//Services/age-service/1/person_growing_state/1?code=ifaC9S3fGN8jZYhnaB+1WGOx1qGRoXi3basxEhydNVZKyCcHQ6ByzA04ZO58Y6EO6IiAEWzVOWQTPwBpCO+kaw== - Request type: GET

Response
In this response, we can see that the
[
{
"name": "person",
"direction": "InOut",
"assembly": "PersonConcept.xml",
"type": "Person",
"concept": {
"filename": "PersonConcept.xml",
"types": [
{
"name": "Person",
"type": "Fact",
"members": [
{
"name": "Age",
"type": "int"
},
{
"name": "Title",
"fact": "Title"
}
]
},
{
"name": "Title",
"type": "Option",
"members": [
{
"name": "Infant"
},
{
"name": "Kid"
},
{
"name": "Teen"
},
{
"name": "Young"
},
{
"name": "Adult"
},
{
"name": "Immortal"
}
]
}
],
"namespace": "Samples"
}
}
]
You may also opt to retrieve the swagger specification by using the swagger endpoint.
Execute the Service
Using the Execute Url, we can execute the service and retrieve output from our AWS Lambda deployed in AWS.

Request
- URL: <Execute Url>
e.g. https://nd2n7dbvf7.execute-api.us-west-2.amazonaws.com/Prod/Execute/age-service/1/person_growing_state/1?code=o5FnUklE0O4mLqp87hIShGP8MuS3pbyrRCdjNuZrq/360e0h0m1bYg9sxvjrCDPbcpkkQ9EMVeByFk8i8drVPA== - Request type: POST
- Body: <input of your service>
Response
It will run the app deployed in AWS, and provide the results accordingly. In this example, since we entered 50 as the age, it returned ‘Adult 2’ as the title. In the decision table, you can see that we have defined the age group 39-99 as ‘Adult’.
The invocationId is generated as {RequestId}.{RunId}
where the RequestId
comes from the cloud platform for the function, and RunId
comes from FlexRule engine executing a specific request.
{
"isCanceled": false,
"invocationId": 546dddf8-176e-48c7-a3ee-588ed2c6de69.4b252c38-0d8b-415a-bb4e-06b4cf432cb3",
"elapsed": "00:00:01.4600337",
"outputs": [
{
"name": "person",
"value": "{\"Age\":50,\"Title\":\"Adult 2\"}"
}
]
}
Checking your API in AWS Console
On your AWS Console API page, you will see all APIs created by FlexRule through AWS Lambda deploy.

The code as seen in the Execute and Service URLs are to be found in Lambda page of the AWS Console.
