Wiki source code of do_message.php
Last modified by YellowFox_RD on 2025/01/23 10:13
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
1.1 | 1 | (% class="box" %) |
![]() |
2.1 | 2 | ((( |
![]() |
4.1 | 3 | Table of Contents |
![]() |
2.1 | 4 | ))) |
5 | |||
![]() |
1.1 | 6 | {{toc/}} |
7 | |||
![]() |
4.1 | 8 | Send a message to a single vehicle, a group or to all (import). |
![]() |
2.1 | 9 | |
![]() |
4.1 | 10 | = Description = |
![]() |
2.1 | 11 | |
![]() |
4.1 | 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 |
![]() |
2.1 | 13 | |
![]() |
1.1 | 14 | = Parameter = |
![]() |
2.1 | 15 | |
![]() |
4.1 | 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 | ||
![]() |
1.1 | 38 | |
![]() |
4.1 | 39 | = Return = |
![]() |
1.1 | 40 | |
![]() |
4.1 | 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. |
![]() |
2.1 | 42 | |
![]() |
1.1 | 43 | == CSV-Format == |
![]() |
2.1 | 44 | |
![]() |
4.1 | 45 | === Meta informations === |
![]() |
2.1 | 46 | |
![]() |
4.1 | 47 | |=Separator|Semicolon ( ; ) |
48 | |=Delimiter|Double quote ( " ) | ||
49 | |=Line break|0x0D 0x0A (CarriageReturn LineFeed) | ||
50 | |=Header|Line 1 | ||
![]() |
1.1 | 51 | |
![]() |
4.1 | 52 | === Columns === |
![]() |
2.1 | 53 | |
![]() |
4.1 | 54 | |=Column|=Description |
![]() |
1.1 | 55 | |CAR|Vehicle-Name |
![]() |
4.1 | 56 | |RESULT|Result of the action |
57 | |SESSIONKEY|Sessionkey of the message | ||
![]() |
1.1 | 58 | |
![]() |
4.1 | 59 | === Example === |
![]() |
2.1 | 60 | |
![]() |
4.1 | 61 | **Result format as CSV** |
![]() |
1.1 | 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 == | ||
![]() |
2.1 | 68 | |
![]() |
4.1 | 69 | **Result format as XML** |
70 | {{code language="php"}}<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
![]() |
1.1 | 71 | <!DOCTYPE yf_domessage SYSTEM "https://map.yellowfox.de/rti/dtd/yf_domessage.dtd"> |
72 | <yf_domessage> | ||
![]() |
2.1 | 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> | ||
![]() |
4.1 | 88 | </yf_domessage>{{/code}} |
![]() |
1.1 | 89 | |
90 | == JSON Format (RFC 4627) == | ||
![]() |
2.1 | 91 | |
![]() |
4.1 | 92 | **Result format as JSON** |
![]() |
1.1 | 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 | |||
![]() |
4.1 | 95 | = Example calls = |
![]() |
1.1 | 96 | |
![]() |
4.1 | 97 | **simple message to the vehicle** |
![]() |
1.1 | 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 | |||
![]() |
4.1 | 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}} | ||
![]() |
1.1 | 104 | |
![]() |
4.1 | 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}} | ||
![]() |
1.1 | 107 | |
![]() |
4.1 | 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}} | ||
![]() |
1.1 | 110 | |
![]() |
4.1 | 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 | ||
![]() |
1.1 | 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 |