Webhook Create Failure / Address Weirdness

214 views
Skip to first unread message

Jerod Santo

unread,
Oct 3, 2012, 1:07:26 PM10/3/12
to shopify-a...@googlegroups.com
I am trying to create a Webhook via the Ruby gem and I'm getting conflicting failure errors.

The first time through:

ShopifyAPI::Webhook.create(topic: "products/update", address: "http://example.com", format: "json")

This fails with: @messages={:address=>["is not allowed"]}

The second time through, sans address:

ShopifyAPI::Webhook.create(topic: "products/update", format: "json")

This fails with: @messages={:address=>["can't be blank"]}

I would definitely expect address to be required, so maybe I'm not formatting the address properly and the "is not allowed" error message is too vague for me to be sure?

Any help would be much appreciated!

Dennis Theisen

unread,
Oct 3, 2012, 1:39:58 PM10/3/12
to shopify-a...@googlegroups.com
Can't use example.com, simple as that :)

If you use a "real" host it should work as expected.

Cheers, Dennis

--
 
 
 

Christopher Saunders

unread,
Oct 3, 2012, 1:41:35 PM10/3/12
to shopify-a...@googlegroups.com
This is a *really* good question to place on stack overflow.  While I'll give you the answer, if you could copy-pasta it over to SO that would be fabulous!

I believe we have a blacklist of naughty domains, some of those include localhost and example.com

If you're looking to test the webhooks, use a proxy service and pass in that domain as your webhook url.

--
 
 
 

David Underwood

unread,
Oct 3, 2012, 1:55:14 PM10/3/12
to shopify-a...@googlegroups.com
With regard to proxy services, give this article a read for some examples: http://www.shopify.com/technology/3931292-webhook-testing-made-easy

-David Underwood
 Developer Advocate, Shopify

--
 
 
 

David Underwood

unread,
Oct 3, 2012, 2:14:40 PM10/3/12
to shopify-a...@googlegroups.com
For anyone interested in the full list of banned domains for webhook subscriptions, here's the array of regexes we use:

[/^(127|192|10|0)\./, /localhost/, /^(\w+\.)*internal$/, /^(\w+\.)*(example|shopify|myshopify)\.com$/]

Jerod Santo

unread,
Oct 3, 2012, 2:44:20 PM10/3/12
to shopify-a...@googlegroups.com
Thanks everybody. That helps.

One suggestion would be to return a more helpful error message, e.g. - "blacklisted domain" instead of simply "is not allowed".
--
 
 
 

Reply all
Reply to author
Forward
0 new messages