<?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);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
const listHooks = async () => {
return await mangopay.Hooks.getAll()
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
listHooks()
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def listHooks()
begin
response = MangoPay::Hook.fetch()
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Hooks: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
listHooks()
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.Pagination;
import com.mangopay.entities.Hook;
public class ListHooks {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
List<Hook> hooks = mangopay.getHookApi().getAll(new Pagination(1, 100), null);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(hooks);
System.out.println(prettyJson);
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Notification
hooks = Notification.all()
for hook in hooks:
pprint(hook._data)
print()
using MangoPay.SDK;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var hooks = await api.Hooks.GetAllAsync(new Pagination(1, 100));
string prettyPrint = JsonConvert.SerializeObject(hooks, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
[
{
"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);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
const listHooks = async () => {
return await mangopay.Hooks.getAll()
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
listHooks()
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def listHooks()
begin
response = MangoPay::Hook.fetch()
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Hooks: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
listHooks()
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.Pagination;
import com.mangopay.entities.Hook;
public class ListHooks {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
List<Hook> hooks = mangopay.getHookApi().getAll(new Pagination(1, 100), null);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(hooks);
System.out.println(prettyJson);
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Notification
hooks = Notification.all()
for hook in hooks:
pprint(hook._data)
print()
using MangoPay.SDK;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var hooks = await api.Hooks.GetAllAsync(new Pagination(1, 100));
string prettyPrint = JsonConvert.SerializeObject(hooks, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
[
{
"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
200
200
array
The list of hooks created by the platform.
Show properties
Show properties
object
The hook object created by the platform.
Show properties
Show properties
string
Max. length: 255 charactersThe URL to which the notification is sent.
string
Returned values:
DISABLED, ENABLEDWhether the hook is enabled or not.string
Returned values:
VALID, INVALIDWhether the hook is valid or not. Once INVALID (following unsuccessful retries) the hook must be disabled and re-enabled.string
Returned values: An
EventType listed in the event types listThe type of the event.string
Max length: 128 characters (see data formats for details)The unique identifier of the object.
string
Max. length: 255 charactersCustom data that you can add to this object.
Unix timestamp
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);
}
const mangopayInstance = require('mangopay4-nodejs-sdk')
const mangopay = new mangopayInstance({
clientId: 'your-client-id',
clientApiKey: 'your-api-key',
})
const listHooks = async () => {
return await mangopay.Hooks.getAll()
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
listHooks()
require 'mangopay'
MangoPay.configure do |client|
client.preproduction = true
client.client_id = 'your-client-id'
client.client_apiKey = 'your-api-key'
client.log_file = File.join(Dir.pwd, 'mangopay.log')
end
def listHooks()
begin
response = MangoPay::Hook.fetch()
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Hooks: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
listHooks()
import java.util.List;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.core.Pagination;
import com.mangopay.entities.Hook;
public class ListHooks {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
List<Hook> hooks = mangopay.getHookApi().getAll(new Pagination(1, 100), null);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(hooks);
System.out.println(prettyJson);
}
}
from pprint import pprint
import mangopay
mangopay.client_id='your-client-id'
mangopay.apikey='your-api-key'
from mangopay.api import APIRequest
handler = APIRequest(sandbox=True)
from mangopay.resources import Notification
hooks = Notification.all()
for hook in hooks:
pprint(hook._data)
print()
using MangoPay.SDK;
using Newtonsoft.Json;
class Program
{
static async Task Main(string[] args)
{
MangoPayApi api = new MangoPayApi();
api.Config.ClientId = "your-client-id";
api.Config.ClientPassword = "your-api-key";
var hooks = await api.Hooks.GetAllAsync(new Pagination(1, 100));
string prettyPrint = JsonConvert.SerializeObject(hooks, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?
⌘I