Exemplo n.º 1
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize webhook with list_id
$webhook = new Laposta_Webhook("BaImMu3JZA");
try {
    // get all webhooks from this list
    // $result will contain een array with the response from the server
    $result = $webhook->all();
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Exemplo n.º 2
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize webhook with list_id
$webhook = new Laposta_Webhook("BaImMu3JZA");
try {
    // get webhook info, use webhook_id or email as argument
    // $result will contain een array with the response from the server
    $result = $webhook->get("cW5ls8IVJl");
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Exemplo n.º 3
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize webhook with list_id
$webhook = new Laposta_Webhook("BaImMu3JZA");
try {
    // update webhook, insert info as argument
    // $result will contain een array with the response from the server
    $result = $webhook->update("iH52rJwguo", array('url' => 'http://www.example.com/webhook.pl'));
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Exemplo n.º 4
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize webhook with list_id
$webhook = new Laposta_Webhook("BaImMu3JZA");
try {
    // create new webhook, insert info as argument
    // $result will contain een array with the response from the server
    $result = $webhook->create(array('event' => 'modified', 'url' => 'http://example.com/webhook.pl', 'blocked' => 'false'));
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}
Exemplo n.º 5
0
<?php

require_once '../../lib/Laposta.php';
Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
// initialize webhook with list_id
$webhook = new Laposta_Webhook("BaImMu3JZA");
try {
    // (permanently) delete webhook, use webhook_id as argument
    // $result will contain een array with the response from the server
    $result = $webhook->delete("iH52rJwguo");
    print '<pre>';
    print_r($result);
    print '</pre>';
} catch (Exception $e) {
    // you can use the information in $e to react to the exception
    print '<pre>';
    print_r($e);
    print '</pre>';
}