Hey Guys,
i have problem to submitt the Authorization Bearer Token via webhooks for a webservice.
The response is allways Unauthorized
I found out, that the token miss character at the end of the token if i submit via webhooks.
here is my webhook:
{
"eventName": "MyWebHook",
"url": "https://MyUrl/api/v1/play",
"requestType": "POST",
"headers": {
"Authorization": "bearer {{my_token}}"
},
"mydevices": true
}
and the part of the firmware where i publish:
Particle.publish("MyWebHook", "{ \"my_token\": \"" + token + "\"}", 60, PRIVATE);
this is the response to get the token (Dashboard):
{"data":"{\"token\":\"vAHwdnsiaSI6IjM5ZTJjNmU5LWNiODAtNDk0ZS05NzI1LWI4ZGIzZGQ5MTk4OCIsImIiOiJkOWZhODA5ZS1mYTFhLTQ4YzMtOTNjYy1jMjc2NjliNDdiMTQiLCJ1IjoicGFydGljbGUiLCJ0IjoxNDUyMjU0ODk5LCJzAUnwQDMzMTI4MmZkYjFmNTJhOWFjOTNkMDY5ZTI0YmJmNjBiOTJiNGRkNjgzZTAwY2MxZTI2NDQ2NjcwYjExZmQ3YSJ9\",\"botId\":\"XXXXX\",\"success\":true}","ttl":"60","published_at":"2016-01-08T12:07:54.915Z","coreid":"particle-internal","name":"hook-response/getToken/0"}
i save this token in the variable token.
this is shown (Dashboard) if i publish the MyWebHook Webhook
{"data":"{
\"my_token\":
\"vAHwdnsiaSI6IjM5ZTJjNmU5LWNiODAtNDk0ZS05NzI1LWI4ZGIzZGQ5MTk4OCIsImIiOiJkOWZhODA5ZS1mYTFhLTQ4YzMtOTNjYy1jMjc2NjliNDdiMTQiLCJ1IjoicGFydGljbGUiLCJ0IjoxNDUyMjU0ODk5LCJzAUnwQDMzMTI4MmZkYjFmNTJhOWFjOTNkMDY5ZTI0YmJmNjBiOTJiNGRkNjgzZTAwY2MxZTI2NDQ2","ttl":"60","published_at":"2016-01-08T12:08:20.498Z","coreid":"XXXX","name":"MyWebHook"}
The Part: NjcwYjExZmQ3YSJ9
is missing.
i double checked the token variable. Its complete.