XP-Dev.com Documentation


Webhooks are a very useful feature for version control systems. The configured webhook will be called on each commit and contains some information about the the commit change.

The most common use of webhooks is to trigger continous-integration servers to kick off a build process.

Enabling Webhooks

To enable webhooks on your Subversion repository:

  • Head over to your Repository tab of your project
  • Click on Edit Repository for the repository that you with to configure
  • Enter a URL next to Webhook URL
  • Click on Save

Edit Repository

  • The webhook will be displayed next to Webook URL under the Repository tab of your project

Add Webhook URL

  • To disable the webhook, just leave the field blank

Now, whenever a new revision has been committed into the repository, XP-Dev.com will submit a JSON message to your URL in the method body.


You will get a new request on the URL for each commit.

The format of the JSON message is below:

    "repository": Name of the repository (Type:String),
    "message": Commit log message (Type:String),
    "timestamp": Timestamp of commit (Unix epoch in miliseconds) (Type:long),
    "author": Committer (Type:String),
    "revision": Commit revision (Type:long),        
    "reference": Commit branch or blank for Subversion (Type:String),        
    "repository_ssl_path": Full SSL URL to the repository root (Type:String),
    "repository_path": Full non-SSL URL to the repository root (Type:String),
    "revision_web": Url to view the changeset on XP-Dev.com (Type:String),
    "added": List of paths that have been added (Type:String array),
    "removed": List of paths that have been removed/deleted (Type:String array),
    "replaced": List of paths that have been replaced (Type:String array),
    "modified": List of paths that have been modifed (Type:String array)

An example of the JSON message is below:

    "message": "some changes for tomorrows release",

Example Code to Receive the Data

PHP example:

    $json = file_get_contents('php://input');


Testing Your Webhook

You can use curl to test your webhook. Head over to their"download page":http://curl.haxx.se/download.html and download the appropriate package for your platform.

Running the following command will test that your webhook is installed correctly.

Please do note that the webhook URL in the following example is set to http://example.com/webhook.php. You should change it to your own webhook URL.

curl -d '{"message":"svn:commit for logparser-1", "timestamp":1223820987303,"author":"rs","revision":627, "repository_ssl_path":"https://xp-dev.com/svn/rs-importable/", "added":["/tags/logparser-1","/tags/logparser-1/src/python/reportgenerator.py"], "revision_web":"https://xp-dev.com/svnview/changeset/3/627/","repository":"rs-importable", "repository_path":"http://svn.xp-dev.com/svn/rs-importable/","removed":[], "replaced":["/tags/logparser-1/src/sql","/tags/logparser-1/src", "/tags/logparser-1/src/html","/tags/logparser-1/src/python","/tags/logparser-1/src/geoip"], "modified":[]}' http://example.com/webhook.php

If you're using the example webhook listed above, you should get the following output:

object(stdClass)#1 (12) {
  string(26) "svn:commit for logparser-1"
  string(2) "rs"
  string(0) ""
  string(41) "https://xp-dev.com/svn/rs-importable/"
  array(2) {
    string(17) "/tags/logparser-1"
    string(47) "/tags/logparser-1/src/python/reportgenerator.py"
  string(42) "https://xp-dev.com/svnview/changeset/3/627/"
  string(13) "rs-importable"
  string(40) "https://xp-dev.com/svn/rs-importable/"
  array(0) {
  array(5) {
    string(25) "/tags/logparser-1/src/sql"
    string(21) "/tags/logparser-1/src"
    string(26) "/tags/logparser-1/src/html"
    string(28) "/tags/logparser-1/src/python"
    string(27) "/tags/logparser-1/src/geoip"
  array(0) {

Feel free to contact us if you need any assistance.