Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to do shopify.Webhook.post #111

Closed
iamkhush opened this issue Sep 9, 2015 · 2 comments
Closed

Unable to do shopify.Webhook.post #111

iamkhush opened this issue Sep 9, 2015 · 2 comments

Comments

@iamkhush
Copy link

iamkhush commented Sep 9, 2015

I need to POST to /admin/webhooks.json. I use

shopify.Webhook.post('',json.dumps(json_data)) which uses _class_post which uses this url format -

'%(prefix)s/%(plural)s/%(method_name)s.%(format)s%(query)s' (_custom_method_collection_url)

However for POST request needed is '%(prefix)s/%(plural)s.%(format)s%(query)s' (_collection_path)

@gavinballard
Copy link
Contributor

You shouldn't need to be calling post() methods directly - try instantiating a new Webhook instance then calling save, something like this:

new_webhook = shopify.Webhook()
new_webhook.address = 'https://www.example.com'
new_webhook.topic = 'orders/create'
new_webhook.save()

@HumanRupert
Copy link

You shouldn't need to be calling post() methods directly - try instantiating a new Webhook instance then calling save, something like this:

new_webhook = shopify.Webhook()
new_webhook.address = 'https://www.example.com'
new_webhook.topic = 'orders/create'
new_webhook.save()

It shouldn't take a dive into Issues to find these four lines of code. This library, while powerful, is criminally under-documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants