Wiki source code of get_messages.php

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

Show last authors
1 (% class="box" %)
2 (((
3 Table of Contents
4 )))
5
6 {{toc/}}
7
8 Returns the states of the messages.
9
10 = Description =
11
12 (% class="green mark" %)//**GET**//(%%)//** get_messages.php?company**=RTI_COMPANYKEY**&vehicle**=RTI_VEHICLEKEY&**language=**deu**&datefrom**=YYYYMMDD**&dateto**=YYYYMMDD**&timefrom=**HHMMSS**&timeto**=HHMMSS**&filter=**1,2,3**&sessionkey=**ABABABABABABABABABABABABABABAB**&format=**xml//**&mode**=insertdate
13
14 = Parameter =
15
16
17 |=Params|=Description|=Type|=Note|=Mandatory
18 |company|RTI company key|string| |yes
19 |vehicle|RTI vehcile key|string|vehicle or import or group parameter|(yes)
20 |group|RTI group key|string|vehicle or import or group parameter|(yes)
21 |import|RTI importkey|string|vehicle or import or group parameter|(yes)
22 |start|begin of requested timerange|datestring|format: YYYYMMDDHHMMSS|yes
23 |end|end of requested timerange|datestring|format: YYYYMMDDHHMMSS
24 max. timerange is 7 days|yes
25 |filter|filter the type of messages|integer|1 = answer received
26 2 = confirmation message sent
27 3 = display off
28 4 = yes/no message sent
29 5 = message already exists
30 6 = message received
31 7 = message read
32 8 = message deleted
33 9 = message could not be sent
34 10 = message with response templates sent
35 11 = delivered
36 12 = delivery attempt
37 more than one filter have to separate with a comma|no
38 |language|define output language|string|supported params: deu (standard), gbr, ndl, fra, ita|no
39 |format|result format|string|format of the result from the interface
40 supported formats: csv (standard), xml, json|no
41 |sessionkey|SessionKey from "do_message.asp|string|this field or datefrom and dateto are mandatory|yes
42 |mode|Request of historydate or insertdate|string|historydate (standard) or insertdate|no
43
44 = Possible message status =
45
46 |=State|=Description
47 |delivery attempt|The message left the YellowFox data center.
48 |delivered|The message has arrived successfully on the display.
49 |display off|The display can not receive the message because it is off.
50 |message already exists|The message can not be recached, because it already exists.
51 |message received|A message has arrived in the portal, which was created on a display.
52 |message read|Message was read on the display.
53 |message deleted|Message has been deleted on the display.
54 |message could not be sent|The message has not reached the display, further delivery attempts are not carried out.
55 |message with response templates sent|The message was sent with reply templates.
56 |yes/no message sent|The message was sent with a yes-no option as a response.
57 |confirmation message sent|The message was sent with a confirmation option.
58 |answer received|A response from the display has been received.
59
60 = Return =
61
62 By default, a **CSV string** is returned which contains the evaluation for each message. If the mandatory parameters are missing, an "(% class="error" %)**ERROR: Description**(%%)" is returned.
63
64 == CSV format ==
65
66 === Metainformationen ===
67
68 |=Separator|Semicolon ( ; )
69 |=Delimiter|Double quote ( " )
70 |=Line break|0x0D 0x0A (CarriageReturn LineFeed)
71 |=Header|Line 1
72
73 === Columns ===
74
75 |=Column|=Description|=
76 |DATE|date of the executed action|format: YYYY-MM-DD HH:MM:SS
77 |STATE|description of the action|
78 |SOURCE|action trigger (person)|
79 |SOURCENAME|action trigger (system)|
80 |SESSIONKEY|sessionkey of message|
81 |REQUESTDATE|system time of request|format: YYYY-MM-DD HH:MM:SS
82 |INSERTDATE|system time of processing|format: YYYY-MM-DD HH:MM:SS
83 |TEXT|content of the message|
84 |RTI_IDENT|RTI Ident|
85
86 **result as CSV**
87 \\{{code language="java"}}"DATE";"STATE";"SOURCE";"SOURCENAME";"SESSIONKEY";"REQUESTDATE";"INSERTDATE";"TEXT";"RTI_IDENT"
88 ""2016-12-02 13:09:15";"confirmation message sent";"PORTAL";"Disponent 1";"";"2016-12-05 10:17:15";"2016-12-02 13:09:20";"Message 1";"Ident1"
89 "2016-12-02 13:08:25";"yes/no message sent";"PORTAL";"Disponent 1";"";"2016-12-05 10:17:15";"2016-12-02 13:08:15";"Question 1?";"Ident1"
90 "2016-12-02 09:09:15";"answer received";"PND";"Car 1";"ABABABABABABABABABABAB";"2016-12-05 10:17:52";"2016-12-02 09:09:20";"Answer 1";"Ident1"{{/code}}
91
92 == XML format ==
93
94 **result as XML**
95 \\{{code language="java"}}<?xml version="1.0" encoding="UTF-8" standalone="no"?>
96 <!DOCTYPE yf_getmessages SYSTEM "http://map.yellowfox.de/rti/dtd/yf_getmessages.dtd">
97 <yf_getmessages>
98 <message>
99 <date>2016-12-02 13:09:15</date>
100 <state>confirmation message sent</state>
101 <source>PORTAL</source>
102 <sourcename>Disponent 1</sourcename>
103 <sessionkey/>
104 <requestdate>2016-12-05 10:17:15</requestdate>
105 <insertdate>2016-12-02 13:09:20</insertdate>
106 <text>Message 1</text>
107 <rti_ident>Ident1</rti_ident>
108 </message>
109 <message>
110 <date>2016-12-02 13:08:25</date>
111 <state>yes/no message sent</state>
112 <source>PORTAL</source>
113 <sourcename>Disponent 1</sourcename>
114 <sessionkey/>
115 <requestdate>2016-12-05 10:17:15</requestdate>
116 <insertdate>2016-12-02 13:08:15</insertdate>
117 <text>Question 1?</text>
118 <rti_ident>Ident1</rti_ident>
119 </message>
120 <message>
121 <date>2016-12-02 09:09:15</date>
122 <state>answer received</state>
123 <source>PND</source>
124 <sourcename>Car 1</sourcename>
125 <sessionkey>ABABABABABABABABABABAB</sessionkey>
126 <requestdate>2016-12-05 10:17:52</requestdate>
127 <insertdate>2016-12-02 09:09:20</insertdate>
128 <text>Answer 1</text>
129 <rti_ident>Ident1</rti_ident>
130 </message>
131 </yf_getmessages>{{/code}}
132
133 == JSON Format (RFC 4627) ==
134
135 **result as JSON**
136 \\{{code language="java"}}[
137 {"date":"2016-12-02 13:09:15","state":"confirmation message sent","source":"PORTAL","sourcename":"Disponent 1","sessionkey":"","requestdate":"2016-12-05 10:17:15","insertdate":"2016-12-02 13:09:20","text":"Message 1"},
138 {"date":"2016-12-02 13:08:25","state":"yes/no message sent","source":"PORTAL","sourcename":"Disponent 1","sessionkey":"","requestdate":"2016-12-05 10:17:15","insertdate":"2016-12-02 13:08:15","text":"Question 1?"},
139 {"date":"2016-12-02 09:09:15","state":"answer received","source":"PND","sourcename":"Car 1","sessionkey":"ABABABABABABABABABABAB","requestdate":"2016-12-05 10:17:52","insertdate":"2016-12-02 09:09:20","text":"Answer 1","rti_ident":"Ident1"}]{{/code}}
140
141 = Example call =
142
143 **Query by SessionKey**
144 \\{{code language="java"}}https://map.yellowfox.de/rti/get_messages.pgp?company=COMPANY_RTIKEY&vehicle=VEHICLE_RTIKEY&language=deu&sessionkey=SESSION_KEY
145
146 https://map.yellowfox.de/rti/get_messages.php?company=COMPANY_RTIKEY&vehicle={"type":"car_ident","groupKey":"GROUP_RTIKEY","ident":"VEHICLE_IDENT"}&language=deu&sessionkey=SESSION_KEY{{/code}}
147
148 **Query by time range based**
149 \\{{code language="java"}}https://map.yellowfox.de/rti/get_messages.php?company=COMPANY_RTIKEY&group=GROUP_RTIKEY&language=gbr&start=20161202083015&end=20161205161500&filter=1,2,4,11&format=xml&mode=insertdate{{/code}}
150