HTTP POST
If you have a 3rd party application, such as your own custom CRM, you may wish to receive notifications there. Deploy can generate notifications by way of HTTP Post, so you can set up an endpoint to display the notifications in your application.
To set up a new notification, click the Integrations link on the left hand side of your project, then the New Integration button to get started.
Start by selecting HTTP Post in the service picker, then enter the URL of your endpoint, and a username and API key or password (depending on the authentication method you have set up on your endpoint).
Choose when to trigger the integration, and choose any servers you wish to trigger it for, or keep the Trigger integration when any server or group deployed? option checked if you want to trigger for all servers.
Finally, click Create Integration to finish.
Notification format and payload
Deploy supports sending notifications in JSON format when a deployment is made. With JSON, the payload will be delivered to the specified HTTP/HTTPS URL along with a base64-encoded signature from Deploy so you can verify where the message originated from.
Our public key
-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXJcP2N6NtcN26Q8nVaidXOA0w
RxWK2HQTblIaQdGRDjqTvhrSlFuV5N4jz7w/w8uskP20G7ZQ+CkHwIXrWk76KZJn
pdoOHPO6AqRmEFgV5Q6Y1CR77mvnT9O21hTnfzfyyiAdQC2oO8M9/jeLRPTAqmkG
xdQa8iepUz4BwrrHmwIDAQAB
-----END PUBLIC KEY-----
Example payload
{
"payload" : {
"identifier" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"servers" : [
{
"id" : 494506,
"identifier" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx",
"name" : "test",
"protocol_type" : "ftp",
"server_path" : "htdocs",
"auto_deploy_url" : "https://adamw.deployhq.com/deploy/codebase-project/to/test/xxxxxxxxxxx",
"last_revision" : "abcdef123456",
"preferred_branch" : "master",
"branch" : "",
"notify_email" : "",
"server_group_identifier" : ,
"hostname" : "ftp.test.com",
"username" : "test",
"port" : 21,
"passive" : true,
"force_hidden_files" : false
}
],
"project" : {
"name" : "Codebase Project",
"permalink" : "codebase-project",
"public_key" : "xxxxxxxx",
"repository" : {
"scm_type" : "git",
"url" : "git@codebasehq.com:adamw/first-project/repository.git",
"port" : nil,
"username" : "adamw",
"branch" : "master",
"cached" : true,
"hosting_service" : {
"name" : "Codebase",
"url" : "http://www.codebasehq.com",
"tree_url" : "https://adamw.codebasehq.com/projects/first-project/repositories/repository/tree/master",
"commits_url" : "https://adamw.codebasehq.com/projects/first-project/repositories/repository/commits/master"
}
}
},
"deployer" : "Adam West",
"start_revision" : {
"ref" : "abcdef123456",
"author" : "Adam West",
"email" : "adamw@atech.media",
"timestamp" : "2017-06-08T16:33:12.000+01:00",
"message" : "test",
"short_message" : "test",
"tags" : []
},
"end_revision" : {
"ref" : "123456abcdef",
"author" : "Adam West",
"email" : "adamw@atechmedia.com",
"timestamp" : "2018-01-02T15:10:56.000+00:00",
"message" : "test",
"short_message" : "test",
"tags" : []
},
"status" : "completed",
"timestamps" : {
"queued_at" : "2018-01-10T15:58:22.000Z",
"started_at" : "2018-01-10T15:58:22.000Z",
"completed_at" : "2018-01-10T15:58:44.000Z",
"duration" : ""
},
"files" : {
"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx" : {
"changed" : [
"gulpfile.js",
"test/controllers/.keep",
"test/controllers/articles_controller_test.rb",
"test/controllers/comments_controller_test.rb",
"test/controllers/welcome_controller_test.rb",
"test/fixtures/.keep",
"test/fixtures/articles.yml",
"test/fixtures/comments.yml",
"test/helpers/.keep",
"test/integration/.keep",
"test/mailers/.keep",
"test/models/.keep",
"test/models/article_test.rb",
"test/models/comment_test.rb",
"test/test_helper.rb",
"test1/test.txt",
"test2/test.txt",
"test3",
"testfile1.txt"
],
"removed" : [
"testfile.txt"
]
}
},
"configuration" : {
"copy_config_files" : true,
"notification_addresses" : ""
},
"legacy" : false
},
"signature" : "rU07GCp8X79x0mEGw8uNpW6poltzfM1ch8kqwBJDRy77fgoSQhLttq6UKtEO K8/iD+twpHG3DWk17B8tQPu4mI19aGyiarvnEGJ7zUcJNbbrR6C2Rjrs1g0L VDfOqZ70yeecti+Vhs7XUlYD/Vguc7cliwrOupWdyY57vtcZscQ="
}