import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.webhook.delete("<id>");
// Handle the result
console.log(result);
}
run();{
"name": "test_webhook",
"url": "https://my-service.com/webhook",
"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88",
"kind": "webhook",
"userId": "<string>",
"projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9",
"createdAt": 1587667174725,
"events": [
"stream.started",
"stream.idle"
],
"streamId": "de7818e7-610a-4057-8f6f-b785dc1e6f88",
"status": {
"lastFailure": {
"timestamp": 1587667174725,
"error": "Error message",
"response": "Response body",
"statusCode": 500
},
"lastTriggeredAt": 1587667174725
}
}Livepeer Studio API 端点
import { Livepeer } from "livepeer";
const livepeer = new Livepeer({
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await livepeer.webhook.delete("<id>");
// Handle the result
console.log(result);
}
run();{
"name": "test_webhook",
"url": "https://my-service.com/webhook",
"id": "de7818e7-610a-4057-8f6f-b785dc1e6f88",
"kind": "webhook",
"userId": "<string>",
"projectId": "aac12556-4d65-4d34-9fb6-d1f0985eb0a9",
"createdAt": 1587667174725,
"events": [
"stream.started",
"stream.idle"
],
"streamId": "de7818e7-610a-4057-8f6f-b785dc1e6f88",
"status": {
"lastFailure": {
"timestamp": 1587667174725,
"error": "Error message",
"response": "Response body",
"statusCode": 500
},
"lastTriggeredAt": 1587667174725
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Success
"test_webhook"
^http(s)?://"https://my-service.com/webhook"
"de7818e7-610a-4057-8f6f-b785dc1e6f88"
"webhook"
The ID of the project
"aac12556-4d65-4d34-9fb6-d1f0985eb0a9"
Timestamp (in milliseconds) at which stream object was created
1587667174725
stream.started, stream.detection, stream.idle, recording.ready, recording.started, recording.waiting, multistream.connected, multistream.error, multistream.disconnected, playback.user.new, playback.accessControl, asset.created, asset.updated, asset.failed, asset.ready, asset.deleted, task.spawned, task.updated, task.completed, task.failed ["stream.started", "stream.idle"]
streamId of the stream on which the webhook is applied
"de7818e7-610a-4057-8f6f-b785dc1e6f88"
status of webhook
显示 子属性
此页面对您有帮助吗?