php


can't receive webhooked data


I am trying to use webhook to receieve data from a sms service provider.the hooked URL is http://exmple.com/xy/myphp.php and my myphp.php is as follows:
<?php
$con = new mysqli("server","uname","pass","db");
error_reporting(0);
$request = $_REQUEST["data"];
$jsonData = json_decode($request,true);
foreach($jsonData as $key => $value)
{
// request id
$requestID = $value['requestId'];
$userId = $value['userId'];
$senderId = $value['senderId'];
foreach($value['report'] as $key1 => $value1)
{
//detail description of report
$desc = $value1['desc'];
// status of each number
$status = $value1['status'];
// destination number
$receiver = $value1['number'];
//delivery report time
$date = $value1['date'];
$sql="INSERT INTO `delivary_report`(`request_id`, `user_id`, `sender_id`,`date`,`receiver`,`status`,`description`) VALUES('$requestID','$userId','$senderId','$date','$receiver','$status','$desc')";
$res=$con->query($sql);
}
}
//echo $request;
?>
the sms service provider is saying that they can get 406 error. please tell me how to solve this issue. currently i am using godaddy shared server. the json formated data they are sending looks like the follows.
data=[
{
"requestId":"35666a716868323535323239",
"userId":"38229",
"report":[
{
"desc":"REJECTED",
"status":"16",
"number":"91XXXXXXXXXX",
"date":"2015-06-10 17:09:32.0"
}
],
"senderId":"tester"
},
{
"requestId":"35666a716868323535323239",
"userId":"38229",
"report":[
{
"desc":"REJECTED",
"status":"16",
"number":"91XXXXXXXXXX",
"date":"2015-06-10 17:09:32.0"
},
{
"desc":"REJECTED",
"status":"16",
"number":"91XXXXXXXXXX",
"date":"2015-06-10 17:09:32.0"
}
],
"senderId":"tester"
}
]

Related Links

PHP on some file uploads opens a blank php page instead of running the script
Display Wordpress media in a loop using the image media library title
Identifying an app's users without having registered accounts
php mysql sum by minus condition
How to connect SOAP API only using WSDL file?
Composer autoload is overriding codeigniter autoload
how to retrieve data using two while loops
Change the asset helper url in Laravel
Why does enclosed PHP not get displayed properly
password_verify always returning true
How to push items into an array where key is “specified key”?
Scheb/2factor with fosuserbundle
Creating a PHP iframe form to post data to email address as well as database table
Warning while matching RegEx in PHP [duplicate]
How to get the 0th index key values in array object
Problems navigating a php project in eclipse

Categories

HOME
elasticsearch
entity-framework
powerbi
eclipse-plugin
swi-prolog
haproxy
apk
ui-automation
msmq
elastic-load-balancer
lc3
nexus3
pm2
google-awareness
webstore
hidden
playframework-2.0
significance
spring-ldap
dashdb
generator
qa
substring
xdebug
gravity-forms-plugin
bonita
spring-annotations
ninject
guice
source-insight
vcenter
publishing
mongodb-3.4
delayed-job
rust-cargo
restful-architecture
polyml
fastlane
cartopy
sspi
extbase
python-jira
plane
apache-toree
linq-to-excel
dredd
xcglogger
entropy
test-data
msxml
ipywidgets
p6spy
adp
apache-pig-grunt
strpos
xcopy
accessibilityservice
gwt-syncproxy
taco
management-studio-express
flush
wif4.5
teensy
phpquery
textpattern
directx-9
componentart
kefir.js
webproject
shoes
mathematical-expressions
directorysearcher
operands
sunos
comctl32
image-rotation
adwords-apiv201402
siena
refit
oxygene
usb-flash-drive
smips
visual-c++-2005
mute
jquery-transit
tfs-sdk
oembed
simplecov
jquery-dialog
system-information
series-40
zend-server-ce
libxslt
cassini
tabbarcontroller
spring-modules
gtktextview
sqlsitemapprovider
stretchblt

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App