Skip to content

Freightways Customer Integration API exported from Swagger Hub

Notifications You must be signed in to change notification settings

NOKNOKSoftware/FreightwaysAPI-PHP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freightways PHP API

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

Requirements

PHP 5.5 and later

Installation & Usage

Composer

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

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/FreightwaysAPI/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

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;
}
?>

Documentation for API Endpoints

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

Documentation For Models

Documentation For Authorization

oAuth2

  • Type: OAuth
  • Flow: application
  • Authorization URL:
  • Scopes:
  • all: Grant all rights

Author

About

Freightways Customer Integration API exported from Swagger Hub

Resources

Stars

Watchers

Forks

Packages

No packages published