joshh
10/17/2022, 9:47 AMjoshh
10/17/2022, 9:47 AMKyle_Cloudflare
10/17/2022, 2:07 PMCartel
10/17/2022, 2:26 PMCartel
10/17/2022, 2:27 PMKyle_Cloudflare
10/17/2022, 2:28 PMmkrigsman
10/17/2022, 5:11 PMhttps://customer-dfpgadnaeef4b406.cloudflarestream.com/4556f4d22f7bc6e922bf11ea3b77f5bd/iframe?poster=https://test.cxotalk.com/sites/default/files/field/image/Bernardo-Mariano-v2.png▾
https://test.cxotalk.com/sites/default/files/field/image/Bernardo-Mariano-v2.png▾
joshh
10/17/2022, 5:58 PMmkrigsman
10/17/2022, 6:45 PMjoshh
10/17/2022, 7:00 PMmkrigsman
10/17/2022, 7:18 PMvalentinexo
10/18/2022, 10:40 AMCyb3r-Jok3
10/18/2022, 11:29 PMDemosJarco
10/19/2022, 2:18 AMdaniel_klungo
10/19/2022, 11:41 AMallowedOrigins
for many videos at once?Deleted User
10/20/2022, 2:45 AMjavascript
// const url = "customer-customdomain.cloudflarestream.com";
const url = "api.cloudflare.com/client/v4";
// const url = "customer-customdomain.cloudflarestream.com/client/v4";
const id = "myid";
const email = "my@email.com";
const key = "myapikey";
fetch(
new Request(new URL(`https://${url}/accounts/${id}/stream`), {
headers: new Headers({
"X-Auth-Email": email,
"X-Auth-Key": key,
"Content-Type": "application/json",
}),
// limit: 500,
// after: "2014-01-02T02:20:00Z",
})
)
.then((response) => response.body)
.then(
new ReadableStream({
start(controller) {
function push() {
reader.read().then(({ done, value }) => {
if (done) {
controller.close();
return;
}
});
controller.enqueue(value);
push();
}
},
})
)
.then((stream) => new Response(stream).text())
.then(console.log);
// {"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}
am I doing something wrong here? I'm getting an authentication error?Deleted User
10/20/2022, 2:48 AMAuthorization: `Bearer ${key}`
Deleted User
10/20/2022, 2:53 AMKyle_Cloudflare
10/20/2022, 2:17 PMnew Request(new URL(`https://${url}/accounts/${id}/stream`), {
headers: new Headers({
"X-Auth-Email": email,
"X-Auth-Key": key,
"Content-Type": "application/json",
}),
// limit: 500,
// after: "2014-01-02T02:20:00Z",
})
)
If you uncomment limit
, I would still not expect that to work. Limit is passed as a query parameter, AFAIK you would need to mutate the URL rather than adding entries to the second argument of fetch
ie, .../stream?limit=30&include_counts=true
, which is the arguments our dashboard calls withxtc
10/20/2022, 4:52 PMMagnusG87
10/21/2022, 5:07 PMshaquilleoatmeal
10/21/2022, 9:21 PMaltryne
10/21/2022, 10:21 PMDeleted User
10/22/2022, 12:55 AMURLSearchParams
Deleted User
10/22/2022, 12:55 AMJustDalek_
10/22/2022, 2:04 AMDemosJarco
10/22/2022, 2:40 AMDemosJarco
10/22/2022, 2:41 AMJustDalek_
10/22/2022, 2:42 AMUnsmart | Tech debt
10/22/2022, 2:43 AM