'Unable to pass agora RESTfulAPI cloud recording authorization
I'm trying to implement agora cloud recording.
When trying to get the resource id from the RESTfulApi - I'm getting a 401 error (unauthorized). The credentials (key and secret) are ok.
The code is a conversion from node.js to Angular/Typescript. What am I doing wrong?
const authorization = "Basic " + (`${customerKey}:${customerSecret}`)
let response = this.appService.http.post(`https://api.agora.io/v1/apps/${agoraAppId}/cloud_recording/acquire`, {
"cname": sessionId,
"uid": hostUid,
"clientRequest": {
"resourceExpiredHour": 24
},
header: new Headers({
'Authorization': authorization,
'Content-Type': "application/json;charset=utf-8",
})
}).subscribe(data => console.log(JSON.stringify(data)))
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
