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

2. Creating Storage Webhook URL in Video Collections

1401
  • To listen to storage events from your storage service, You will need to create a webhook URL located in Storage Webhooks tab after you click on edit button of your desired video collection.
  • This internally calls Gumlet API to automatically create a video asset on our CMS with the object URL specified in your storage service.
  • Each webhook URL created needs to be associated with a video profile which will be used to process the video.

3. Creating SNS Subscription

1096
  • Copy the storage 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. Verifying Subscription

1458
  • AWS SNS uses URL-based authentication for verification subscriptions, so once you have created a subscription you will see a list of subscriptions in your AWS Console.
  • You need to select the subscription you have just created and click on the Request Confirmation button which will send an authentication URL to Gumlet.
1268
  • After requesting subscription confirmation from AWS Console, you have to click on the Complete Integration in Storage Webhooks tab which will give you an authentication URL sent by AWS .
  • Going back to all AWS SNS , click on Confirm Subscription and paste the authentication URL.
  • 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

You will need to replace the access policy attached to the topic with the following policy (You will be able to edit access policy by clicking on Edit topic button ). In this access policy, replace SNS topic ARN, bucket name, and bucket owner's account ID with your respective values.

{
    "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

1401
  • To listen to storage events from your storage service, You will need to create a webhook URL located in Storage Webhooks tab after you click on edit button of your desired video collection.
  • This internally calls Gumlet API to automatically create a video asset on our CMS with the object URL specified in your storage service.
  • 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.