laposta/laposta-api-php

Laposta api, free api to laposta.nl

1.6 2023-02-15 10:32 UTC

This package is not auto-updated.

Last update: 2024-05-25 13:49:22 UTC


README

To use the Laposta API, the following things are required:

  • PHP >= 5.6
  • CURL PHP extension
  • JSON PHP extension

Composer Installation

The easiest way to install this library is to require it with Composer.

$ composer require laposta/laposta-api-php

Manual Installation

If you're not using Composer, add the following to your PHP script:

require_once("/path/to/laposta-php/lib/Laposta.php");

Simple usage looks like:

Laposta::setApiKey("JdMtbsMq2jqJdQZD9AHC");
$member = new Laposta_Member("BaImMu3JZA");
$result = $member->get("member@example.net");

HTTP(S)

Default is HTTPS. If you can't use HTTPS, do this:

Laposta::setHttps(false);

If you're getting errors about certificate problems, you do this:

Laposta::setHttpsDisableVerifyPeer(true);

Note: this gets rid of the errors, but will introduce severe security issues that TLS is designed to protect against. A far better solution is move hosting provider or to install the CA's certs: https://stackoverflow.com/questions/6400300

Documentation

Please see https://api.laposta.nl/doc for up-to-date documentation.