Skip to main content
GET
/
v2.01
/
{CliendId}
/
hooks
<?php 

require_once 'vendor/autoload.php';

use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;

$api = new MangoPayApi();

$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';

try {
    $response = $api->Hooks->GetAll();

    print_r($response);
} catch(MGPResponseException $e) {
    print_r($e);
} catch(MGPException $e) {
    print_r($e);
}  
[
    {
        "Url": "https://example.com",
        "Status": "ENABLED",
        "Validity": "VALID",
        "EventType": "PAYIN_NORMAL_CREATED",
        "Id": "hook_m_01J6EK0ZRRGKZH98RCDWB7Y3KJ",
        "Tag": "Created using the Mangopay API Postman Collection",
        "CreationDate": 1724919086
    },
    {
        "Url": "https://example.com",
        "Status": "ENABLED",
        "Validity": "VALID",
        "EventType": "UBO_DECLARATION_VALIDATION_ASKED",
        "Id": "hook_m_01J6EK16AS02MV3H4AMMXMQWZ1",
        "Tag": "Created using the Mangopay API Postman Collection",
        "CreationDate": 1701792699
    }
]  

This call returns all the Hooks that have been created for the platform. It includes both enabled and disabled hooks.

Responses

Array (Hooks)
array
The list of hooks created by the platform.
[
    {
        "Url": "https://example.com",
        "Status": "ENABLED",
        "Validity": "VALID",
        "EventType": "PAYIN_NORMAL_CREATED",
        "Id": "hook_m_01J6EK0ZRRGKZH98RCDWB7Y3KJ",
        "Tag": "Created using the Mangopay API Postman Collection",
        "CreationDate": 1724919086
    },
    {
        "Url": "https://example.com",
        "Status": "ENABLED",
        "Validity": "VALID",
        "EventType": "UBO_DECLARATION_VALIDATION_ASKED",
        "Id": "hook_m_01J6EK16AS02MV3H4AMMXMQWZ1",
        "Tag": "Created using the Mangopay API Postman Collection",
        "CreationDate": 1701792699
    }
]  

<?php 

require_once 'vendor/autoload.php';

use MangoPay\MangoPayApi;
use MangoPay\Libraries\ResponseException as MGPResponseException;
use MangoPay\Libraries\Exception as MGPException;

$api = new MangoPayApi();

$api->Config->ClientId = 'your-client-id';
$api->Config->ClientPassword = 'your-api-key';
$api->Config->TemporaryFolder = 'tmp/';

try {
    $response = $api->Hooks->GetAll();

    print_r($response);
} catch(MGPResponseException $e) {
    print_r($e);
} catch(MGPException $e) {
    print_r($e);
}  
I