d
Topic
Posts:
2
5 months ago

Can't register a webhook: Required parameter missing or invalid

Hi everyone, first time poster here. I've got a lot working with the API with no problems, but I need to register a webhook, and keep getting the "Required parameter missing or invalid" error. I've followed all of the instructions, but maybe I've missed something. 

URL: https://bil-test-store.myshopify.com/admin/webhooks.json

Method: POST

Headers: Content-Type: application/json 
X-Shopify-Access-Token: mytokengoeshere

Body: 

(Body content type application/json)

{"webhooks": 
    {
      "topic": "products/update",
      "address": "https://mysite.co/hooks/shopify/products/update",
      "format": "json"
    }
}

I can validate that the token is good, as if I change anything there I first get the error of invalid token, so it's something with a missing parameter...buy I have NO idea what I am missing. I googled around here and stackoverflow and have found no substantive answers. Any clues on what's missing??

i
Replies
Alex Richter Developer Experience
Posts:
901
5 months ago
g
1
upvotes

It looks like you have `webhook` pluralized at the top level. You're meant to be creating a single webhook, not an array of them. In this case, `webhook` is the missing or invalid required parameter.

Posts:
2
5 months ago

Ha, how did I miss that? That worked. Thank you. Hangs head in shame, walks away. 

ryanhungate Member
Posts:
11
12 days ago

I'm actually getting this as well - but not on all stores, only some... can't seem to create any webhook associations - and also injecting script tags- but let's start with this first...

{"webhook":{"topic":"customers\/create","address":"https:\/\/our_site.com\/hooks\/DYNAMIC_ID\/customers\/created","format":"json"}}

response from shopify:

{"errors":{"webhook":"Required parameter missing or invalid"}}

Is there any way to get some help on this?

 

ryanhungate Member
Posts:
11
12 days ago

@shopify - just in case you needed a ping for the above ^^ 

Alex Richter Developer Experience
Posts:
901
11 days ago

Hey there.

Can you share an x-request-id I can look at? You'll have received one in the response headers.

ryanhungate Member
Posts:
11
11 days ago

Hey Alex, thanks for responding. I was able to figure this out yesterday late... it had to do with me making requests to the actual store domain, not the 'secure_url' and the redirects not working correctly with CURL... so I think the key is to make sure that the secure url is being used at all times, not the domain. 

That would be pretty accurate right?