Wiki source code of get_orders.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 Returns a list of all orders, created during the given timerange.
6 = Description =
7 **(% class="green mark" %)GET(%%) get_orders.php**?**company**=COMPANY_RTIKEY&**vehicle**VEHICLE_RTIKEY&**start**=YYYYMMDDHHMMSS&**end**=YYYYMMDDHHMMSS&**format**=json
8 = Parameters =
9 |=Parameter|=Description|=Type|=Note|=Mandatory
10 |company|RTI company key|string||yes
11 |vehicle|RTI vehicle key|string|either vehicle, group or import parameter|(yes)
12 |group|RTI group key|string|either vehicle, group or import parameter|(yes)
13 |import|RTI import key|string|either vehicle, group or import parameter|(yes)
14 |start|start of requested timerange|datestring|format: YYYYMMDDHHMMSS
15 (((
16 * the timerange between "//start//" and "//end//" is limited to 31 days
17 )))|yes
18 |end|end of requested timerange|datestring|format: YYYYMMDDHHMMSS
19 (((
20 * the timerange between "//start//" and "//end//" is limited to 31 days
21 )))|yes
22 |only_ondisplay_created|only return orders, created on a display|int|order creation at display is limited to specific Display types and has to be activated seperately
23 (((
24 * not set or value "0": Returns all created orders
25 * value "1": Returns only orders created on a display 
26 )))|no
27 |format|output format|string|'csv' (default) or 'json'|no
28
29 = Return =
30 Returns a **string**. In case of error it returns "(% class="error" %)**ERROR:Description**(%%)".
31 == CSV Format ==
32 The result of a correct request will be a csv (comma seperated values) formatted file containing always a head with column names as first line. The following lines containing the single entries.
33 Meta informations
34 |=Separator|Semicolon ( ; )
35 |=Delimiter|Double quote ( " )
36 |=Line break|0x0D 0x0A (CarriageReturn LineFeed)
37 |=Header|Line 1
38 |=Encoding|UTF-8
39
40 === Columns ===
41 |=Column|=Description|=
42 |DATE|date when order was created|Format: YYYY-MM-DD HH:MM:SS
43 |CUSTORDER|self defined order number|
44 |TEXT|order text|
45 |VEHICLE|assigned vehicle|
46 |DELETED_IN_VEHICLE|indicate, if order deleted on vehicle display|(((
47 * 0 = no
48 * 1 = yes
49 )))
50 |ACTIVE|indicate, if order is currently active|(((
51 * 0 = no
52 * 1 = yes
53 )))
54 |LAST_STATE_DATE|date of latest state change|Format: YYYY-MM-DD HH:MM:SS
55 |LAST_STATE_TEXT|state description|
56 |LAST_STATE_IDENT|custom ident (if set)|
57 |LAST_STATE_LANG|country code, if status was selected in another language on the display|
58 |LAST_STATE_TRANS|translation of status text, if status was selected in another language on the display|
59 |NAV_CUSTOMER|customer name|
60 |NAV_TEXT|target adress|
61 |NAV_LAT|geocoordinate for target adress (Latitude)|
62 |NAV_LON|geocoordinate for target adress (Longitude)|
63 |FORM_NAME|assigned user defined form|
64 |META|meta info|
65 |RTI_IDENT|RTI Ident|
66
67 === JSON Format ===
68 === JSON Format ===
69
70 {{code language="js"}}[
71 {
72 "create_date": "2022-03-15 09:43:30",
73 "custom_order_number": "ExampleNr",
74 "text": "Beispieltext",
75 "vehicle": {
76 "name": "YT 120",
77 "rtiIdent": "YT 120 Ident"
78 },
79 "is_deleted": false,
80 "is_active": true,
81 "last_state": {
82 "date": "2022-03-15 09:45:44",
83 "text": "start",
84 "custom_id": "",
85 "language": "",
86 "translations": ""
87 },
88 "target_information": {
89 "customer": "Nico@home",
90 "address": "Am Wuesteberg 3, 01723 Kesselsdorf, D",
91 "lat": 51.0096,
92 "lon": 13.8376,
93 "arrival_time_planned": "2022-03-15 16:00:00"
94 },
95 "form": {
96 "name": "Fotos"
97 },
98 "meta": ""
99 }
100 ]{{/code}}
101
102 === Example ===
103 **return in csv**
104 {{code language="java"}}"DATE";"CUSTORDER";"TEXT";"VEHICLE";"DELETED_IN_VEHICLE";"ACTIVE";"LAST_STATE_DATE";"LAST_STATE_TEXT";"NAV_CUSTOMER";"NAV_TEXT";"NAV_LAT";"NAV_LON";"META";"RTI_IDENT"
105 "2012-12-27 14:39:00";"ORDER1";"TEXT1";"FZG1";"1";"0";"2012-12-27 13:44:44";"Auftrag im Display gelöscht";"";"";"";"";"";"Ident 1"
106 "2012-12-27 13:42:00";"ORDER2";"TEXT2";"FZG1";"0";"1";"2012-12-27 13:28:29";"Start";"";"";"";"";"";"Ident 1"
107 "2012-12-27 12:03:34";"ORDER3";"TEXT3";"FZG2";"1";"0";"2013-01-11 15:57:50";"Erledigt";"YellowFox";"D-01723 Kesselsdorf Am Wüstberg 3";"51.036307";"13.598907";"";"Ident 1"
108 "2012-12-27 12:03:15";"ORDER4";"TEXT4";"FZG2";"0";"1";"2012-12-27 12:04:03";"Angenommen";"YellowFox";"D-01723 Kesselsdorf Am Wüstberg 3";"51.036307";"13.598907";"";"Ident 1"{{/code}}
109
110 = Example calls =
111 **All orders sent by or to a vehicle**
112 {{code language="java"}}https://map.yellowfox.de/rti/get_orders.php?company=COMPANY_RTIKEY&VEHICLE=VEHICLE_RTIKEY&start=YYYYMMDDHHMMSS&end=YYYYMMDDHHMMSS
113
114 https://map.yellowfox.de/rti/get_orders.php?company=COMPANY_RTIKEY&VEHICLE={"type":"car_ident","groupKey":"GROUP_RTIKEY","ident":"VEHICLE_IDENT"}&start=YYYYMMDDHHMMSS&end=YYYYMMDDHHMMSS{{/code}}
115
116 **All orders created on any vehicle**
117 {{code language="java"}}https://map.yellowfox.de/rti/get_orders.php?company=COMPANY_RTIKEY&import=IMPORT_RTIKEY&start=YYYYMMDDHHMMSS&end=YYYYMMDDHHMMSS&only_ondisplay_created=1{{/code}}
118
119 **All orders sent or created on any vehicle of the vehicle group**
120 {{code language="java"}}https://map.yellowfox.de/rti/get_orders.php?company=COMPANY_RTIKEY&group=IMPORT_GROUPKEY&start=YYYYMMDDHHMMSS&end=YYYYMMDDHHMMSS{{/code}}
121