How to make a JSON response with url endpoint from a third party site
I have a problem syncing data from another site to my site with a JSON response. I got documentation from another site to direct some data to my site. The documentation states if I should create a URL endpoint and make a JSON response to get the data. This is the JSON response format I got from the documentation:
{
"id": INTEGER, // Confirmation Number
"type": STRING, // "new" or "update" or "cancel"
"data": OBJECT // data element
}
In this case, my site uses a structure Codeigniter
. Who do I want to ask how to make this JSON response on my site? I have already created some function in the Controller
following way:
function json_response()
{
}
And I don't know what codes I should insert into Controller
. Thank.
+3
source to share