Provisioning Freightways services as REST APIs
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 1.9
- Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/NOKNOKSoftware/FreightwaysAPI"
}
],
"require": {
"NOKNOKSoftware/FreightwaysAPI": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/FreightwaysAPI/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$apiInstance = new Swagger\Client\Api\AddressesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$query = "query_example"; // string | Query text for providing suggestions on. For the default prefix match type, this can be thought of an 'addresses starting with this text' search e.g. (10A Vict) matches streets starting with 10A Victoria and 10A Victor. The more text provided (or typed by a user for example), the more the results will be narrowed down.
$skip = 0; // int | number of records to skip for pagination
$limit = 10; // int | maximum number of records to return
try {
$result = $apiInstance->findAddressAutocomplete($query, $skip, $limit);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AddressesApi->findAddressAutocomplete: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\AddressesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$query = "query_example"; // string | Query text for providing suggestions on. For the default prefix match type, this can be thought of an 'addresses starting with this text' search e.g. (10A Vict) matches streets starting with 10A Victoria and 10A Victor. The more text provided (or typed by a user for example), the more the results will be narrowed down.
$skip = 0; // int | number of records to skip for pagination
$limit = 10; // int | maximum number of records to return
try {
$result = $apiInstance->findAddressFuzzy($query, $skip, $limit);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AddressesApi->findAddressFuzzy: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\AddressesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$query = "query_example"; // string | Query text for providing suggestions on. For the default prefix match type, this can be thought of an 'addresses starting with this text' search e.g. (10A Vict) matches streets starting with 10A Victoria and 10A Victor. The more text provided (or typed by a user for example), the more the results will be narrowed down.
$skip = 0; // int | number of records to skip for pagination
$limit = 10; // int | maximum number of records to return
try {
$result = $apiInstance->findAddressMatch($query, $skip, $limit);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AddressesApi->findAddressMatch: ', $e->getMessage(), PHP_EOL;
}
$apiInstance = new Swagger\Client\Api\AddressesApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client()
);
$address_id = "address_id_example"; // string | Returns an address for an id
try {
$result = $apiInstance->getAddressForId($address_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AddressesApi->getAddressForId: ', $e->getMessage(), PHP_EOL;
}
?>
All URIs are relative to https://customer-integration.ep-customersandbox.freightways.co.nz
Class | Method | HTTP request | Description |
---|---|---|---|
AddressesApi | findAddressAutocomplete | GET /v1/addressautocomplete | Returns a list of fuzzy addresses, intended for providing suggestions as you type. |
AddressesApi | findAddressFuzzy | GET /v1/addressfuzzy | Fuzzy Search of Address data. |
AddressesApi | findAddressMatch | GET /v1/addressmatch | Returns a list of fuzzy addresses, intended for providing suggestions as you type. |
AddressesApi | getAddressForId | GET /v1/addresses/{addressId} | Returns a list of fuzzy addresses, intended for providing suggestions as you type. |
ConsignmentsApi | cancelConsignmentById | POST /v1/carriers/{carrierName}/customers/{customerId}/consignments/{consignmentId}/cancellationrequests | Request cancellation of a Consignment by Id. |
ConsignmentsApi | getConsignmentById | GET /v1/carriers/{carrierName}/customers/{customerId}/consignments/{consignmentId} | Consignment by Id. |
ConsignmentsApi | getConsignmentsByParameters | GET /v1/carriers/{carrierName}/customers/{customerId}/consignments | Search consignments based on Consignment / Sender / Receiver details |
ConsignmentsApi | postConsignment | POST /v1/carriers/{carrierName}/customers/{customerId}/consignments | Upload consignment data. |
LabelsApi | getLabelByConsignmentId | GET /v1/carriers/{carrierName}/customers/{customerId}/consignments/{consignmentId}/labels | Consignment by Id. |
PickupRequestsApi | createPickupRequest | POST /v1/carriers/{carrierName}/customers/{customerId}/pickup-requests/pickup-location | Lodge a pickup request for the Carrier (carrierName) and customer (customerId) at the provided PickupLocationId |
PickupRequestsApi | createPickupRequestByGeo | POST /v1/carriers/{carrierName}/customers/{customerId}/pickup-requests/address | PickupRequest the pickup request based on an address |
RatesApi | getStandardRates | POST /v1/carriers/{carrierName}/customers/{customerId}/rates | Finds rates using the standard Weight or Volume model for a given query |
ServicesApi | getServiceLocations | GET /v1/service-locations | Return a list of service locations, optionally filter by location type and/or within a radius of a given point |
ServicesApi | getServices | GET /v1/services | Finds available services for a given query |
TrackingEventsApi | getTrackingEvents | GET /v1/carriers/{carrierName}/customers/{customerId}/consignments/{consignmentId}/items/{consignmentItemId}/tracking-events | Finds tracking events by using query string parameters |
TrackingEventsApi | getTrackingEventsAttachment | GET /v1/carriers/{carrierName}/customers/{customerId}/consignments/{consignmentId}/items/{consignmentItemId}/tracking-events/attachments | Finds attachment for a tracking event |
- Address
- AddressPickupRequest
- BasePlusItemRateRequest
- BasePlusItemRequest
- BreakdownComponent
- CancellationRequest
- CancellationRequestItem
- CarrierService
- CarrierServiceConditions
- CarrierServiceOptions
- CarrierServices
- Consignment
- ConsignmentItem
- ConsignmentItemRequestResponse
- ConsignmentLabel
- ConsignmentLabelRequest
- ConsignmentRequest
- ConsignmentRequestResponse
- Consignments
- CustomerReferences
- Event
- Item
- Match
- Notification
- Notifications
- PagedResult
- PickupLocationPickupRequest
- PickupRequestDetails
- ProblemDetails
- Rate
- RateOption
- RatesRequest
- Receiver
- Run
- SatchelItemRateRequest
- SatchelItemRequest
- Sender
- ServiceLocation
- ServiceLocationType
- ServiceLocations
- StandardItemRateRequest
- StandardItemRequest
- TrackingEvent
- TrackingEventAttachment
- TrackingEventBase
- TrackingEvents
- Type: OAuth
- Flow: application
- Authorization URL:
- Scopes:
- all: Grant all rights