bigcommerce の Webhook に接続しようとしていますが、エラーが表示されますが、それは理解できません。
何か案は?
JSON::ParserError at /token
https://developer.bigcommerce.com/docs/api/webhooks/event_triggers https://developer.bigcommerce.com/docs/api/webhooks/quickstart
<?php
//set POST variables
$url = 'https://hooks-beta.bigcommerce.com/token';
$fields = array(
"client_id"=>"client_id_goes_here",
"client_secret"=>"client_secret_goes_here",
"user"=>"demo",
"token"=>"token_goes_here",
"store_domain"=>"https://domain_goes_here.mybigcommerce.com/api/v2"
);
//open connection
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$result = curl_exec($ch);
if ($result === false) {
echo '<textarea>'.curl_error($ch).'</textarea>';
} else {
echo "<textarea>".$result."</textarea>";
}
curl_close($ch);
?>