Vision 6

getWebhooks

Returns the list of all Webhooks.

getWebhooks

Returns the list of all Webhooks.

Top ↑

Syntax

array getWebhooks( string api_key );

API Key Access Level required: Full access

Parameters

api_key (string)

The key required to access the API. See Getting Started for more information.

Return Value

Returns an array containing zero or more Webhook objects. See the remarks section below for the list of values this method returns.

Examples

The following code gets the list of all webhooks that exist in the account.

PHP

$api = new Api($url, 'YOURAPIKEY');
$webhooks = $api->invokeMethod('getWebhooks');

JSON Request

{
    "id": 1,
    "method": "getWebhooks",
    "params": [
        "YOURAPIKEY"
    ]
}

JSON Response

{
    "id": 1,
    "result": [
        {
            "id": 615,
            "object": "list",
            "event": "created",
            "list_id": 123,
            "url": "http:\/\/example.com\/example.php",
            "creation_time": 1496636627
        },
        {
            "id": 616,
            "object": "contact",
            "event": "unsubscribed",
            "list_id": 123,
            "url": "http:\/\/example.com\/example2.php",
            "creation_time": 1496639113
        }
    ],
    "error": null
}

Remarks

The following table shows the values that are returned.

Key Type Description
id int Webhook id.
object string The name of the Webhook object.
event string The name of the Webhook object.
url string The url endpoint that the Webhook will send it's object to.
creation_time int Timestamp indicating when the Webhook was created.

Error Codes

This method may return the following error codes in addition to the standard error codes:

Code Error Description
310 Invalid Method Parameters One or more parameters are invalid.

See Also