I am trying to make a call to the OpenTok API in my Angular App. I am using the following code
$http({
method: 'POST',
url: 'https://api.opentok.com/v2/project/{{apiKey}}/broadcast',
data: data,
headers: {
'Authorization':'X-OPENTOK-AUTH',
'Content-Type': 'application/json'
},
token: json_web_token
})
I have a valid json_web_token I am passing in. However whenever I try to make this call I get.
{"code":-1,"message":"No suitable authentication found"}
I am having a hard time figuring out how to set the custom X-OPENTOK-AUTH header. Can anyone tell me what is wrong with my code or does anyone have an example of a $http call being made to OpenTok?