unable to create webhook with API

Solved
Highlighted
New Member
1 0 0

I created webhook from admin console and getting the output whenever i call webhook. But unable to create or get webhook from the api. 

In GET: am getting this, but i create webhook though console.

{
    "webhooks": []
}

In POST -  am sending this

{
  "webhook": {
    "topic": "customers/create",
    "address": "https://testdomain.com/",
    "format": "json"
  }
}

output - am getting 200 OK

<html>
    <body>
        <noscript>
            <a href="https://app.shopify.com/services/login/identity?destination_uuid=4396f4b2-b554-45ab-88a9-bf7da732f505&amp;return_to=https%3A%2F%2Fapp.shopify.com%2Fservices%2Flogin%2Fidentity_callback%3Fshop_name%3Ddevelopoment%26state%3DqX6mDDWTqxz7Bw20FWgPNT1HtHtVHdMIOFyKmQGFYCrX9l2_xsr150XwMUbY0z0TRaPiT65TSupUoIJSz1HCmHqH-_KxZPuR8nkCsBg23mKAYTUdIkBfjFtHtuLtPy3WBh7gDr8m-nrMsmdw_afBt31It902ABnK6pZAj9abkzjlZIm4sxkl5xUroPVHk3Y5Zv7-EvOdOT7Lko0gVWzKY05vxevb5TxZp0BNfeI1qts%253D&amp;ui_locales=en&amp;upgradeable=false&amp;ux=shop">Continue</a>
        </noscript>
        <script type="text/javascript">
      window.location = "https:\/\/app.shopify.com\/services\/login\/identity?destination_uuid=4396f4b2-b554-45ab-88a9-bf7da732f505\u0026return_to=https%3A%2F%2Fapp.shopify.com%2Fservices%2Flogin%2Fidentity_callback%3Fshop_name%3Ddevelopoment%26state%3DqX6mDDWTqxz7Bw20FWgPNT1HtHtVHdMIOFyKmQGFYCrX9l2_xsr150XwMUbY0z0TRaPiT65TSupUoIJSz1HCmHqH-_KxZPuR8nkCsBg23mKAYTUdIkBfjFtHtuLtPy3WBh7gDr8m-nrMsmdw_afBt31It902ABnK6pZAj9abkzjlZIm4sxkl5xUroPVHk3Y5Zv7-EvOdOT7Lko0gVWzKY05vxevb5TxZp0BNfeI1qts%253D\u0026ui_locales=en\u0026upgradeable=false\u0026ux=shop";
    </script>
    </body>
</html>

and webhook is not creating.

0 Likes

Success.

Shopify Staff
Shopify Staff
176 6 37

It looks like you're probably sending cookies with your POST request, which is then trying to redirect you to login.

Make sure you aren't sending cookies with your request and then it should succeed.

0 Likes
New Member
2 0 0

I was getting the same error as Above and tried removing the cookies from the postman. And tried the Create Webhook API. Now it gives the response error as 

 

Invalid API Key or Access Token. Please find the screenshot., 

 

 

Screenshot 2019-08-13 at 7.22.07 PM.pngScreenshot 2019-08-14 at 8.46.48 AM.pngScreenshot 2019-08-13 at 7.31.20 PM.png

 

0 Likes