Introduction
Welcome on the Parking Ai API Guide! It describes who to use our API, in version 1, where you will find data about parkings.
Login
Example Request
$options = array (
"location" => 'https://universal.parking.ai/authentication.php',
"uri" => 'https://universal.parking.ai',
"trace" => 1
);
try {
$client = new SoapClient(NULL, $options);
$token = $client->Login(
new SoapParam($customerID, "customerID"),
new SoapParam($customerKey, "customerKey"));
} catch (SoapFault $ex) {
echo $ex->faultcode . ': ' . $ex->getMessage();
}
String GUID Response
111222333444555666...
Parameters
| Property | Type | Required | Description |
|---|---|---|---|
customerID |
GUID | required | Identifier API |
customerKey |
GUID | required | API Key |
Returns
Returns a session Token.
SearchBooking
Example Request
class headerSoap {
public $_Token;
public $_Language;
public function __construct($token, $language) {
$this->_Token = $token;
$this->_Language = $language;
}
}
$token = '111222333444555666...'//The session token is obtained from the Login method
$language = 'FR';
$SoapTokenObj = new headerSoap($token, $language);
$soapHeaders[] = new SoapHeader('http://schemas.xmlsoap.org/ws/2002/07/utility', 'authenticationHeader', $SoapTokenObj);
$options = array (
"location" => 'https://universal.parking.ai/booking.php',
"uri" => 'https://universal.parking.ai',
"trace" => 1
);
try {
$client = new SoapClient(NULL, $options);
$client->__setSoapHeaders($soapHeaders);
$response = $client->SearchBooking(
new SoapParam($parkId, "parkId"),
new SoapParam($dateFrom, "dateFrom"),
new SoapParam($dateTo, "dateTo"),
new SoapParam($vehicleType, "vehicleType"),
new SoapParam($passenger, "passenger"),
new SoapParam('', "orderId"),
new SoapParam('', "bookingId"),
new SoapParam($longitude, "longitude"),
new SoapParam($latitude, "latitude")
);
} catch (SoapFault $ex) {
echo $ex->faultcode . ': ' . $ex->getMessage();
}
Object Response
stdClass Object
(
[parking] => stdClass Object
(
[ItemId] => 3987
[ItemLabel] => 319269
[ItemDescription] => Forfait 1 jour
[CarPlaceAvailable] => available
[GlobalAmount] => 9.00
)
)
Parameters Header
| Property | Type | Required | Description |
|---|---|---|---|
_Token |
GUID | required | Session Token |
_Language |
Language Code | required | Language |
Parameters Body
| Property | Type | Required | Description |
|---|---|---|---|
parkId |
Integer | required | Unique park ID |
dateFrom |
DateTime | required | Parking entry |
dateTo |
DateTime | required | Parking exit |
vehicleType |
Integer | required | Type of vehicle, default: 1 (car) |
passenger |
Integer | optional | Number of passengers |
orderId |
GUID | optional | ID order to modify |
bookingId |
Alphanumeric | optional | ID booking to modify |
longitude |
Numeric | optional | Geographical coordinates |
latitude |
Numeric | optional | Geographical coordinates |
Returns
Returns a Parking object.
| Property | Type | Description |
|---|---|---|
parking |
Parking | Parking data |
RequestBooking
Example Request
class headerSoap {
public $_Token;
public $_Language;
public function __construct($token, $language) {
$this->_Token = $token;
$this->_Language = $language;
}
}
$token = '111222333444555666...'//The session token is obtained from the Login method
$language = 'FR';
$SoapTokenObj = new headerSoap($token, $language);
$soapHeaders[] = new SoapHeader('http://schemas.xmlsoap.org/ws/2002/07/utility', 'authenticationHeader', $SoapTokenObj);
$options = array (
"location" => 'https://universal.parking.ai/booking.php',
"uri" => 'https://universal.parking.ai',
"trace" => 1
);
try {
$client = new SoapClient(NULL, $options);
$client->__setSoapHeaders($soapHeaders);
$response = $client->RequestBooking(
new SoapParam($parkId, "parkId"),
new SoapParam($dateFrom, "dateFrom"),
new SoapParam($dateTo, "dateTo"),
new SoapParam($vehicleType, "vehicleType"),
new SoapParam($passenger, "passenger"),
new SoapParam($customerReference, "customerReference"),
new SoapParam($customerLastname, "customerLastname"),
new SoapParam($customerFirstname, "customerFirstname"),
new SoapParam($customerPhone, "customerPhone"),
new SoapParam($customerEmail, "customerEmail"),
new SoapParam($vehiclePlate, "vehiclePlate"),
new SoapParam($airport, "airport"),
new SoapParam($bookingId, "bookingId")
);
} catch (SoapFault $ex) {
echo $ex->faultcode . ': ' . $ex->getMessage();
}
Object Response
stdClass Object
(
[orderId] => 001007857900
)
Parameters Header
| Property | Type | Required | Description |
|---|---|---|---|
_Token |
GUID | required | Session Token |
_Language |
Language Code | required | Language |
Parameters Body
| Property | Type | Required | Description |
|---|---|---|---|
parkId |
Integer | required | Unique park ID |
dateFrom |
DateTime | required | Parking entry |
dateTo |
DateTime | required | Parking exit |
vehicleType |
Integer | required | Type of vehicle, default: 1 (car) |
passenger |
Integer | optional | Number of passengers |
customerReference |
String | optional | Customer Reference |
customerLastName |
String | optional | Customer lastname |
customerFirstname |
String | optional | Customer firstname |
customerPhone |
String | optional | Customer phone number |
customerEmail |
String | optional | Customer Email |
vehiclePlate |
String | optional | Vehicle Plate |
airport |
String | optional | Airport name |
bookingId |
Alphanumeric | required | Platform ID booking |
orderId |
GUID | optional | ID order to modify |
Returns
Returns a object. It contains the following properties.
| Property | Type | Description |
|---|---|---|
orderId |
GUID | Order ID |
ConfirmBooking
Example Request
class headerSoap {
public $_Token;
public $_Language;
public function __construct($token, $language) {
$this->_Token = $token;
$this->_Language = $language;
}
}
$token = '111222333444555666...'//The session token is obtained from the Login method
$language = 'FR';
$SoapTokenObj = new headerSoap($token, $language);
$soapHeaders[] = new SoapHeader('http://schemas.xmlsoap.org/ws/2002/07/utility', 'authenticationHeader', $SoapTokenObj);
$options = array (
"location" => 'https://universal.parking.ai/booking.php',
"uri" => 'https://universal.parking.ai',
"trace" => 1
);
try {
$client = new SoapClient(NULL, $options);
$client->__setSoapHeaders($soapHeaders);
$response = $client->ConfirmBooking(
new SoapParam($orderId, "orderID"),
new SoapParam($confirm, "confirm")
);
} catch (SoapFault $ex) {
echo $ex->faultcode . ': ' . $ex->getMessage();
}
Object Response
stdClass Object
(
[Result] => true
)
Parameters Header
| Property | Type | Required | Description |
|---|---|---|---|
_Token |
GUID | required | Session Token |
_Language |
Language Code | required | Language |
Parameters Body
| Property | Type | Required | Description |
|---|---|---|---|
orderId |
GUID | required | Order ID |
confirm |
string | required | True : confirm the order ; False : cancel the order |
Returns
Returns a object. It contains the following properties.
| Property | Type | Description |
|---|---|---|
Result |
string | true : Succesful confirmation |
GetOrder
Example Request
class headerSoap {
public $_Token;
public $_Language;
public function __construct($token, $language) {
$this->_Token = $token;
$this->_Language = $language;
}
}
$token = '111222333444555666...'//The session token is obtained from the Login method
$language = 'FR';
$SoapTokenObj = new headerSoap($token, $language);
$soapHeaders[] = new SoapHeader('http://schemas.xmlsoap.org/ws/2002/07/utility', 'authenticationHeader', $SoapTokenObj);
$options = array (
"location" => 'https://universal.parking.ai/booking.php',
"uri" => 'https://universal.parking.ai',
"trace" => 1
);
try {
$client = new SoapClient(NULL, $options);
$client->__setSoapHeaders($soapHeaders);
$response = $client->GetOrder(
new SoapParam($orderId, "orderID")
);
} catch (SoapFault $ex) {
echo $ex->faultcode . ': ' . $ex->getMessage();
}
Object Response
stdClass Object
(
[OrderId] => 001007857900
[OrderDate] => 2017/09/14 17:45
[OrderStatus] => CONFIRM
[BookingId] => BOOK002
[BookingStatus] => CONFIRM
[ItemLabel] => Forfait 1 jour
[DateFrom] => 2017/10/19 15:00
[DateTo] => 2017/10/20 15:00
[vehicleType] => Voiture
[CustomerReference] => CUST002
[CustomerLastName] => Bautista
[CustomerFirstName] => EfraĆn
[CustomerPhone] => +59173077777
[CustomerEmail] => efrain@gmail.com
[Vatrate] => 19.9
[ComissionPercent] => 10
[ComissionAmount] => 0.90
[BookingAmount] => 9.00
[AccessCode] => BOOK002
[CancelDate] =>
[CancelAmount] =>
[OrderIdUpdate] =>
[BookingIdUpdate] =>
[VehiclePlate] => AAA 123
[Airport] => Paris
)
Parameters Header
| Property | Type | Required | Description |
|---|---|---|---|
_Token |
GUID | required | Session Token |
_Language |
Language Code | required | Language |
Parameters Body
| Property | Type | Required | Description |
|---|---|---|---|
orderId |
GUID | required | Order ID |
Returns
Returns an object. It contains the following properties.
| Property | Type | Description |
|---|---|---|
OrderId |
GUID | Order Id data |
OrderDate |
Datetime | Order date |
OrderStatus |
string | Order status |
ItemLabel |
string | Product Name |
DateFrom |
Datetime | Parking entry |
DateTo |
Datetime | Parking exit |
vehicleType |
String | Type of vehicle |
CustomerReference |
String | Customer reference |
CustomerLastName |
String | Customer lastname |
CustomerFirstName |
String | Customer firstname |
CustomerPhone |
String | Customer phone number |
CustomerEmail |
String | Customer email |
Vatrate |
Decimal | % rate TVA |
ComissionPercent |
Decimal | % commission |
ComissionAmount |
Decimal | Commission amount in € TTC |
BookingAmount |
Decimal | Booking amount in € TTC |
AccessCode |
String | Access code parking |
CancelDate |
Datetime | Date cancelation | CancelAmount |
Decimal | Cancel amount € TTC |
OrderIdUpdate |
GUID | ID Order from booking update |
BookingIdUpdate |
String | ID Booking issued fro update |
VehiclePlate |
String | Vehicle plate |
Airport |
String | Airport name |
Cancel
Example Request
class headerSoap {
public $_Token;
public $_Language;
public function __construct($token, $language) {
$this->_Token = $token;
$this->_Language = $language;
}
}
$token = '111222333444555666...'//The session token is obtained from the Login method
$language = 'FR';
$SoapTokenObj = new headerSoap($token, $language);
$soapHeaders[] = new SoapHeader('http://schemas.xmlsoap.org/ws/2002/07/utility', 'authenticationHeader', $SoapTokenObj);
$options = array (
"location" => 'https://universal.parking.ai/booking.php',
"uri" => 'https://universal.parking.ai',
"trace" => 1
);
try {
$client = new SoapClient(NULL, $options);
$client->__setSoapHeaders($soapHeaders);
$response = $client->CancelBooking(
new SoapParam($orderId, "orderID"),
new SoapParam($bookingId, "bookingID"),
new SoapParam($cancelAmount, "cancelAmount")
);
} catch (SoapFault $ex) {
echo $ex->faultcode . ': ' . $ex->getMessage();
}
Object Response
stdClass Object
(
[Result] => true
)
Parameters Header
| Property | Type | Required | Description |
|---|---|---|---|
_Token |
GUID | required | Session Token |
_Language |
Language Code | required | Language |
Parameters Body
| Property | Type | Required | Description |
|---|---|---|---|
orderID |
GUID | required | ID order |
bookingID |
Integer | required | ID booking |
cancelAmount |
Integer | optional | Amount to be returned |
Returns
Returns an object. It contains the following properties.
| Property | Type | Description |
|---|---|---|
Result |
string | true : Successful cancel |
Objects
Parking
Parking Object Example
stdClass Object
(
[parking] => stdClass Object
(
[ItemId] => 3987
[ItemLabel] => 319269
[ItemDescription] => Forfait 1 jour
[CarPlaceAvailable] => available
[GlobalAmount] => 9.00
)
)
| Attributes | Type | Description |
|---|---|---|
ItemId |
Integer | ID Item |
ItemLabel |
string | Product code |
ItemDescription |
String | Product name |
CarPlaceAvailable |
String | Availability |
GlobalAmount |
Decimal | Price in € (VAT included) |
Formats
DateTime
The Parking Ai API support the next Datetime format : YYYY/MM/DD HH:mm
| Example |
|---|
| 2017/08/19 12:00 |
Language codes
The language code follows the ISO 639-1 standard. All the values in our API can be find below.
| Language Code | Language Name |
|---|---|
FR
|
French |
ES
|
Spanish |
EN
|
English |
Prices and currencies
Prices are always a float value and associated with a currency.
Faults
SOAP Fault Example
SoapFault Object
(
[message:protected] => Token failed
[string:Exception:private] =>
[code:protected] => 0
[file:protected] => /XXXX/YYYY/.../file.php
[line:protected] => 105
[trace:Exception:private] => Array
(
[0] => Array
(
[file] => /XXXX/YYYY/.../file.php
[line] => 105
[function] => __call
[class] => SoapClient
[type] => ->
[args] => Array
(
[0] => SearchBooking
[1] => Array
(
[0] => SoapParam Object
(
[param_name] => parkId
[param_data] => 0000
)
[1] => SoapParam Object
(
[param_name] => dateFrom
[param_data] => 2017/10/19 12:00
)
[2] => SoapParam Object
(
[param_name] => dateTo
[param_data] => 2017/10/27 12:00
)
[3] => SoapParam Object
(
[param_name] => vehicleType
[param_data] => 1
)
)
)
)
[1] => Array
(
[file] => /XXXX/YYYY/.../file.php
[line] => 105
[function] => SearchBooking
[class] => SoapClient
[type] => ->
[args] => Array
(
[0] => SoapParam Object
(
[param_name] => parkId
[param_data] => 0000
)
[1] => SoapParam Object
(
[param_name] => dateFrom
[param_data] => 2017/10/19 12:00
)
[2] => SoapParam Object
(
[param_name] => dateTo
[param_data] => 2017/10/27 12:00
)
[3] => SoapParam Object
(
[param_name] => vehicleType
[param_data] => 1
)
)
)
)
[previous:Exception:private] =>
[faultstring] => Token failed
[faultcode] => TOKEN_FAILED
)
When a SOAP Fault happen, 2 elements explain the error:
faultcode: Code of errorfaultstring: A string message that explains the error
SOAP Faults
INCORRECT_PARAMETER |
Wrong parameter |
LOGIN_FAILED |
Wrong identifier |
TOKEN_FAILED |
Invalid Token |
TOKEN_EXPIRED |
Token expired |
INCORRECT_PARAMETER |
Wrong parameter |
NO_RESULT_FOR_THESE_CRITERIA |
No results |
ERROR_DATE |
Invalid parameter |
BOOKING_FULL |
Parking is full |
ERROR_DATE_INTERVAL |
Invalid Parameter |
ERROR_STATUS |
Error in status |
WRONG_ACCESS |
No access to parking |
ORDERS_NOT_VALID |
Invalid Order |