Webhook with UTF-8 data

Hi there,
so, i created a webhook with the following data:

{
  "eventName": "SparkKatzi",
  "url": "https://api.ciscospark.com/v1/messages",
  "requestType": "POST",
  "headers": {
    "Authorization": "Bearer xxx",
    "Content-Type": "application/json;charset=UTF-8"
 },
  "query": {
	"text": "\uD83D\uDC31",
	"toPersonEmail": "xxx@xxx.yyy"
	},
  "mydevices": true,
  "noDefaults": true
}

in the text field i am trying to set unicode Bytes to send an emoji. The publish and webhook works ok, but the text gets changed to:

anything i can do to make this pass raw?

Try escaping the backslash as \\ or ]

1 Like

thanks
not quite working for me
using \ is resulting in that being send in the webhook, \ results in \ being send in the json to the service.
any more ideas?

Do � and � do any better?

still very much the same thing :frowning:

Ping @Dave :wink:

1 Like

Ooh, that’s a tricky one! I think all JSON is essentially UTF8 encoded by default, so if you were passing it in the body that’d be easier, but in the query string… Hmm.

Maybe saving the actual UTF8 byte value instead of the long-form representation, or percent encoding it, but I’m not sure. I’ll think about this when I get a chance and see if I can offer a better solution. :slight_smile:

Thanks,
David

actually, that was the hint i needed
i was being an idiot. Now that i changed it to json instead of query, i can do it straight away.
“json”: {
“text”: “\uD83D\uDC31”,
“toPersonEmail”: “abc@xxx.yyy”
},

instead of query and now my emojis are going through to cisco spark. Awesome, thanks!

oh nice! Glad that helped. :slight_smile:

Thanks,
David