Wiki source code of do_order.php

Last modified by YellowFox_RD on 2024/12/19 10:11

Show last authors
1 (% class="box" %)
2 (((Table of Contents)))
3 {{toc/}}
4
5 (% class="box" %)
6 (((
7 You can use this function to send simple service orders to YellowFox tablets. These contain only one destination and an order text. The order can return status messages and you are able to attach a form, which the driver has to fill-out after executing the order. You can e.g. use this to model delivery notes.
8 All customers who need more than this can use the Tour Webservice, located at [[https:~/~/yfox.li/tour>>https://yfox.li/tour]]. The Tour Webservice is already included in the YellowFox subscription and can be used for free after activation. Beside all functions that are supported by orders, tours offer a lot more. You are able to define multiple pick-up and delivery stations or use YellowFox workflows. By using workflows you can define precisely what the driver has to do in which order. Multi-langual status messages are also possible, as well as multiple shipments for a single address. Even by building a tour with just one destination it will still be much more  powerful than a simple order.
9 To unlock to Tour Webservice for free or get further information and help, please contact the YellowFox support. 
10 )))
11 Creates an order and sends it to the vehicle.
12 = Description =
13 **//**(% class="blue mark" %)POST(%%) **//do_order.php****?company**=//COMPANY_RTIKEY//**&vehicle**=//VEHICLE_RTIKEY//**&customorderid**=//NR123XYZ//**&order****text**=//Auftragstext&**lat**=51.0374&**lon**=13.587813//
14 = Parameter =
15 |=Parameter|=Description|=Type|=Note|=Mandatory
16 |company|RTI company key|string||yes
17 |customorderid|user-defined order number|string|max. 20 chars (will not be checked for duplicates)|yes
18 |ordertext|order text|string|max. 500 chars (CE Display, Tablet)
19 max. 200 chars (all other displays)|yes
20 |vehicle|RTI vehicle key|string||yes
21 |lat|Latitude of navigation target|float|-90 to +90 in WGS84 format|yes for Garmin displays
22 |lon|Longitude of navigation target|float|-180 to +180 in WGS84 format|yes for Garmin displays
23 |street|street name of navigation target|string|max. 100 chars (reduces the max char count of order text for garmin displays)|no
24 |hnr|house number of navigation target|string|max. 10 chars (reduces the max char count of order text for garmin displays)|no
25 |zipcode|zipcode of navigation target|string|max. 10 chars (reduces the max char count of order text for garmin displays)|no
26 |city|city of navigation target|string|max. 100 chars (reduces the max char count of order text for garmin displays)|no
27 |country|country code of navigation target|string|max. 3 chars (reduces the max char count of order text for garmin displays)|no
28 |customername1|Customer Name 1|string|max. 100 chars (will be displayed only on Fleet V3)|no
29 |customername2|Customer Name 2|string|max. 100 chars (will be displayed only on Fleet V3)|no
30 |target_time|target arrival time|datestring|Format: YYYYMMDDHHMM
31 reduces maximum char count of order text down by 18 chars|no
32 |sortnumber|sort number|int|Will be written in front of the order text in brackets. Reduces the max char count of order text + 2 chars.|no
33 |formname|name of customer form which will be opened after order has been executed|string|max. 20 chars (available for CE Displays at Version 1.1.67 and Tablets)
34 (% class="box" %)
35 (((
36 **Attention
37 **Form must be [[configured>>doc:YellowFox Standard Portal.Verwaltung.Display Konfiguration.Konfiguration benutzerdefinierte Formulare.WebHome]]!
38 )))|no
39 |textlayout|layout of order text at display
40 (only available for Garmin FMI displays)|int|(((
41 * 0 = [sort number][addresstext][target time]order text (default)
42 * 1 = [sort number]order text[addresstext][target time ] (only for Garmin FMI displays)
43 * 2 = [sort number][target time][addresstext]order text(only for Garmin FMI displays)
44 )))
45 (% class="box" %)
46 (((
47 **Attention
48 **sort number, order text and target time must be given if these values should be transmitted
49 )))|no
50 |save_in_pool|Saves the order only in the order pool and does not send it to a vehicle.|int|0 = is not stored in the order pool and requires a vehicle
51 1 = is stored in the order pool, vehicle key is not required, but the import key is|no
52 |meta|meta info|string|This info will be returned on accessing the order via get_orders.php to be able to track this order.|no
53 |attachments|file attachments|string|UUIDs of desired file attachments, comma-separated
54 You get these UUIDs while uploading a file via file_storage/upload_file.php or you can access them via file_storage/get_overview.php|no
55
56 = Return =
57 A **string** will be returned. If the request was successful "**OK**". If the request failed "(% class="error" %)**ERROR:Description**(%%)".
58 = Example calls =
59 **Simple order**
60 {{code language="java"}}https://map.yellowfox.de/rti/do_order.php?company=COMPANY_RTIKEY&vehicle=VEHICLE_RTIKEY&customorderid=NR1234&ordertext=Auftragstext
61
62 https://map.yellowfox.de/rti/do_order.php?company=COMPANY_RTIKEY&vehicle={"type":"car_ident","groupKey":"GROUP_RTIKEY","ident":"VEHICLE_IDENT"}&customorderid=NR1234&ordertext=Auftragstext{{/code}}
63
64 **Example with navigation target and target time**
65 {{code language="java"}}https://map.yellowfox.de/rti/do_order.php?company=COMPANY_RTIKEY&vehicle=VEHICLE_RTIKEY&customorderid=NR1234&ordertext=Auftragstext&lat=51.0374&lon=13.587813&street=Hauptstr&hnr=3&zipcode=01723&city=Kesselsdorf&country=D&target_time=201411310800
66
67 https://map.yellowfox.de/rti/do_order.php?company=COMPANY_RTIKEY&vehicle={"type":"car_ident","groupKey":"GROUP_RTIKEY","ident":"VEHICLE_IDENT"}&customorderid=NR1234&ordertext=Auftragstext&lat=51.0374&lon=13.587813&street=Hauptstr&hnr=3&zipcode=01723&city=Kesselsdorf&country=D&target_time=201411310800{{/code}}
68
69 **Example with navigation target + form + sort number + textlayout**
70 {{code language="java"}}https://map.yellowfox.de/rti/do_order.php?company=COMPANY_RTIKEY&vehicle=VEHICLE_RTIKEY&customorderid=NR1234&ordertext=Auftragstext&lat=51.0374&lon=13.587813&street=Hauptstr&hnr=3&zipcode=01723&city=Kesselsdorf&country=D&sortnumber=1&formname=Abholung&textlayout=2
71
72 https://map.yellowfox.de/rti/do_order.php?company=COMPANY_RTIKEY&vehicle={"type":"car_ident","groupKey":"GROUP_RTIKEY","ident":"VEHICLE_IDENT"}&customorderid=NR1234&ordertext=Auftragstext&lat=51.0374&lon=13.587813&street=Hauptstr&hnr=3&zipcode=01723&city=Kesselsdorf&country=D&sortnumber=1&formname=Abholung&textlayout=2{{/code}}
73