Webhook Registration Error

shingekinokyoji
Excursionist
20 1 2

I am trying to register a webhook but I get the following error:

Array
(
    [errors] => [API] Invalid API key or access token (unrecognized login or wrong password)
)

The code that I am using to try and register the webhook is as follows:

 

<?php

require_once("../includes/functions.php");

$array = array(
    'webhook' => array (
        'topic' => 'orders/paid',
        'address' => 'https://shaynhacker.com/wipay-deyah/webhooks/order_paid.php',
        'format' => 'json'
    )
);

$access_token = 'shpss_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';

$shop_url = 'deyah';

$webhooks = shopify_call($access_token, $shop_url, "/admin/api/2021-10/webhooks.json", $array, 'POST');
  

$webhooks = json_decode($webhooks['response'], true);

echo "<pre>";
        print_r($webhooks);
echo "</pre>";


?>

 

I've done this before but with a public app and it worked no problem.

Now I am trying to do this with a custom app and I getting this error.

Is there anything different you have to do with a custom app when trying to do this?

Any help would be greatly appreciated.

 

Replies 0 (0)