-
Notifications
You must be signed in to change notification settings - Fork 40
Location webservice
Sebastiaan Lokhorst edited this page Jul 13, 2017
·
3 revisions
The Location webservice allows you to obtain information about PostNL pickup-point locations.
See README.md for basic usage.
First create a API client, as usual:
use DivideBV\Postnl\Postnl;
use DivideBV\Postnl\ComplexTypes;
$client = new Postnl(...);
Get a list of locations near/around a certain postcode.
NOTE: The function is implemented under a different name (GetNearestLocation
instead of (GetNearestLocations
) in the library. See #48.
$response = $client->GetNearestLocation('1234AB');
$locations = $response->getGetLocationsResult();
foreach($locations as $location) {
// get the information you want from $location
// see ComplexTypes/ResponseLocation.php for available methods
var_dump($location);
}
Get information about a single pickup-point location,' identified by its locationCode.
NOTE: This function returns a array of locations, even though it should only contain a single location.
$response = $client->getLocation('161503');
$locations = $response->getGetLocationsResult();
foreach($locations as $location) {
// get the information you want from $location
// see ComplexTypes/ResponseLocation.php for available methods
var_dump($location);
}
Get a list of locations in a rectangular area, bounded by the most north-west coordinate and the most south-east coordinate.
NOTE: The function is not yet implemented. See #40.