Shifter now supports outgoing Webhooks.
This feature can send requests to 3rd party locations using POST or GET based on a Shifter site lifecycle events.
Key features explained:
Method:
POST/GET
When
POST
method is selected, data has JSON formatBODY
and addsContent-type: application/json
header when it runs.When
GET
method is selected, it sends data as query parameters.Adding custom headers to requests are optional.
All headers can be overwritten, except
Content-type
andUser-Agent
.
Event name: Artifact:Created
Once a newly created artifact is complete, this event is fired and can send the following data:
site_id
: Site IDartifact_id
: Artifact IDdownload_url
: URL for downloading archived artifact as a TAR Archive file or tgz. BASE64 format, decode requires to handle. A download_url is available for three hours since the Webhook fired.
Shifter Webhook Examples
POST
Send data as JSON format
{
"site_id": "xxx-xxx..." ,
"artifact_id": "xxx-xxx..." ,
"download_url": "xxx-xxx-..."
}
GET
Send data as a query parameter.
?site_id=xxx...&artifact_id=xxx-xxx-...&download_url=xxx-...
How to set up
1. Login to the Dashboard
2. Navigate to [Webhooks] menu
3. Input target to the URL field
Netlify's API is set as a sample.
You can also set additional headers to Key and Value field.
4. Hit [Submit] button to save webhook
5. Webhook is saved
6. On "Your webhooks" section, you can confirm webhooks
Sending Webhook
It's done by automatically when Shifter completed generating artifacts.
Resend Webhooks
Shifter automatically send webhook when it completed artifact generation.
But, you can send it again with manually.
1. Navigate to Overview page
2. Scroll down to "Deploys" section and click [Detail] of the published Artfact
3. Scroll down to the Webhook section, and click [Invoke Webhook]
4. Webhook has been invoked
FAQs
Do Shifter Webhooks support Basic Authentication or Digest Authentication?
Basic Authentication is supported. To use basic auth, add basic (base64-encoded-username:base64-encoded-password) to your header.
Digest Authentication is not supported at this time.