php-shopify
php-shopify copied to clipboard
webhook are not create dynamically
We have tried to create webhook using this library but don't show my Shopify admin panel.
Can you give more details? Please paste the way you are calling the library to create the webhook along with the response you are getting back.
$config1 = array( 'ShopUrl' => 'fine-pratical.myshopify.com', 'ApiKey' => '77a3ca1944c0fb07b5297af5d7fd6758', 'Password' => '265345e415ae645e4f25e56650efa0ae', 'SharedSecret' => '72f4acd6c1203e59b9bcfcd57c30684b' );
PHPShopify\ShopifySDK::config($config1); $shopify1 = new PHPShopify\ShopifySDK($config1);
$webhook_data = array('topic'=>'products/delete','address'=>'https://webhook.site/424723fc-3033-4b90-8826-19d2872e032a','format'=>'json'); $webhook_create = $shopify1->Webhook->post($webhook_data);
- we have used the above code.we have to get all created webhook but not getting the proper response because we have created two webhook for 6 months ago and after 15 days we have deleted this webhook.so we have to get all webhook but response gets one deleted webhook and one new webhook. how this possible?
we have used get request for below code. $webhook_get = $shopify1->Webhook->get();
Hello @shawnhind,
Any solutions and update yet?
Thanks, Keyur
@keyur45 What response you get from API while creating webhook?
Shouldn't config be the shopurl and access token?
$config = array( 'ShopUrl' => 'sub.myshopify.com', 'AccessToken' => $token, );
@keyur45 This was an issue with one of the earlier versions of the library. Instead of fetching the resource, it was fetching the instance hence the $shopify->Webhook->get() returned only one webhook. I've noticed that issue while working with one of the older versions of the library. However, this issue has been fixed in one of the latest versions and I can confirm it returns all the active webhooks now.