I’m having a little trouble while testing pubsub messages…
I have my JWT
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MjQxMzY2NjgsInVzZXJfaWQiOiIxNDkwMDUyMiIsInJvbGUiOiJleHRlcm5hbCIsImNoYW5uZWxfSWQiOiIxNDkwMDUyMiIsInB1YnN1Yl9wZXJtcyI6eyJzZW5kIjpbIioiXX19.L0-Naqwvk1Wy1JvhkEIBAqB5P4yruo4Z9vN-t–pluA
This was encoded from
{
“exp”:1524136668,
“user_id”:“14900522”,
“role”:“external”,
“channel_id”:“14900522”,
“pubsub_perms”: {
“send”:[“*”]
}
}
I with secret NOTE: I HAVE CHANGED SECRET
1pzn9fZGWpreCHVGC47XccGZa+JARJSqmkxKaRD4XkE=
Any time i tried calling the endpoint
https://api.twitch.tv/extensions/message/14900522
with a body of
{
“content_type”:“application/json”,
“message”:“{"ChannelId":"14900522","ChannelName":"TheChannel","LatestFollower":"TheName"}”,
“targets”:[“broadcast”]
}
It always returns “Forbidden” nothing else.
Anyone got any ideas?
I am in “Local Test” at the moment if that makes a difference!
I think you just need to escape your message–the quotes there will confuse the parser otherwise.
“{“ChannelId”:“14900522”,“ChannelName”:“TheChannel”,“LatestFollower”:“TheName”}”
If this does fix the issue, we obviously need to fix our error reporting to be more helpful.
Oh thanks, I’ll check again, see if that’s the issue
@MovingViolation thanks for the help, unfortunately that’s not it…
I thought my code escaped correctly so i checked what I had put in the forum.
The forum removes my escaping
Claire
5
I just decoded your JWT and It looks like
{
“exp”: 1524136668,
“user_id”: “14900522”,
“role”: “external”,
“channel_Id”: “14900522”,
“pubsub_perms”: {
“send”: [ “*” ]
}
}
The important detail being that channel_Id needs to be channel_id. Can you try rencoding your JWT?
yes, spotted that one too, could you try this one
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MjQxNzQxNTYsInVzZXJfaWQiOiIxNDkwMDUyMiIsInJvbGUiOiJleHRlcm5hbCIsImNoYW5uZWxfaWQiOiIxNDkwMDUyMiIsInB1YnN1Yl9wZXJtcyI6eyJzZW5kIjpbIioiXX19.oZjXGtXbG_cHThYPwVTdS8ndrs3ZpPIf7JrGdPX86ZY
this secret
jmR5bpzPYLFZMOI/0AqHKEuyfAJ2gdDSA/hbXa8UQ8E=
P.S. Currently live trying to solve this
Okay, fixed, encoding issue, secrets weren’t being handled as base64