Skip to content

Latest commit

 

History

History
52 lines (47 loc) · 3.01 KB

updatewebhookresponse.md

File metadata and controls

52 lines (47 loc) · 3.01 KB

UpdateWebhookResponse

Example Usage

import { Events } from "livepeer/models/components";
import { UpdateWebhookResponse } from "livepeer/models/operations";

let value: UpdateWebhookResponse = {
  contentType: "<value>",
  statusCode: 501,
  rawResponse: new Response("{\"message\": \"hello world\"}", {
    headers: { "Content-Type": "application/json" },
  }),
  webhook: {
    id: "de7818e7-610a-4057-8f6f-b785dc1e6f88",
    name: "test_webhook",
    projectId: "aac12556-4d65-4d34-9fb6-d1f0985eb0a9",
    createdAt: 1587667174725,
    events: [
      Events.StreamStarted,
      Events.StreamIdle,
    ],
    url: "https://my-service.com/webhook",
    streamId: "de7818e7-610a-4057-8f6f-b785dc1e6f88",
    status: {
      lastFailure: {
        timestamp: 1587667174725,
        error: "Error message",
        response: "Response body",
        statusCode: 500,
      },
      lastTriggeredAt: 1587667174725,
    },
  },
  error: {
    errors: [
      "[\"id not provided\",\"Account not found\"]",
    ],
  },
};

Fields

Field Type Required Description
contentType string ✔️ HTTP response content type for this operation
statusCode number ✔️ HTTP response status code for this operation
rawResponse Response ✔️ Raw HTTP response; suitable for custom response parsing
webhook components.Webhook Success
error components.ErrorT Error