Webhooks
WebhookService
Service which can be used to communicate with WebhookEndpoint type in UGC API.
To use this service, you need to instantiate it with a valid Move UGC client.
from move_ugc import MoveUgc
ugc = MoveUgc(api_key="my-api-key")
events = ["ugc.jobs.operation.completed"]
uid = "<unique-id-for-webhook>"
url = "https://example.com/webhook"
# Call webhook service methods directly
webhook_endpoint = ugc.webhooks.upsert(events=events, uid=uid, url=url)
upsert
upsert(events: List[str], uid: str, url: str, description: Optional[str] = '', secret: Optional[str] = None) -> WebhookEndpoint
Update or create a webhook endpoint to the client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
events |
Any
|
Events to subscribe to. |
required |
uid |
str
|
Unique identifier for the webhook endpoint. |
required |
url |
str
|
URL of the webhook endpoint. |
required |
description |
str
|
Description of the webhook endpoint. Defaults to "". |
''
|
secret |
str
|
Secret used to verify the webhook endpoint. Defaults to None. |
None
|
Returns:
Type | Description |
---|---|
WebhookEndpoint
|
WebhookEndpoint instance of Pydantic model type. |