<?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
}
]
Webhooks
List all Hooks
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.Documentation Index
Fetch the complete documentation index at: https://docs.mangopay.com/llms.txt
Use this file to discover all available pages before exploring further.
Responses
200
200
The list of hooks created by the platform.
Show properties
Show properties
The hook object created by the platform.
Show properties
Show properties
Max. length: 255 charactersThe URL to which the notification is sent.
Returned values:
DISABLED, ENABLEDWhether the hook is enabled or not.Returned values:
VALID, INVALIDWhether the hook is valid or not. Once INVALID (following unsuccessful retries) the hook must be disabled and re-enabled.Returned values: An
EventType listed in the event types listThe type of the event.Max length: 128 characters (see data formats for details)The unique identifier of the object.
Max. length: 255 charactersCustom data that you can add to this object.
The date and time at which the object was created.
[
{
"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);
}
Was this page helpful?
⌘I