# Webhook (GET) registration problem if more than 1 argument

**URL:** <https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197>\
**Category:** Cloud\
**Created:** [January 18, 2016, 5:42pm UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197 "2016-01-18T17:42:49Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tahl](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tahl/32/9609_2.png) [@Tahl](https://community.particle.io/u/Tahl)\
**Post date:** [January 18, 2016, 5:42pm UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/1 "2016-01-18T17:42:49Z")

</div>

Guys,

I’m trying to register a webhook thusly:

particle webhook GET bootevent [http://someURL/ss-request.asp?action=foo&dev={{SPARK\_EVENT\_VALUE}](http://someURL/ss-request.asp?action=foo&dev=%7B%7BSPARK_EVENT_VALUE%7D)}

When it registers, action=foo makes it but dev={{\_\_\_}} doesn’t. In other words, nothing after action=foo is registered. Do I need to escape the & or something?

Thanks…

Tahl

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [January 19, 2016, 1:47am UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/2 "2016-01-19T01:47:40Z")

</div>

You will need to use a `json` file instead:

[https://docs.particle.io/guide/tools-and-features/webhooks/#query](https://docs.particle.io/guide/tools-and-features/webhooks/#query)

The command is `particle webhook create xxxxx.json`

---

<div class="post-metadata">

**Author:** ![Tahl](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tahl/32/9609_2.png) [@Tahl](https://community.particle.io/u/Tahl)\
**Post date:** [January 21, 2016, 4:44am UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/3 "2016-01-21T04:44:03Z")

</div>

Okay this doesn’t work. This is what my json file has:  
{  
“eventName”: “switchevent”,  
“url”: “[http://blahblah/thing.asp](http://blahblah/thing.asp)”,  
“requestType”: “GET”,  
“query”: {  
“action”: “ss”,  
“parm”: “{{SPARK\_EVENT\_VALUE}}”  
},  
“mydevices”: false  
}

It registers the webhook and all but it doesn’t work. If I look back to the terminal session, it repeated back the json minus the “query” parm. Did it ignore it because it’s a GET instead of a POST? I need to be able to do a GET with two parms and putting all on one line doesn’t work.

Solution?

Thanks,  
Tahl

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [January 21, 2016, 2:28pm UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/4 "2016-01-21T14:28:30Z")

</div>

You might want to share the actual json content so that we can test 🙂

---

<div class="post-metadata">

**Author:** ![Tahl](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tahl/32/9609_2.png) [@Tahl](https://community.particle.io/u/Tahl)\
**Post date:** [January 21, 2016, 4:32pm UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/5 "2016-01-21T16:32:43Z")

</div>

Actually I didn’t give the real deal for security reasons. But here’s the real deal:

{  
“eventName”: “switchevent”,  
“url”: “[http://selfstate.io:8081/ss.request-do.asp](http://selfstate.io:8081/ss.request-do.asp)”,  
“requestType”: “GET”,  
“query”: {  
“action”: “ss”,  
“parm”: “{{SPARK\_EVENT\_VALUE}}”  
},  
“mydevices”: false  
}

Thanks,  
Tahl

---

<div class="post-metadata">

**Author:** ![Tahl](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tahl/32/9609_2.png) [@Tahl](https://community.particle.io/u/Tahl)\
**Post date:** [January 21, 2016, 4:34pm UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/6 "2016-01-21T16:34:14Z")

</div>

PS. The SPARK\_EVENT\_VALUE in this case is the Device ID.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [January 21, 2016, 5:17pm UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/7 "2016-01-21T17:17:32Z")

</div>

@Tahl, just a note that with mydevices = false, you are using an event name that may be common in the public event stream. Also, I believe the documentation may be misleading but “eventName” should be just “event”.

---

<div class="post-metadata">

**Author:** ![Tahl](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tahl/32/9609_2.png) [@Tahl](https://community.particle.io/u/Tahl)\
**Post date:** [January 21, 2016, 5:19pm UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/8 "2016-01-21T17:19:59Z")

</div>

@peekay123 thanks for the info. I’ll turn the mydevices to true. And eventName to event. There is still, however, the other problem and hopefully can get a resolution.

Tahl

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [January 22, 2016, 1:30am UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/9 "2016-01-22T01:30:43Z")

</div>

Is this the actual or a typo?

> [@Tahl](#):
>
> parm

---

<div class="post-metadata">

**Author:** ![Tahl](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tahl/32/9609_2.png) [@Tahl](https://community.particle.io/u/Tahl)\
**Post date:** [January 22, 2016, 5:56pm UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/10 "2016-01-22T17:56:25Z")

</div>

No that’s the actual value

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [January 23, 2016, 3:43am UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/11 "2016-01-23T03:43:39Z")

</div>

I tried accessing the url using a browser and it’s a 404.

Have you tried opening the url and getting it to work?

---

<div class="post-metadata">

**Author:** ![Tahl](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tahl/32/9609_2.png) [@Tahl](https://community.particle.io/u/Tahl)\
**Post date:** [January 23, 2016, 6:56pm UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/12 "2016-01-23T18:56:10Z")

</div>

Hi @kennethlimcp … the GET should work … it’s used all day long. Try this line in a browser:

[http://selfstate.io:8081/ss-request-do.asp?action=ss&parm=1234](http://selfstate.io:8081/ss-request-do.asp?action=ss&parm=1234)

You should get back “Status=Error” because the 1234 is not recognized as a valid string sent from the Photon to our cloud. I see no attempt in our log yesterday or today. Give it a try. Thanks.

Tahl

---

<div class="post-metadata">

**Author:** ![Tahl](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tahl/32/9609_2.png) [@Tahl](https://community.particle.io/u/Tahl)\
**Post date:** [January 26, 2016, 1:04am UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/13 "2016-01-26T01:04:55Z")

</div>

@kennethlimcp, found anything?

Thanks,  
Tahl

---

<div class="post-metadata">

**Author:** ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)\
**Post date:** [January 26, 2016, 2:51am UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/14 "2016-01-26T02:51:24Z")

</div>

Tested working. Your previous `.json` has an error of using a dot instead of hyphen for the url.

Here’s what i used:

```auto
{
"eventName": "switchevent",
"url": "http://selfstate.io:8081/ss-request-do.asp",
"requestType": "GET",
"query": {
"action": "ss",
"parm": "{{SPARK_EVENT_VALUE}}"
},
"mydevices": false
}

```

Reply:

```auto
{"name":"switchevent","data":"1234","ttl":"60","published_at":"2016-01-26T02:49:54.993Z","coreid":"001"}
{"name":"hook-sent/switchevent","data":"undefined","ttl":"60","published_at":"2016-01-26T02:49:54.996Z","coreid":"particle-internal"}
{"name":"hook-response/switchevent/0","data":"<!DOCTYPE html>\r\n<html lang='en'>\r\n\r\n<!--============================HEADER================================-->\r\n<head>\r\n\r\n\r\n\r\n\r\n\r\n<meta http-equiv=\"Pragma\" content=\"no-cache\">\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\r\n<link rel=\"shortcut icon\" href=\"images/ss-logo-bug.ico\" />\r\n<title>SelfState - Entry</title>\r\n\r\n</head>\r\n\r\n\r\n<!--==============================BODY===============================-->\r\n<body bgcolor=\"#DFFBDF\" link=\"#75A522\" vlink=\"#75A522\" alink=\"#00FF00\">\r\n\r\nStatus=E","ttl":"60","published_at":"2016-01-26T02:49:55.199Z","coreid":"particle-internal"}
{"name":"hook-response/switchevent/1","data":"rror<br>\r\n\r\n\r\n</body>\r\n</html>\r\n\r\n\r\n\r\n\r\n","ttl":"60","published_at":"2016-01-26T02:49:55.452Z","coreid":"particle-internal"}

```

---

<div class="post-metadata">

**Author:** ![Tahl](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/tahl/32/9609_2.png) [@Tahl](https://community.particle.io/u/Tahl)\
**Post date:** [January 26, 2016, 2:59am UTC](https://community.particle.io/t/webhook-get-registration-problem-if-more-than-1-argument/19197/15 "2016-01-26T02:59:34Z")

</div>

@kennethlimcp thanks for getting back. The json that’s actually in the file is as you have above; that is, with the hyphen instead of the dot. I’ll try again and see what happens.

Thanks again.

Tahl
