Webhook没有创建,但也没有错误(Webhook not created but no error either)
我正在尝试通过Shopify API创建一个webhook。 一切似乎都很好,但我看不到在后端创建的webhook。
此外,当使用通过对API调用的响应收到的ID时,我尝试获取webhook(/
/admin/webhooks/{#id}.json
),我得到404未找到错误。这是我调用webhook的PHP代码:
$key = '123456'; $data = array('webhook' => array( 'topic' => 'orders/create', 'address' => BASEURL.'/webhook?key='.$key, 'format' => 'json' )); $webhook = $shopify->post('webhooks.json',$data); echo '<pre>'; var_dump($webhook); die();
I'm trying to create a webhook through the Shopify API. Everything seems fine, but I can't see the webhook created in the backend.
Also, when using the ID received through the response to the API call, I try fetching the webhook (
/admin/webhooks/{#id}.json
) and I get a 404 not found error.Here is my PHP code that calls the webhook:
$key = '123456'; $data = array('webhook' => array( 'topic' => 'orders/create', 'address' => BASEURL.'/webhook?key='.$key, 'format' => 'json' )); $webhook = $shopify->post('webhooks.json',$data); echo '<pre>'; var_dump($webhook); die();
原文:https://stackoverflow.com/questions/21329572
更新时间:2023-01-18 12:01