Blitline has integrated with AWS so that instead of postbacks or polling, you can use AWS Events generated by Blitline.com as notification that you job has completed.
AWS Events can be connected to Lambda functions (or other AWS services such as SQS and DynamoDB). The simplest setup is for you to have AWS Events call a Lambda function where you can handle the Blitline callback without ever needing a public callback endpoint. This makes receiving callbacks from Blitline as easy as writing a Lambda function, and it all happens within the privacy of your VPC.
To setup Blitline Events, you will need to do the following:
Create a Lambda function to receive the Event. For now, it can just be a default Lambda function, you can add the code for handling the Blitline callback later.
Log in to Blitline.com and click the "Configuration" tab from the home page. Scroll down to Event Bridge and enter your AWS Account ID (which you can find on your AWS "My Account" page from the AWS Console). Make sure you have your desired region and click the Update Button.
- Once you have updated your Account ID, you will need to go to your AWS Console and go to your Event Bridge page and activate this connection. You can find this page at:
- Associate with an Event Bus
- You then need to click associate
- Create a new rule
- Fill out form
- Once you create this rule, all Blitline postbacks should now go directly to your Lambda function. The Lambda function will receive event from Blitline from jobs submitted to Blitline.
You Lambda function will get an Event data with a "detail" containing:
Where you will have to Base64 decode the value of "base64_json". The result of this will be your "Postback" data you would have received during a postback call.
You have to base64 decode the node yourself because Event bridge requires a fixed JSON schema, and the results from Blitline is not fixed by design.
Updated over 2 years ago