A minimal Electio client
This PHP package is automatically generated by the Swagger Codegen project:
- API version: 1.0.12
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.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/chrishemmings/electio.git"
}
],
"require": {
"chrishemmings/electio": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/./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');
// Configure API key authorization: Ocp-Apim-Subscription-Key
$config = ChrisHemmings\Electio\Configuration::getDefaultConfiguration()->setApiKey('Ocp-Apim-Subscription-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ChrisHemmings\Electio\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Ocp-Apim-Subscription-Key', 'Bearer');
$apiInstance = new ChrisHemmings\Electio\Api\AllocationApi(
// 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(),
$config
);
$electio_api_version = "1.1"; // string | Electio API Version
$allocation = new \ChrisHemmings\Electio\Client\Model\AllocateWithCarrierService(); // \ChrisHemmings\Electio\Client\Model\AllocateWithCarrierService | Consignment to create
try {
$result = $apiInstance->allocateWithCarrierService($electio_api_version, $allocation);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AllocationApi->allocateWithCarrierService: ', $e->getMessage(), PHP_EOL;
}
?>
All URIs are relative to https://api.electioapp.com
Class | Method | HTTP request | Description |
---|---|---|---|
AllocationApi | allocateWithCarrierService | PUT /allocation/allocateWithCarrierService | Allocate a consignment to a specified delivery service |
AllocationApi | allocateWithQuote | PUT /allocation/{consignmentReference}/allocatewithquote/{quoteReference} | Allocate consignment using quote reference |
CarriersApi | carriers | GET /carriers/getcarriers | Get carriers |
ConsignmentApi | createConsignment | POST /consignments | Create a consignment |
ConsignmentApi | getConsignment | GET /consignments/{consignmentReference} | Fetch a consignment by reference |
ConsignmentApi | getConsignmentSummary | GET /consignments/summary | Fetch a summary of consignment statuses |
ConsignmentApi | getConsignmentWithMetadata | GET /consignments/getconsignmentwithmetadata/{consignmentReference} | Fetch a consignment by reference with metadata |
ConsignmentApi | searchConsignments | GET /consignments/{take}/{skip} | Search for consignments |
DeliveryOptionsApi | getConsignmentDeliveryOptions | GET /deliveryoptions/consignment/{consignmentReference} | Fetch delivery options for a consignment |
DeliveryOptionsApi | getDeliveryOptions | POST /deliveryoptions | Get delivery options for passed consignment details |
DeliveryOptionsApi | getDeliveryOptionsHeartbeat | POST /deliveryoptions/heartbeat | Get delivery options for passed consignment details |
DeliveryOptionsApi | selectDeliveryOption | POST /deliveryoptions/select/{deliveryOptionReference} | Use a delivery option that was generated from a previous call to /deliveryoptions |
DocumentsApi | getConsignmentDocuments | GET /consignments/docs/{consignmentReference} | Fetch customs documents |
DocumentsApi | getConsignmentLabels | GET /documents/labels/{consignmentReference} | Fetch labels for a specified consignment |
DocumentsApi | getPackageDocument | GET /consignments/docs/{customsDocumentType}/{consignmentReference}/{packageReference} | Fetch specific document type for given Parcel and Package |
ManifestingApi | manifest | PUT /consignments/manifest | Manifest the passed consignment numbers |
QuotesApi | getQuotes | POST /quotes | Get delivery option quotes |
TrackingApi | getConsignmentTracking | GET /tracking/{consignmentReference} | Fetch tracking information for given reference |
- Address
- AddressType
- AllocateWithCarrierResponse
- AllocateWithCarrierService
- AllocateWithQuoteResponse
- Allocation
- ApiLink
- Barcode
- Carrier
- CategoryType
- Consignment
- ConsignmentDocumentsResponse
- ConsignmentLeg
- ConsignmentSearchResponse
- ConsignmentState
- ConsignmentSummary
- Contact
- Country
- CreateConsignment
- CreateConsignmentResponse
- Currency
- CustomsDocumentation
- DeliveryOption
- DeliveryOptionsRequest
- DeliveryOptionsResponse
- DeliveryWindow
- Dimensions
- Document
- EstimatedDeliveryDate
- EventViewModel
- FailedAllocation
- IsoCode
- Item
- LabelResponse
- LatitudeLongitude
- LocationInformation
- ManifestConsignmentsRequest
- MetaData
- Money
- Package
- PackageViewModel
- Quote
- QuotesResponse
- Rate
- RequestedDeliveryDate
- RequiredDeliveryDate
- ResponseError
- ResponseErrorDetail
- SelectDeliveryOptionResponse
- ShippingTerms
- SummaryItem
- SummaryResponse
- TrackingResponse
- UnqualifiedService
- VatRate
- VatRateType
- Weight
- Type: API key
- API key parameter name: Ocp-Apim-Subscription-Key
- Location: HTTP header