Shopify webhook REST API is not working

ahamad786moin
Visitor
2 0 0

Hi,

I was trying to configure my webhook end-point for product/update event using a POST request to the https://<store-end-point>/admin/api/2022-01/webhooks.json with the JSON body :

{
    "webhook": {
        "topic": "products/update",
        "address": "<destination-endpoint>",
        "format": "json",
        "metafield_namespaces": [
            "my_fields"
        ]
    }
}
 
I'm getting 200 OK as response but in response body I'm not getting any meaningful data. Instead I'm getting an XML 
<html>

<body>
    <noscript>
        <a
    </noscript>

    <script type="text/javascript" defer>
        window.location = "https:\/\/accounts.shopify.com\/oauth\/authorize?client_id=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c\u0026destination_uuid=5cddf254-1d5e-4db4-a895-9a2a271455b6\u0026nonce=4428a711ae83a5a166f9b6eed6b3b142\u0026prompt=merge\u0026redirect_uri=https%3A%2F%2F.myshopify.com%2Fadmin%2Fauth%2Fidentity%2Fcallback\u0026response_type=code\u0026scope=email%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly%20openid%20profile%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fbanking.manage%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fshopify-chat.admin.graphql%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fflow.workflows.manage%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Forganization-identity.manage\u0026state=7b87f01a4fac9fcda298e97f7589ec1b\u0026ui_locales=en\u0026ux=shop";
    </script>
</body>

</html>
Moin Ahamad
Reply 1 (1)

J-ROM
Shopify Staff (Retired)
66 6 8

Hey Moin,

 

The most likely cause is that you haven't the required permissions to subscribe to that topic. I believe you'll find the next steps to unblock you in the documentation on authentication.

Cheers,
Jerome

To learn more visit the Shopify Help Center or the Community Blog.