The trailing backslash was a BIG issue. I usually find details like that, but missed it… over and over. Thank you.
Debugging as I type this, so… rubber ducky
‘is_linked’ is gone.
user_id and channel_id were both strings, but I re-cast them anyway to be certain. (verified at jwt.io)
Now the response is {“error”:“Unauthorized”,“status”:401,“message”:“jwt token is required”}
Checked expiration. “exp” is +1 hour. (verified on jwt.io)
I have tried without base64_decodeing the secret. Same error so I changed it back.
I re-wrote the header and found two errors. No colon and no space after Authorization.
New error is {“error”:“Unauthorized”,“status”:401,“message”:“Client ID is missing”}.
Of course it’s missing. Same reason. No colon and no space: Same with Content-Type. I changed the header creation to
$headers = array(
'Authorization: '.'Bearer ' . $token,
'Client-ID: ' . SOTD_CLIENT_ID,
'Content-Type: ' .'application/json');
Problem solved and the message is being recieved by the extension.
Thank you again! This has caused me uncounted hours of grief.