Answer the question
In order to leave comments, you need to log in
How can php process json request?
Hello.
I am not a php developer, and in principle a developer in any other language. Therefore, I ask for help.
The server receives a request of this type in JSON format, for example, to the address - domain.ru/alice/index.php
{
"meta": {
"locale": "ru-RU",
"timezone": "Europe/Moscow",
"client_id": "ru.yandex.searchplugin/5.80 (Samsung Galaxy; Android 4.4)"
},
"request": {
"command": "где ближайшее отделение",
"original_utterance": "Алиса спроси у Сбербанка где ближайшее отделение",
"type": "SimpleUtterance",
"markup": {
"dangerous_context": true
},
"payload": {}
},
"session": {
"new": true,
"message_id": 4,
"session_id": "2eac4854-fce721f3-b845abba-20d60",
"skill_id": "3ad36498-f5rd-4079-a14b-788652932056",
"user_id": "AC9WC3DF6FCE052E45A4566A48E6B7193774B84814CE49A922E163B8B29881DC"
},
"version": "1.0"
}
Answer the question
In order to leave comments, you need to log in
The POST request to your script will be contained in the $_POST array in php
so all you need to get the array in php is
where fieldname is the name of the variable that should be specified in the documentation from ya.dialogs
As far as I understand, this https://stackoverflow.com/questions/16700960/how-t... question is exactly the same as yours. You need to take a closer look at PHP cURL
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question