Storage Webhooks
Reference for creating webhooks for storage service.
Gumlet provides functionality to create webhooks to automatically ingest 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 Create an Amazon SNS topic guide.
- Make sure you create the topic in the same region as your S3 bucket (You can choose your region on the top bar and proceed).
2. Creating Storage Webhook URL in Video Collections
- To listen to storage events from your storage service, You will need to create a webhook URL located in the Storage Webhooks tab after you click the 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
- 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
- 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 to send an authentication URL to Gumlet.
- 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 can edit the access policy by clicking on the Edit topic button ). In this access policy, replace the SNS topic ARN, bucket name, and 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 you use 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
- To listen to storage events from your storage service, You will need to create a webhook URL located in the Storage Webhooks tab after you click on the 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 the 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 mentioned above, you can click on the Verify Webhook button in Gumlet Dashboard to complete the webhook integration and verification process.
Updated about 2 months ago