QFV Third Party Interface class
Possible Methods
- __construct
- setTimeOut
- setUserAgent
- addSubscription
- getSubscriptions
- stopSubscription
- getMailboxInfo
- retrieve
- purge
- sendTextMessage
- sendFormMessage
- sendPositionPoll
- getFormDefinitions
- getDepots
- getVehicles
- getDrivers
- getDrivercards
- getTrailers
- addVehicle
- addDriver
- addTrailer
- modifyVehicle
- modifyDriver
- modifyTrailer
- deleteVehicle
- deleteDriver
- deleteTrailer
__construct
Default constructor
Parameters
- customer string (optional)
- username string (optional)
- password string (optional)
Return
void
setTimeOut
Set the timeout
Parameters
- seconds int
Return
void
setUserAgent
Set the user-agent for you application
It will be appended to ours
Parameters
- userAgent string
Return
void
addSubscription
The method creates a new data subscription for the specified user. Only one subscription for a specific data
type will be allowed. Attempts to create more subscriptions for the same data and under the same user
account will be ignored.
Using single-request subscriptions is highly recommended in the test phase, when client application is still
being developed, so there's still no need for continuous data inflow from QFV.
Parameters
- dataType string
- Type of data to subscribe to, possible values: Positions, Messages, MessageStatusUpdates, DriverEvents, DriverTotals, TrailerEvents, ETAEvents
- description string
- User-friendly description of a subscription
- subscriptionType string (optional)
- Type of subscription, possible values: Regular, SingleRequest
Return
int Identifier of a newly created subscription
getSubscriptions
To learn what subscriptions a specific user has created, one can use GetSubscriptions method of TPI Service.
Return
array
stopSubscription
To stop a subscription, one needs to know the subscription identifier, and call DeleteSubscription method of the TPI service
REMARK: this method is untested
Parameters
- id int
- Identifier of a subscription to delete
Return
bool true on success
getMailboxInfo
Before actual retrieving the subscribed data, one can poll the TPI service to obtain information whether there are any data to be retrieved.
Return
array
retrieve
The method returns all data that the specified user has subscribed, which has been registered in the system
since the previous call. All data is returned in one XML document, grouped per data type. After the data is
retrieved and returned, it is marked for removal from user's mailbox, unless markasread parameter has been
specified as false. Once marked for removal, this can happen at any moment, so there's no further guarantee
that this specific data will be available any more, and there is no way to retrieve it again.
REMARK: Not fully tested.
Parameters
- markAsRead bool (optional)
- Specifies whether retrieved data should be marked as read, so once retrieved, it will be removed from the mailbox
- maxCount int (optional)
- Maximal number of records to return. When greater than zero, only the specified number of the newest packets will be returned, while the rest will be just discarded. When zero specified, all packets in the mailbox will be returned.
Return
array
purge
The method will mark all specified data packets in user's mailbox as ready for removal.
From this moment packets are not available any more.
Parameters
- minPacketId int
- Packet identifier, start of a range of packets to delete
- maxPacketId int
- Packet identifier, end of a range of packets to delete
Return
bool true on success
sendTextMessage
The method submits a text message, which will be then sent to the specified recipients, and returns an
identifier of the message. Because messages are sent asynchronously, there is no guarantee that the
message has actually been sent at return from this method - the only thing that is sure is that the message
has been registered in the system and waits for further processing. If proper message delivery is of concern,
the returned message identifier can be used to track message status.
REMARK: Not implemented at this moment.
Parameters
- recipients array
- An array with the MSISDN identifiers of vehicles which should recieve the message
- sendAfter int
- UNIX-timestamp after which the message should be dispatched to the recipients
- requireReadReceipt bool
- When true, read receipt will be requested for the sent message
- text string
- Message text
Return
int Unique identifier of the newly created message
sendFormMessage
The method submits a form message, which will be then sent to the specified recipients, and returns an
identifier of the message. Because messages are sent asynchronously, there is no guarantee that the
message has actually been sent at return from this method - the only thing that is sure is that the message
has been registered in the system and waits for further processing. If proper message delivery is of concern,
the returned message identifier can be used to track message status.
REMARK: Not implemented at this moment.
Parameters
- recipients array
- An array with the MSISDN identifiers of vehicles which should recieve the message
- sendAfter int
- UNIX-timestamp after which the message should be dispatched to the recipients
- requireReadReceipt bool
- When true, read receipt will be requested for the sent message
- formNumber int
- Form definition number
- formVersion int
- Form version number
- values array
- An array of form field values, in order of their appearance in the form definition
- separator string (optional)
- Delimiter for form values
Return
int Unique identifier of the newly created message
sendPositionPoll
The method submits a position poll message, which will be then sent to the specified recipients, and returns an
identifier of the message. Because messages are sent asynchronously, there is no guarantee that the
message has actually been sent at return from this method - the only thing that is sure is that the message
has been registered in the system and waits for further processing. If proper message delivery is of concern,
the returned message identifier can be used to track message status.
REMARK: Not implemented at this moment.
Parameters
- recipients array
- An array with the MSISDN identifiers of vehicles which should recieve the message
- sendAfter int
- UNIX-timestamp after which the message should be dispatched to the recipients
Return
int Unique identifier of the newly created message
getFormDefinitions
To obtain form definitions, one needs to call GetFormDefinitions method of the TPI service.
REMARK: Not implemented at this moment.
Return
array
getDepots
Information about depots can be retrieved by GetDepots method of the TPI service. This information will be needed for
other operations, such as adding assets. Whenever we need to assign a newly created asset to some depot, we need to
specify an identifier of this depot, and this can be found in the dataset returned by GetDepots method.
Return
array
getVehicles
To retrieve a list of all vehicles, please use GetVehicles method.
Return
array
getDrivers
To retrieve a list of all drivers, please use GetDrivers method
Return
array
getDrivercards
To retrieve binary drivercard images, please use GetDrivercards method.
REMARK: this method is untested.
Parameters
- from int
- UNIX-timestamp for the period start
- until int
- UNIX-timestamp for the period end
- status string
- Status of the cards to download, possible values: New, Exported, All
Return
array
getTrailers
To retrieve a list of all trailers, please use GetTrailers method
Return
array
addVehicle
To add a vehicle, please use AddVehicle method
REMARK: Not tested, 404 as result.
Parameters
- msisdn string
- Vehicle identifier
- deviceType int
- Device type specification, possible values: 0: MCT, Eutelsat, 1: OXE GSM, 2: O1 TIS GSM, 3: OBU iveco GSM, 4: OV2 GSM/Eutelsat
- networkId int
- Network identifier, possible values: 0: EUTELSAT, 1: GSM
- depot int
- Depot identifier, if no depot should be assigned specify -1 as a value
- alias string (optional)
- Vehicle alias
- unitId string (optional)
- Unit identifier
Return
bool true on success
addDriver
To add a driver, please use AddDriver method
Parameters
- cardId string
- Driver identifier
- depot int
- Depot identifier, if no depot should be assigned specify -1 as a value
- alias string (optional)
- Driver alias
- firstname string (optional)
- Driver first name
- lastname string (optional)
- Driver last name
Return
bool true on success
addTrailer
To add a trailer, please use AddTrailer method
REMARK: untested, result is an error.
Parameters
- trailerid string
- depot int
- Depot identifier, if no depot should be assigned specify -1 as a value
- alias string
- Trailer alias
- unitid string
- Unit identifier
- trailerType int
- Trailer type identifier, possible values: 0: unknown, 1: trailer, 2: generic, 3: carrier, 4: thermoking
Return
bool true on success
modifyVehicle
To modify a vehicle, please use ModifyVehicle method
REMARK: Not implemented at this moment.
Parameters
- msisdn string
- Vehicle identifier
- depot int
- Depot identifier, if no depot should be assigned specify -1 as a value
- alias string
- Vehicle alias
- unitid string
- Unit identifier
Return
bool true on success
modifyDriver
To modify a driver, please use ModifyDriver method
REMARK: Not implemented at this moment.
Parameters
- cardid string
- Driver identifier
- depot int
- Depot identifier, if no depot should be assigned specify -1 as a value
- alias string
- Driver alias
- firstname string
- Driver first name
- lastname string
- Driver last name
Return
bool true on success
modifyTrailer
To modify a trailer, please use ModifyTrailer method
REMARK: Not implemented at this moment.
Parameters
- trailerid string
- Trailer identifier
- depot int
- Depot identifier, if no depot should be assigned specify -1 as a value
- alias string
- Trailer alias
- unitid string
- Unit identifier
- trailertype int
- Trailer type identifier, possible values: 0: unknown, 1: trailer, 2: generic, 3: carrier, 4: thermoking
Return
bool true on success
deleteVehicle
To delete a vehicle, please use DeleteVehicle method
REMARK: Not implemented at this moment.
Parameters
- msisdn string
- Vehicle identifier
Return
bool true on success
deleteDriver
To delete a driver, please use DeleteDriver method
REMARK: Not implemented at this moment.
Parameters
- cardid string
- Driver identifier
Return
bool true on success
deleteTrailer
To delete a trailer, please use DeleteTrailer method
REMARK: Not implemented at this moment.
Parameters
- trailerid string
- Trailer identifier
Return
bool true on success