Storage Webhooks

Reference for creating webhooks for storage service.

Gumlet provides functionality to create webhooks to enable automatic ingestion of videos into gumlet based on storage events triggered by storage services.

This functionality can be used with Amazon S3 and Google Cloud Storage. If you are using one of these services to store videos which later be processed by Gumlet then you can create these webhooks with the following steps according to the storage service. You can find these settings for the video collection edit under the storage webhooks tab in the Gumlet video dashboard.

Create Webhooks with AWS S3

1. Create SNS Topic

Create a topic in Amazon Simple Notification Service (SNS) with standard type using Creating an Amazon SNS topic guide, and make sure you are creating the topic in the same region as your S3 bucket.

2. Create Webhook URL

You will need to create a webhook URL from Gumlet which will listen to the storage events from your storage service which internally calls Gumlet API to create a video asset with the object URL specified in the storage event. Each webhook URL created needs to be associated with a video profile which will be used to process the video.

3. Create SNS Subscription

Copy the webhook URL created in the above step from Gumlet Dashboard. Create an SNS Subscription with the topic you have created in step 1 using Subscribing to an Amazon SNS topic guide. While creating the subscription select HTTPS as Protocol and provide Gumlet Webhook URL copied earlier in Endpoint option as specified in the above image.

4. Verify Subscription

AWS SNS uses URL-based authentication for verification subscriptions. Once you have created a subscription you will see a list of subscriptions in your AWS Console, you can select the subscription you have just created and click on the Request Confirmation button which will send an authentication URL to Gumlet.

After requesting subscription confirmation from AWS Console, you have to click on the Complete Integration in Storage Webhooks settings tab in Gumlet Dashboard which will give you an authentication URL sent by AWS that can be used in AWS Console to confirm subscription.

Once you have confirmed the subscription from AWS Console, you can click on the Verify Webhook button in Gumlet Dashboard to complete the webhook integration and verification process.

5. Change Topic Policy

Replace the access policy attached to the topic with the following policy. In it, provide your SNS topic ARN, bucket name, and bucket owner's account ID.

{
    "Version": "2012-10-17",
    "Id": "example-ID",
    "Statement": [
        {
            "Sid": "Example SNS topic policy",
            "Effect": "Allow",
            "Principal": {
                "Service": "s3.amazonaws.com"
            },
            "Action": [
                "SNS:Publish"
            ],
            "Resource": "SNS-topic-ARN",
            "Condition": {
                "ArnLike": {
                    "aws:SourceArn": "arn:aws:s3:*:*:bucket-name"
                },
                "StringEquals": {
                    "aws:SourceAccount": "bucket-owner-account-id"
                }
            }
        }
    ]
}

6. Configure Event Notification with S3 Bucket

Use Enable Event Notification guide to enable notification with the S3 bucket which you using to store your videos. While enabling event notification use the topic which we have created in step 1 as your notification destination.

Create Webhooks with Google Cloud Storage

1. Create Webhook URL

You will need to create a webhook URL from Gumlet which will listen to the storage events from your storage service which internally calls Gumlet API to create a video asset with the object URL specified in the storage event. Each webhook URL created needs to be associated with a video profile which will be used to process the video.

2. Create Pub/Sub Topic and Subscription

Create Google Cloud Pub/Sub Topic and Subscription using Create Subscription guide, while creating the subscription select push as the delivery type and provide Gumlet Webhook URL from step 1 as endpoint option.

3. Configure Topic/Subscription with Storage Bucket

Use gsutil tool to enable notification with the google cloud storage bucket which you use to store your videos with the following command.

gsutil notification create -t TOPIC_NAME -f json gs://BUCKET_NAME

4. Complete Verification

Once you have configured the subscription as mentioned in the above step, you can click on the Verify Webhook button in Gumlet Dashboard to complete the webhook integration and verification process.


Did this page help you?