Wiki source code of do_message.php

Last modified by YellowFox_RD on 2025/01/23 10:13

Show last authors
1 (% class="box" %)
2 (((
3 Table of Contents
4 )))
5
6 {{toc/}}
7
8 Send a message to a single vehicle, a group or to all (import).
9
10 = Description =
11
12 (% class="blue mark" %)//**POST**//(%%)//** do_message.php?company**//=COMPANY_RTIKEY**&vehicle**=VEHICLE_RTIKEY**//&messagetext//**=Message//**&language**//=gbr//**&responsetype**//=2//**&format**//=xml//**&freeresponses[]**//=Montag**&freeresponses[]**=Dienstag**&dispatcher**=Absender
13
14 = Parameter =
15
16 |=Parameter|=Description|=Type|=Note|=Mandatory
17 |company|RTI company key|string| |yes
18 |vehicle|RTI vehicle key|string|either vehicle, group or import parameter|(yes)
19 |group|RTI group key|string|either vehicle, group or import parameter|(yes)
20 |import|RTI import key|string|either vehicle, group or import parameter|(yes)
21 |messagetext| |string|maximal text length:(((
22 * CE-displays + android fleet: 500 signs
23 * all other displays: 200 signs
24 )))|yes
25 |responsetype|type of the response|integer|1 = no answer given (standard)
26 2 = confirmation expected
27 3 = yes-/no-answer expected
28 4 = reply template (only for fleet-displays version higher 3.0)|no
29 |freeresponses|reply template|array|necessary for responsetype = 4|no
30 |language|language|string|only for responsetypes 2 and 3 necessary
31 supported params: deu (standard), gbr, ndl, fra, ita|no
32 |format|format of the result|string|format of the result from the interface
33 supported formats: csv (standard), xml, json|no
34 |dispatcher|Name of dispatcher|string|maximal text length: 100 signs
35 only android fleet displays|no
36 |attachments|file attachments|string|UUIDs of desired file attachments, comma-separated
37 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
38
39 = Return =
40
41 By default, a **CSV string** is returned which contains the evaluation for each vehicle and the **SESSIONKEY** for successful dispatch. If the mandatory parameters are missing, an "(% class="error" %)**ERROR: Description**(%%)" is returned.
42
43 == CSV-Format ==
44
45 === Meta informations ===
46
47 |=Separator|Semicolon ( ; )
48 |=Delimiter|Double quote ( " )
49 |=Line break|0x0D 0x0A (CarriageReturn LineFeed)
50 |=Header|Line 1
51
52 === Columns ===
53
54 |=Column|=Description
55 |CAR|Vehicle-Name
56 |RESULT|Result of the action
57 |SESSIONKEY|Sessionkey of the message
58
59 === Example ===
60
61 **Result format as CSV**
62 {{code language="java"}}"CAR";"RESULT";"SESSIONKEY"
63 "Car 1";"ERROR_HARDWARE_COMBINATION_NOT_SUPPORTED";""
64 "Car 2";"OK";"8a810da98bc0583af5959af0e8dde59g"
65 "Car 3";"ERROR_HARDWARE_DONT_SHOW_RESPONSETYPE_3";""{{/code}}
66
67 == XML Format ==
68
69 **Result format as XML**
70 {{code language="php"}}<?xml version="1.0" encoding="UTF-8" standalone="no"?>
71 <!DOCTYPE yf_domessage SYSTEM "https://map.yellowfox.de/rti/dtd/yf_domessage.dtd">
72 <yf_domessage>
73 <message>
74 <car>Car 1</car>
75 <result>ERROR_HARDWARE_COMBINATION_NOT_SUPPORTED</result>
76 <sessionkey></sessionkey>
77 </message>
78 <message>
79 <car>Car 2</car>
80 <result>OK</result>
81 <sessionkey>8a810da98bc0583af5959af0e8dde59g</sessionkey>
82 </message>
83 <message>
84 <car>Car 3</car>
85 <result>ERROR_HARDWARE_DONT_SHOW_RESPONSETYPE_3</result>
86 <sessionkey></sessionkey>
87 </message>
88  </yf_domessage>{{/code}}
89
90 == JSON Format (RFC 4627) ==
91
92 **Result format as JSON**
93 {{code language="java"}}[{"car":"Car 1","result":"ERROR_HARDWARE_COMBINATION_NOT_SUPPORTED"},{"car":"Car 2","result":"OK","sessionkey":"8a810da98bc0583af5959af0e8dde59g"},{"car":"Car 3","result":"ERROR_HARDWARE_DONT_SHOW_RESPONSETYPE_3"}]{{/code}}
94
95 = Example calls =
96
97 **simple message to the vehicle**
98 {{code language="java"}}https://map.yellowfox.de/rti/do_message.php?company=COMPANY_RTIKEY&vehicle=VEHICLE_RTIKEY&messagetext=RTI%20do_message%20test
99
100 https://map.yellowfox.de/rti/do_message.php?company=COMPANY_RTIKEY&vehicle={"type":"car_ident","groupKey":"GROUP_RTIKEY","ident":"VEHICLE_IDENT"}&messagetext=RTI%20do_message%20test{{/code}}
101
102 **Confirmation message to a group with english confirmation and desired return format as CSV**
103 {{code language="java"}}https://map.yellowfox.de/rti/do_message.php?company=COMPANY_RTIKEY&group=GROUP_RTIKEY&messagetext=RTI%20do_message%20test&responsetype=2&language=gbr&format=csv{{/code}}
104
105 **Yes-No message to all with english confirmation and desired return format as XML**
106 {{code language="java"}}https://map.yellowfox.de/rti/do_message.php?company=COMPANY_RTIKEY&import=IMPORT_RTIKEY&messagetext=RTI%20do_message%20test&responsetype=3&language=gbr&format=xml{{/code}}
107
108 **Message with reply template to all, with desired return format as xml and the response template as a serialized array**
109 {{code language="java"}}https://map.yellowfox.de/rti/do_message.php?company=COMPANY_RTIKEY&import=IMPORT_RTIKEY&messagetext=RTI%20do_message%20test&responsetype=4&format=xml&freeresponses[]=monday&freeresponses[]=tuesday{{/code}}
110
111 **simple message to the vehicle with dispatcher**
112 {{code language="java"}}https://map.yellowfox.de/rti/do_message.php?company=COMPANY_RTIKEY&vehicle=VEHICLE_RTIKEY&messagetext=RTI%20do_message%20test&dispatcher=name
113
114 https://map.yellowfox.de/rti/do_message.php?company=COMPANY_RTIKEY&vehicle={"type":"car_ident","groupKey":"GROUP_RTIKEY","ident":"VEHICLE_IDENT"}&messagetext=RTI%20do_message%20test&dispatcher=Absendername{{/code}}
115