I want to create custom API without using connectors.I want to provide my data and then want to access them in mobile through custom API.
"getLIST": {
"PendingList": [
{
"TRANSACTION_ID": "1612342887",
"TRANSACTION_STEP_ID": "2344",
"SIT_NAME": "Certificate Request",
"PERSON_ID": "3435",
"FROM_USER": "Rahul",
"STATUS": "Pending",
"FUTURE1": null,
"FUTURE2": null,
"FUTURE3": null,
"FUTURE4": null,
"FUTURE5": null
},{
"TRANSACTION_ID": "161234887",
"TRANSACTION_STEP_ID": "143234840",
"SIT_NAME": "Certificate Request",
"PERSON_ID": "3436",
"FROM_USER": "Sashanka",
"STATUS": "Pending",
"FUTURE1": null,
"FUTURE2": null,
"FUTURE3": null,
"FUTURE4": null,
"FUTURE5": null
},
]
}
If I provide above JSON payload in response,and through this custom api "/mobile/customtest/getLIST/PendingList?PERSON_ID=3435" ,can I get the details
Is it possible??
Absolutely! Follow the docs here and video here. While, yes we typically use a custom API to act as a wrapper around another service call via a connector, you don't have to do that, If you just want to return a fixed/static payload you can add that as the response to the GET call.
BUT - if you expect to search the array, etc then that is more work and should be done in a service - hence the need for a connector.
Instructions here: Add the basics (name of the API, the message media type, and a brief description).
Define an endpoint by setting a resource and at least one method for it.
Set access security.
Test your endpoint after you've defined at least one resource. To fully complete your API, use the API Designer to help you add the essential components for a robust API:
Provide the API metadata (that is, the basic attributes of the API, which are the API display name, API name, and short description) or, if you already have a RAML document that contains the configuration of your API, then you can upload it to the API Designer. All the information (metadata, resources, methods, and the schema for the message body) is extracted from the RAML document and loaded into the API Designer, letting you quickly proceed to testing your endpoints or editing your API configuration. To provide a valid RAML file, see RAML.
Add one or more root and nested resources.
Add methods to act on the resources.
Create a schema to describe the body of data.
Test your endpoints during design time with sample data and make any changes as needed.
Allow anonymous access to your API or specify which roles can access it.
Add documentation for your custom API