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??
What the OP wants to achieve is still unclear, but in purely answering the question around searching a hardcoded JSON array and returning a result, the following code shows such an example based on an "Employees" array:
Note the use of the employees array "filter" function, where we pass in an anonymous function that is capable of searching through the employees elements returning that matches ":id" passed in as a URL parameter.