Create a webhook

Arguments

Argument Required/optional Description
webhook_type required A string of one of the following relating to what type of webhook to create:

  • send-envelope
  • signed-envelope
  • cancelled-envelope
  • rejected-envelope
  • add-user
  • add-contact
  • opened-envelope
  • add-template
  • all
  • signed-envelope-complete
webhook_url required A string of the URL of the new webhook

Example Request

cURL

curl https://api.signable.co.uk/v1/webhooks  \
   -u d41d8cd98f00b204e9800998ecf8427e:x \
   -X POST \
   -d "webhook_type=all" \
   -d "webhook_url=http://www.google.com"
		

PHP


// Download our PHP SDK Library here: https://github.com/Signable/signable-sdk-php
$response = Signable\Webhooks::createNew("all", "http://www.google.com");
// Output the response
var_dump($response);
			

Example Response

{
    "http": 200,
    "message": "The webhook (http://www.google.com) has been created",
    "href": "https://api.signable.co.uk/v1/webhooks/1000",
    "webhook_id": "1000",
    "webhook_type": "all",
    "webhook_url": "http://www.google.com",
    "webhook_created": "2013-10-24T15:05:05+0000"
}


Get a webhook

Arguments

Argument Required/optional Description
id required A positive integer representing the webhook_id

Example Request

cURL

curl https://api.signable.co.uk/v1/webhooks/1000 
-u d41d8cd98f00b204e9800998ecf8427e:x
		

PHP


// Download our PHP SDK Library here: https://github.com/Signable/signable-sdk-php
$response = Signable\Webhooks::getSingle(1000);

// Output the response
var_dump($response);
			

Example Response

{
	"http":200,
	"webhook_id":1000,
	"webhook_type":"send-envelope",
	"webhook_url":"http://www.google.com",
	"webhook_created":"2012-10-07T13:34:53+0000",
}


List webhooks

Arguments

Argument Required/optional Description
offset optional A positive integer indicating the first record to retrieve. Defaults to the first webhook.
limit optional A positive integer indicating the maximum number of webhooks to return. Defaults to 10.

Example Request

cURL

curl https://api.signable.co.uk/v1/webhooks?offset=0&limit=3 
-u d41d8cd98f00b204e9800998ecf8427e:x
		

PHP


// Download our PHP SDK Library here: https://github.com/Signable/signable-sdk-php
$response = Signable\Webhooks::getMultiple(0, 10);

// Output the response
var_dump($response);
			

Example Response

{
    "http": 200,
    "offset": 0,
    "limit": 3,
    "total_webhooks": "10",
    "next": "https://api.signable.co.uk/v1/webhooks?offset=3&limit=7",
    "webhooks": [
        {
            "webhook_id": "1000",
            "webhook_type": "send-envelope",
            "webhook_url": "http://www.google.com",
            "webhook_created": "2012-10-07T13:35:30+0000",
        },
        {
            "webhook_id": "1001",
            "webhook_type": "signed-envelope",
            "webhook_url": "http://www.bing.com",
            "webhook_created": "2012-10-07T13:35:30+0000",
        },
        {
            "webhook_id": "1002",
            "webhook_type": "all",
            "webhook_url": "http://www.yahoo.com",
            "webhook_created": "2012-10-07T13:35:30+0000",
        },
]
}


Update a webhook

Arguments

Argument Required/optional Description
id required A positive integer representing the webhook_id of the webhook you want to update
webhook_type optional A string of the type of webhook. Either webhook_type or webhook_url must be provided.
webhook_url optional A string of the url of the webhook. Either webhook_type or webhook_url must be provided.

Example Request

cURL

curl https:/api.signable.co.uk/v1/webhooks/1000  \
   -u d41d8cd98f00b204e9800998ecf8427e:x \
   -X PUT \
   -d "webhook_type=all" \
   -d "webhook_url=http://www.microsoft.com"
		

PHP


// Download our PHP SDK Library here: https://github.com/Signable/signable-sdk-php
$response = Signable\Webhooks::update(1000, "all", "http://www.microsoft.com");
// Output the response
var_dump($response);
			

Example Response

{
    "http": 200,
    "message": "The webhook with ID 1000 has been updated",
    "href": "https://api.signable.co.uk/v1/webhooks/1000",
    "webhook_id": 2342,
    "webhook_url": "http://www.microsoft.com",
    "webhook_type": "all",
    "webhook_updated": "2013-11-04T21:48:53+0000"
}


Delete a webhook

Arguments

Argument Required/optional Description
id required A positive integer representing the webhook_id of the webhook you want to delete

Example Request

cURL

curl https://api.signable.co.uk/v1/webhooks/1000
   -u d41d8cd98f00b204e9800998ecf8427e:x 
   -X DELETE
		

PHP


// Download our PHP SDK Library here: https://github.com/Signable/signable-sdk-php
$response = Signable\Webhooks::delete(1000);
// Output the response
var_dump($response);
			

Example Response

{
    "http": 200,
    "message": "The webhook (http://www.google.com) has been removed from your account.",
    "webhook_id": 1000
}