<?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 {
$hookId = '198685419';
$response = $api->Hooks->Get($hookId);
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',
})
let hook = {
Id: '144086866',
}
const getHook = async (hookId) => {
return await mangopay.Hooks.get(hookId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
getHook(hook.Id)
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 viewHook(hookId)
begin
response = MangoPay::Hook.fetch(hookId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Hook: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myHook = {
Id: '194445815'
}
viewHook(myHook[:Id])
package com.samples.Helpers.Webhooks;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.Hook;
public class ViewHook {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var hookId = "hook_m_01J3JQ13F0M5NY83M1GZKVNS95";
Hook viewHook = mangopay.getHookApi().get(hookId);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(viewHook);
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
hook_id = 'hook_m_01HR4KJ27QBRPNZG351R3SBA0B'
try:
view_hook = Notification.get(hook_id)
pprint(view_hook._data)
except Notification.DoesNotExist:
print('Hook {} does not exist.'.format(hook_id))
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 hookId = "hook_m_01J55XNB6X4A0VJJ8W8CP9V51D";
var viewHook = await api.Hooks.GetAsync(hookId);
string prettyPrint = JsonConvert.SerializeObject(viewHook, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"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": 1655991027
}
Webhooks
View a Hook
GET
/
v2.01
/
{ClientId}
/
hooks
/
{HookId}
<?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 {
$hookId = '198685419';
$response = $api->Hooks->Get($hookId);
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',
})
let hook = {
Id: '144086866',
}
const getHook = async (hookId) => {
return await mangopay.Hooks.get(hookId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
getHook(hook.Id)
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 viewHook(hookId)
begin
response = MangoPay::Hook.fetch(hookId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Hook: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myHook = {
Id: '194445815'
}
viewHook(myHook[:Id])
package com.samples.Helpers.Webhooks;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.Hook;
public class ViewHook {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var hookId = "hook_m_01J3JQ13F0M5NY83M1GZKVNS95";
Hook viewHook = mangopay.getHookApi().get(hookId);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(viewHook);
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
hook_id = 'hook_m_01HR4KJ27QBRPNZG351R3SBA0B'
try:
view_hook = Notification.get(hook_id)
pprint(view_hook._data)
except Notification.DoesNotExist:
print('Hook {} does not exist.'.format(hook_id))
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 hookId = "hook_m_01J55XNB6X4A0VJJ8W8CP9V51D";
var viewHook = await api.Hooks.GetAsync(hookId);
string prettyPrint = JsonConvert.SerializeObject(viewHook, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
{
"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": 1655991027
}
Path parameters
string
The unique identifier of the hook.
Responses
200
200
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": "UBO_DECLARATION_VALIDATION_ASKED",
"Id": "hook_m_01J6EK16AS02MV3H4AMMXMQWZ1",
"Tag": "Created using the Mangopay API Postman Collection",
"CreationDate": 1655991027
}
<?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 {
$hookId = '198685419';
$response = $api->Hooks->Get($hookId);
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',
})
let hook = {
Id: '144086866',
}
const getHook = async (hookId) => {
return await mangopay.Hooks.get(hookId)
.then((response) => {
console.info(response)
return response
})
.catch((err) => {
console.log(err)
return false
})
}
getHook(hook.Id)
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 viewHook(hookId)
begin
response = MangoPay::Hook.fetch(hookId)
puts response
return response
rescue MangoPay::ResponseError => error
puts "Failed to fetch Hook: #{error.message}"
puts "Error details: #{error.details}"
return false
end
end
myHook = {
Id: '194445815'
}
viewHook(myHook[:Id])
package com.samples.Helpers.Webhooks;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.mangopay.MangoPayApi;
import com.mangopay.entities.Hook;
public class ViewHook {
public static void main(String[] args) throws Exception {
MangoPayApi mangopay = new MangoPayApi();
mangopay.getConfig().setClientId("your-client-id");
mangopay.getConfig().setClientPassword("your-api-key");
var hookId = "hook_m_01J3JQ13F0M5NY83M1GZKVNS95";
Hook viewHook = mangopay.getHookApi().get(hookId);
Gson prettyPrint = new GsonBuilder().setPrettyPrinting().create();
String prettyJson = prettyPrint.toJson(viewHook);
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
hook_id = 'hook_m_01HR4KJ27QBRPNZG351R3SBA0B'
try:
view_hook = Notification.get(hook_id)
pprint(view_hook._data)
except Notification.DoesNotExist:
print('Hook {} does not exist.'.format(hook_id))
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 hookId = "hook_m_01J55XNB6X4A0VJJ8W8CP9V51D";
var viewHook = await api.Hooks.GetAsync(hookId);
string prettyPrint = JsonConvert.SerializeObject(viewHook, Formatting.Indented);
Console.WriteLine(prettyPrint);
}
}
Was this page helpful?
⌘I