Search code examples
opentoktokbox

REST API Create Session Error [tokbox] or [opentok]


Getting an issue when trying to call opentok/session/create api. When calling the api through code i keep getting an error saying the connection has been closed. So I decided to try through postman and the error i'm getting back is a 500 internal server error and a message

{
    "message": "Internal server error, working hard to fix it, sorry",
    "code": -1
}

As far as I can see I have everything set correctly. Headers, Body ]

I don't think this is a JWT issue as according to the documentation that would be a 403. https://tokbox.com/developer/rest/#session_id_production

Anyone experienced this or a similar issue before


Solution

  • The issue ended up being the content Content-Type header I had to set

    Content-Type: application/x-www-form-urlencoded
    

    Credit to @adrice727's comment for suggesting there might be an issue with the Content-Type header.