Retrieve device messages from the “shipped”, “pending” and “failed” queues (all_queues) – return default fields only – paginated
Property | Description |
Resource URL | /customer/v1/{customer_id}/messaging/{messaging_profile_id}/retrieve |
Method | POST |
Body | Messaging Retrieve Object |
Sample Request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
POST /customer/v1/5a393ea210d91806b7ef702c/messaging/messaging_conn_profile_1001/retrieve HEADER authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIiLCJpYXQiOjE1MjIwODg2MzIsImV4cCI6MTUyMjA4ODY0MiwiYXVkIjoiIiwic3ViIjoiIiwiY3VzdG9tZXJfaWQiOiI1YTM5M2VhMjEwZDkxODA2YjdlZjcwMmMifQ.mHoao135IAn6mdKpJJAxKVldCsHWZtGtvTn3DuLhDjg { "request_id": "", "request_parameters": { "group_by_queue": true, "fieldset": [], "start_date": "2017-03-25T00:00:00.000Z", "end_date": "2017-04-06T00:00:00.000Z", "message_queue": "all_queues", "page": 1, "limit": 1 } } |
Sample Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
{ "request_id": "", "result_code": 0, "result_description": "Success", "response": { "shipped_messages_count": 1, "pending_messages_count": 0, "failed_messages_count": 1, "shipped_messages": [{ "udid": "5a623f4ddd59545193ea9b6c", "service_template_id": "config_profile_SmartDev_r22", "device_tx_protocol": "tcp", "device_app_protocol": "coap", "payload": { "content_type": "", "content_length": 71 }, "queue_entry_time": "2017-03-28T19:44:21.642Z", "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e2815fe7b4e68026fdf96" }, ], "failed_messages": [{ "udid": "B4CC-IELS-28932-adfUasf-0002", "service_template_id": "raspberry_pi_service_conf", "device_tx_protocol": "udp", "device_app_protocol": "coap", "payload": { "content_type": "json", "content_length": 213 }, "queue_entry_time": "2017-03-28T12:55:31.663Z", "messaging_endpoint_profile": "", "transaction_id": "58da5d4315ee870b203e3619" }] } } |
Note:
• In the example there were no message records in the device pending queues, hence no result returned for that queue.
• When the fieldset array attribute is left blank only the default fields are returned as shown above.
• The fieldset request attribute can be used to indicate the exact fields to return from the message records. To return the entire fields of the message records (i.e. meta-data + payload), the fieldset attribute may be set to [“all_fields”]. To return all fields except the payload set to [“all_fields_except_payload”], to return specific fields only indicate the exact fields to be returned as follows: [“udid”, “device_tx_protocol”, “payload.length”].
• When performing message retrieve operation, if fieldset includes payload data (payload.data), the max message records per request page is restricted to 1000. If fieldset does not include payload data then upto 10000 message records per request can be retrieved.
• The “message_queue” attribute is used to indicate which queues to retrieve messages from. It can be set to: “shipped”, “pending” “failed” queues. It may also be set to “all_queues” to retrieve from all three queues. The following sub-queues are also accepted: “shipped_uplink”, “shipped_downlink”, “pending_uplink”, “pending_downlink”, “failed_uplink”, “failed_downlink”.
• When performing “all_queues” type query, the specified page and limit is applied to each queue type (shipped, pending & failed) individually.
• In the example there were no message records in the device pending queues, hence no result returned for that queue.
• When the fieldset array attribute is left blank only the default fields are returned as shown above.
• The fieldset request attribute can be used to indicate the exact fields to return from the message records. To return the entire fields of the message records (i.e. meta-data + payload), the fieldset attribute may be set to [“all_fields”]. To return all fields except the payload set to [“all_fields_except_payload”], to return specific fields only indicate the exact fields to be returned as follows: [“udid”, “device_tx_protocol”, “payload.length”].
• When performing message retrieve operation, if fieldset includes payload data (payload.data), the max message records per request page is restricted to 1000. If fieldset does not include payload data then upto 10000 message records per request can be retrieved.
• The “message_queue” attribute is used to indicate which queues to retrieve messages from. It can be set to: “shipped”, “pending” “failed” queues. It may also be set to “all_queues” to retrieve from all three queues. The following sub-queues are also accepted: “shipped_uplink”, “shipped_downlink”, “pending_uplink”, “pending_downlink”, “failed_uplink”, “failed_downlink”.
• When performing “all_queues” type query, the specified page and limit is applied to each queue type (shipped, pending & failed) individually.
Retrieve messages from the “shipped”, “pending” and “failed” queues (all_queues) – return meta-data fields only – paginated
Property | Description |
Resource URL | /customer/v1/{customer_id}/messaging/{messaging_profile_id}/retrieve |
Method | POST |
Body | Messaging Retrieve Object |
Sample Request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
POST /customer/v1/5a393ea210d91806b7ef702c/messaging/messaging_conn_profile_1001/retrieve HEADER authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIiLCJpYXQiOjE1MjIwODg2MzIsImV4cCI6MTUyMjA4ODY0MiwiYXVkIjoiIiwic3ViIjoiIiwiY3VzdG9tZXJfaWQiOiI1YTM5M2VhMjEwZDkxODA2YjdlZjcwMmMifQ.mHoao135IAn6mdKpJJAxKVldCsHWZtGtvTn3DuLhDjg { "request_id": "", "request_parameters": { "group_by_queue": true, "fieldset": ["all_fields_except_payload"], "start_date": "2017-03-25T00:00:00.000Z", "end_date": "2017-04-06T00:00:00.000Z", "message_queue": "all_queues", "page": 1, "limit": 5 } } |
Sample Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
{ "request_id": "", "result_code": 0, "result_description": "Success", "response": { "shipped_messages_count": 5, "pending_messages_count": 0, "failed_messages_count": 1, "shipped_messages": [{ "udid": "5a623f4ddd59545193ea9b6c", "device_name": "GAS_Meter_CSM", "device_id": "iot_7aiud", "imsi": "", "service_template_id": "config_profile_SmartDev_r22", "token_id": "", "message_id": "6rNR8uPs", "delivery_type": "uplink", "payload_arrival_time": "2017-03-28T19:44:21.457Z", "message_expiry_time": "2017-03-28T21:07:41.635Z", "service_access_point": "saptcp5002", "submit_attempt_time": "2017-03-28T19:44:23.491Z", "msg_submit_time": "2017-03-28T19:44:23.491Z", "msg_submit_ack_time": "2017-03-28T19:44:23.515Z", "msg_submit_status": "Completed", "signal_strength": "150dB", "gpsloc_long": "13.4051° E", "gpsloc_lat": "52.5200° N", "delivery_method": "", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "tcp", "device_app_protocol": "coap", "transaction_type": "tcp-coap", "notify_on_msg_sent": false, "notify_on_msg_delivery": false, "submit_attempt_count": 1, "payload": { "content_type": "", "content_length": 71 }, "queue_entry_time": "2017-03-28T19:44:21.642Z", "delivery_priority": 0, "device_ip": "197.52.75.121", "device_port": 42462, "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e2815fe7b4e68026fdf96" }, { "udid": "5a623f4ddd59545193ea9b6c", "device_name": "GAS_Meter_CSM", "device_id": "iot_7aiud", "imsi": "", "service_template_id": "config_profile_SmartDev_r22", "message_id": "6rNR8uPs", "token_id": "", "transaction_type": "ack", "delivery_type": "downlink", "delivery_method": "", "payload_arrival_time": "2017-03-28T19:44:23.515Z", "message_expiry_time": "2017-03-28T21:07:43.235Z", "service_access_point": "saptcp5002", "submit_attempt_time": "2017-03-28T19:44:23.491Z", "msg_submit_time": "2017-03-28T19:44:23.491Z", "msg_submit_ack_time": "2017-03-28T19:44:23.515Z", "msg_submit_status": "Ack Message Sent", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "tcp", "device_app_protocol": "coap", "notify_on_msg_sent": false, "notify_on_msg_delivery": false, "submit_attempt_count": 0, "payload": { "content_type": "", "content_length": 8 }, "queue_entry_time": "2017-03-28T19:44:23.522Z", "delivery_priority": 0, "device_ip": "197.52.75.121", "device_port": 42462, "messaging_endpoint_profile": "", "transaction_id": "58ff7a451f2d501ec86d8e6e" }, { "udid": "5a623f4ddd59545193ea9b6c", "device_name": "GAS_Meter_CSM", "device_id": "iot_7aiud", "imsi": "", "service_template_id": "config_profile_SmartDev_r22", "token_id": "", "message_id": "F3WayYrq", "delivery_type": "downlink", "delivery_ack_required": false, "payload_arrival_time": "2017-03-28T19:43:17.902Z", "message_expiry_time": "2017-03-28T21:06:38.082Z", "service_access_point": "doodle", "submit_attempt_time": "2017-03-28T19:43:20.188Z", "msg_submit_time": "2017-03-28T19:43:20.188Z", "msg_submit_ack_time": "2017-03-28T19:44:23.515Z", "msg_submit_status": "Completed", "delivery_method": "", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "udp", "device_app_protocol": "coap", "transaction_type": "udp-coap", "notify_on_msg_sent": false, "notify_on_msg_delivery": false, "submit_attempt_count": 1, "payload": { "content_type": "", "content_length": 1308 }, "queue_entry_time": "2017-03-28T19:43:18.090Z", "delivery_priority": 3, "device_ip": "197.52.75.121", "device_port": 5320, "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e1380fe7b4e68026fdf92" }, { "udid": "5aa5d6f172bb547e07364363", "device_name": "TCU Group 1 Banbury", "device_id": "98u6-5677-t67de3-6545", "imsi": "", "service_template_id": "config_profile_SmartDev_r22", "token_id": "", "message_id": "", "delivery_type": "uplink", "payload_arrival_time": "2017-03-28T19:43:17.902Z", "message_expiry_time": "2017-03-28T21:06:38.082Z", "service_access_point": "doodle", "submit_attempt_time": "2017-03-28T19:43:20.188Z", "msg_submit_time": "2017-03-28T19:43:20.188Z", "msg_submit_ack_time": "2017-03-28T19:44:23.515Z", "msg_submit_status": "Completed", "signal_strength": "", "gpsloc_long": "", "gpsloc_lat": "", "delivery_method": "", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "udp", "device_app_protocol": "coap", "transaction_type": "udp-coap", "notify_on_msg_sent": false, "notify_on_msg_delivery": false, "submit_attempt_count": 1, "payload": { "content_type": "", "content_length": 21 }, "queue_entry_time": "2017-03-28T19:43:18.090Z", "delivery_priority": 0, "device_ip": "84.102.75.52", "device_port": 42462, "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e27d6fe7b4e68026fdf94" }, { "udid": "5aa5d6f172bb547e07364363", "device_name": "TCU Group 1 Banbury", "device_id": "98u6-5677-t67de3-6545", "imsi": "", "service_template_id": "config_profile_SmartDev_r22", "token_id": "", "message_id": "", "delivery_type": "uplink", "delivery_method": "", "payload_arrival_time": "", "message_expiry_time": "2017-03-28T21:06:38.352Z", "service_access_point": "doodle", "submit_attempt_time": "2017-03-28T19:43:20.188Z", "msg_submit_time": "2017-03-28T19:43:20.188Z", "msg_submit_ack_time": "", "msg_submit_status": "Completed", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "udp", "device_app_protocol": "coap", "transaction_type": " notification.notify_on_wakeup", "notify_on_msg_sent": false, "notify_on_msg_delivery": false, "submit_attempt_count": 0, "payload": { "content_type": "", "content_length": 0 }, "queue_entry_time": "2017-03-28T19:43:20.190Z", "delivery_priority": 0, "device_ip": "84.102.75.52", "device_port": 42462, "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e27d6fe7b4e68026fdf94" } ], "failed_messages": [{ "service_template_id": "raspberry_pi_service_conf", "device_port": 9000, "udid": "B4CC-IELS-28932-adfUasf-0002", "imsi": "9110078239893102", "message_id": "4affafafd", "token_id": "ryorpRwnx", "delivery_type": "downlink", "delivery_method": "POST", "payload_arrival_time": "2017-03-28T12:55:31.663Z", "message_expiry_time": "2017-03-28T13:05:31.517Z", "transaction_type": "udp-coap", "submit_attempt_time": "2017-03-28T12:55:31.862Z", "msg_submit_time": "", "msg_submit_ack_time": "", "msg_submit_status": "Message Expired", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "udp", "device_app_protocol": "coap", "notify_on_msg_sent": false, "notify_on_msg_delivery": true, "submit_attempt_count": 0, "payload": { "content_type": "json", "content_length": 213 }, "queue_entry_time": "2017-03-28T12:55:31.663Z", "delivery_priority": 0, "device_ip": "", "messaging_endpoint_profile": "", "transaction_id": "58da5d4315ee870b203e3619" }] } } |
Retrieve messages from the “shipped”, “pending” and “failed” queues – include all fields (and payload)
Property | Description |
Resource URL | /customer/v1/{customer_id}/messaging/{messaging_profile_id}/retrieve |
Method | POST |
Body | Messaging Retrieve Object |
Sample Request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
POST /customer/v1/5a393ea210d91806b7ef702c/messaging/messaging_conn_profile_1001/retrieve HEADER authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIiLCJpYXQiOjE1MjIwODg2MzIsImV4cCI6MTUyMjA4ODY0MiwiYXVkIjoiIiwic3ViIjoiIiwiY3VzdG9tZXJfaWQiOiI1YTM5M2VhMjEwZDkxODA2YjdlZjcwMmMifQ.mHoao135IAn6mdKpJJAxKVldCsHWZtGtvTn3DuLhDjg { "request_id": "", "request_parameters": { "group_by_queue": true, "start_date": "2017-03-25T00:00:00.000Z", "end_date": "2017-04-06T00:00:00.000Z", "message_queue": "all_queues", "page": 1, "limit": 3 } } |
Sample Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
{ "request_id": "", "result_code": 0, "result_description": "Success", "response": { "shipped_messages_count": 3, "pending_messages_count": 0, "failed_messages_count": 1, "shipped_messages": [{ "udid": "5a623f4ddd59545193ea9b6c", "device_name": "GAS_Meter_CSM", "device_id": "iot_7aiud", "imsi": "", "service_template_id": "config_profile_SmartDev_r22", "token_id": "", "message_id": "6rNR8uPs", "delivery_type": "uplink", "payload_arrival_time": "2017-03-28T19:44:21.457Z", "message_expiry_time": "2017-03-28T21:07:41.635Z", "service_access_point": "saptcp5002", "submit_attempt_time": "2017-03-28T19:44:23.491Z", "msg_submit_time": "2017-03-28T19:44:23.491Z", "msg_submit_ack_time": "2017-03-28T19:44:23.515Z", "msg_submit_status": "Completed", "signal_strength": "150dB", "gpsloc_long": "13.4051° E", "gpsloc_lat": "52.5200° N", "delivery_method": "", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "tcp", "device_app_protocol": "coap", "transaction_type": "tcp-coap", "notify_on_msg_sent": false, "notify_on_msg_delivery": false, "submit_attempt_count": 1, "payload": { "content_type": "", "content_length": 71, "data":"WzU3NDgzNmYxNmYxY2FkMGE1NDcxNjRlYyxjYXN0ZXN0MTAxLG1zZ19pZF8wMDEiLCAiRWFydGggc3RhdGlvbiBkYXRhIl0=" }, "queue_entry_time": "2017-03-28T19:44:21.642Z", "delivery_priority": 0, "device_ip": "197.52.75.121", "device_port": 42462, "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e2815fe7b4e68026fdf96" }, { "udid": "5a623f4ddd59545193ea9b6c", "device_name": "GAS_Meter_CSM", "device_id": "iot_7aiud", "imsi": "", "service_template_id": "config_profile_SmartDev_r22", "message_id": "6rNR8uPs", "token_id": "", "transaction_type": "ack", "delivery_type": "downlink", "delivery_method": "", "payload_arrival_time": "2017-03-28T19:44:23.515Z", "message_expiry_time": "2017-03-28T21:07:43.235Z", "service_access_point": "saptcp5002", "submit_attempt_time": "2017-03-28T19:44:23.491Z", "msg_submit_time": "2017-03-28T19:44:23.491Z", "msg_submit_ack_time": "2017-03-28T19:44:23.515Z", "msg_submit_status": "Ack Message Sent", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "tcp", "device_app_protocol": "coap", "notify_on_msg_sent": false, "notify_on_msg_delivery": false, "submit_attempt_count": 0, "payload": { "content_type": "", "content_length": 8, "data":"6rNR8uPs" }, "queue_entry_time": "2017-03-28T19:44:23.522Z", "delivery_priority": 0, "device_ip": "197.52.75.121", "device_port": 42462, "messaging_endpoint_profile": "", "transaction_id": "58ff7a451f2d501ec86d8e6e" }, { "udid": "5a623f4ddd59545193ea9b6c", "device_name": "GAS_Meter_CSM", "device_id": "iot_7aiud", "imsi": "", "service_template_id": "config_profile_SmartDev_r22", "token_id": "", "message_id": "F3WayYrq", "delivery_type": "downlink", "delivery_ack_required": false, "payload_arrival_time": "2017-03-28T19:43:17.902Z", "message_expiry_time": "2017-03-28T21:06:38.082Z", "service_access_point": "doodle", "submit_attempt_time": "2017-03-28T19:43:20.188Z", "msg_submit_time": "2017-03-28T19:43:20.188Z", "msg_submit_ack_time": "2017-03-28T19:44:23.515Z", "msg_submit_status": "Completed", "delivery_method": "", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "udp", "device_app_protocol": "coap", "transaction_type": "udp-coap", "notify_on_msg_sent": false, "notify_on_msg_delivery": false, "submit_attempt_count": 1, "payload": { "content_type": "", "content_length": 1308, "data":" MDEwMDExMTEgMDExMDExMTAgMDAxMDAwMDAgMDExMTAxMDAgMDExMDEwMDAgMDExMDAxMDEgMDAxMDAwMDAgMDExMTAwMDAgMDExMTAwMTAgMDExMDExMTEgMDExMDAxMDAgMDExMTAxMDEgMDExMDAwMTEgMDExMTAxMDAgMDAxMDAwMDAgMDExMDAxMTEgMDExMDAwMDEgMDExMDExMDAgMDExMDExMDAgMDExMDAxMDEgMDExMTAwMTAgMDExMTEwMDEgMDAxMDAwMDAgMDExMTAwMTAgMDExMDAxMDEgMDExMDExMDEgMDExMDExMTEgMDExMTAxMTAgMDExMDAxMDEgMDAxMDAwMDAgMDExMDAwMDEgMDExMDExMDAgMDExMDExMDAgMDAxMDAwMDAgMDExMDEwMDEgMDExMDExMDEgMDExMDAwMDEgMDExMDAxMTEgMDExMDAxMDEgMDExMTAwMTEgMDAxMDAwMDAgMDExMTAxMTEgMDExMDEwMDEgMDExMTAxMDAgMDExMDEwMDAgMDAxMDAwMDAgMDExMDExMDAgMDExMDExMTEgMDExMDAxMTEgMDExMDExMTEgMDAxMDAwMDAgMDExMDAwMDEgMDExMDExMTAgMDExMDAxMDAgMDAxMDAwMDAgMDExMDAwMDEgMDExMDExMDAgMDExMTAwMTEgMDExMDExMTEgMDAxMDAwMDAgMDExMTAwMTAgMDExMDAxMDEgMDExMDExMDEgMDExMDExMTEgMDExMTAxMTAgMDExMDAxMDEgMDAxMDAwMDAgMDExMTAxMDAgMDExMDEwMDAgMDExMDAxMDEgMDAxMDAwMDAgMDExMTAwMDAgMDExMTAwMTAgMDExMDExMTEgMDExMDAxMDAgMDExMTAxMDEgMDExMDAwMTEgMDExMTAxMDAgMDAxMDAwMDAgMDExMDEwMDEgMDExMDExMDEgMDExMDAwMDEgMDExMDAxMTEgMDExMDAxMDEgMDAxMDAwMDAgMDExMDEwMDEgMDExMDAxMTAgMDAxMDAwMDAgMDExMDEwMDEgMDExMTAxMDAgMDAxMDAwMDAgMDExMDEwMDAgMDExMDAwMDEgMDExMTAwMTEgMDAxMDAwMDAgMDExMDAwMDEgMDExMDExMTAgMDExMTEwMDEgMDAxMDAwMDAgMDExMDExMDAgMDExMDExMTEgMDExMDAxMTEgMDExMDExMTEgMDAxMDAwMDAgMDExMDExMTEgMDExMDExMTAgMDAxMDAwMDAgMDExMDEwMDEgMDExMTAxMDAg" }, "queue_entry_time": "2017-03-28T19:43:18.090Z", "delivery_priority": 3, "device_ip": "197.52.75.121", "device_port": 5320, "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e1380fe7b4e68026fdf92" }, ], "failed_messages": [{ "service_template_id": "raspberry_pi_service_conf", "device_port": 9000, "udid": "B4CC-IELS-28932-adfUasf-0002", "imsi": "9110078239893102", "message_id": "4affafafd", "token_id": "ryorpRwnx", "delivery_type": "downlink", "delivery_method": "POST", "payload_arrival_time": "2017-03-28T12:55:31.663Z", "message_expiry_time": "2017-03-28T13:05:31.517Z", "transaction_type": "udp-coap", "submit_attempt_time": "2017-03-28T12:55:31.862Z", "msg_submit_time": "", "msg_submit_ack_time": "", "msg_submit_status": "Message Expired", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "udp", "device_app_protocol": "coap", "notify_on_msg_sent": false, "notify_on_msg_delivery": true, "submit_attempt_count": 0, "payload": { "content_type": "json", "content_length": 213, "data": "LwA5AGoALwAAFEAQQBBAEEAUQBBAEIAQQBBAEQALwA" }, "queue_entry_time": "2017-03-28T12:55:31.663Z", "delivery_priority": 0, "device_ip": "", "messaging_endpoint_profile": "", "transaction_id": "58da5d4315ee870b203e3619" }] } } |
Retrieve device messages from the “failed ” queues of devices – exclude payload (meta-data only)
Property | Description |
Resource URL | /customer/v1/{customer_id}/messaging/{messaging_profile_id}/retrieve |
Method | POST |
Body | Messaging Retrieve Object |
Sample Request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
POST /customer/v1/5a393ea210d91806b7ef702c/messaging/messaging_conn_profile_1001/retrieve HEADER authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIiLCJpYXQiOjE1MjIwODg2MzIsImV4cCI6MTUyMjA4ODY0MiwiYXVkIjoiIiwic3ViIjoiIiwiY3VzdG9tZXJfaWQiOiI1YTM5M2VhMjEwZDkxODA2YjdlZjcwMmMifQ.mHoao135IAn6mdKpJJAxKVldCsHWZtGtvTn3DuLhDjg { "request_id": "", "request_parameters": { "group_by_queue": true, "fieldset": ["all_fields_except_payload"], "start_date": "2017-03-25T00:00:00.000Z", "end_date": "2017-04-06T00:00:00.000Z", "message_queue": "failed", "page": 1, "limit": 5 } } |
Sample Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
{ "request_id": "", "result_code": 0, "result_description": "Success", "response": { "failed_messages_count": 1, "failed_messages": [{ "service_template_id": "raspberry_pi_service_conf", "device_port": 9000, "udid": "B4CC-IELS-28932-adfUasf-0002", "imsi": "9110078239893102", "message_id": "4affafafd", "token_id": "ryorpRwnx", "delivery_type": "downlink", "delivery_method": "POST", "payload_arrival_time": "2017-03-28T12:55:31.663Z", "message_expiry_time": "2017-03-28T13:05:31.517Z", "transaction_type": "udp-coap", "submit_attempt_time": "2017-03-28T12:55:31.862Z", "msg_submit_time": "", "msg_submit_ack_time": "", "msg_submit_status": "Message Expired", "delivery_path": "", "attempting_delivery": false, "device_tx_protocol": "udp", "device_app_protocol": "coap", "notify_on_msg_sent": false, "notify_on_msg_delivery": true, "submit_attempt_count": 0, "payload": { "content_type": "json", "content_length": 213 }, "queue_entry_time": "2017-03-28T12:55:31.663Z", "delivery_priority": 0, "device_ip": "", "messaging_endpoint_profile": "", "transaction_id": "58da5d4315ee870b203e3619" }] } } |
Retrieve device messages from the “shipped”, “pending” and “failed” queues – ungrouped
Property | Description |
Resource URL | /customer/v1/{customer_id}/messaging/{messaging_profile_id}/retrieve |
Method | POST |
Body | Messaging Retrieve Object |
Sample Request
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
POST /customer/v1/5a393ea210d91806b7ef702c/messaging/messaging_conn_profile_1001/retrieve HEADER authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiIiLCJpYXQiOjE1MjIwODg2MzIsImV4cCI6MTUyMjA4ODY0MiwiYXVkIjoiIiwic3ViIjoiIiwiY3VzdG9tZXJfaWQiOiI1YTM5M2VhMjEwZDkxODA2YjdlZjcwMmMifQ.mHoao135IAn6mdKpJJAxKVldCsHWZtGtvTn3DuLhDjg { "request_id": "", "request_parameters": { "group_by_queue": false, "fieldset": [], "start_date": "2017-03-25T00:00:00.000Z", "end_date": "2017-04-06T00:00:00.000Z", "message_queue": "all_queues", "page": 1, "limit": 5 } } |
Sample Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
{ "request_id": "", "result_code": 0, "result_description": "Success", "response": [{ "udid": "5a623f4ddd59545193ea9b6c", "service_template_id": "config_profile_SmartDev_r22", "device_tx_protocol": "tcp", "device_app_protocol": "coap", "payload": { "content_type": "", "content_length": 71 }, "queue_entry_time": "2017-03-28T19:44:21.642Z", "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e2815fe7b4e68026fdf96", "msg_queue": "shipped_messages" }, { "udid": "5a623f4ddd59545193ea9b6c", "service_template_id": "config_profile_SmartDev_r22", "device_tx_protocol": "tcp", "device_app_protocol": "coap", "payload": { "content_type": "", "content_length": 8 }, "queue_entry_time": "2017-03-28T19:44:23.522Z", "messaging_endpoint_profile": "", "transaction_id": "58ff7a451f2d501ec86d8e6e", "msg_queue": "shipped_messages" }, { "udid": "5a623f4ddd59545193ea9b6c", "service_template_id": "config_profile_SmartDev_r22", "device_tx_protocol": "udp", "device_app_protocol": "coap", "payload": { "content_type": "", "content_length": 1308 }, "queue_entry_time": "2017-03-28T19:43:18.090Z", "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e1380fe7b4e68026fdf92", "msg_queue": "shipped_messages" }, { "udid": "5aa5d6f172bb547e07364363", "service_template_id": "config_profile_SmartDev_r22", "device_tx_protocol": "udp", "device_app_protocol": "coap", "payload": { "content_type": "", "content_length": 21 }, "queue_entry_time": "2017-03-28T19:43:18.090Z", "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e27d6fe7b4e68026fdf94", "msg_queue": "shipped_messages" }, { "udid": "5aa5d6f172bb547e07364363", "service_template_id": "config_profile_SmartDev_r22", "device_tx_protocol": "udp", "device_app_protocol": "coap", "payload": { "content_type": "", "content_length": 0 }, "queue_entry_time": "2017-03-28T19:43:20.190Z", "messaging_endpoint_profile": "my_iot_application_instance_primary", "transaction_id": "5a6e27d6fe7b4e68026fdf94", "msg_queue": "shipped_messages" }, { "udid": "B4CC-IELS-28932-adfUasf-0002", "service_template_id": "raspberry_pi_service_conf", "device_tx_protocol": "udp", "device_app_protocol": "coap", "payload": { "content_type": "json", "content_length": 213 }, "queue_entry_time": "2017-03-28T12:55:31.663Z", "messaging_endpoint_profile": "", "transaction_id": "58da5d4315ee870b203e3619", "msg_queue": "failed_messages" } ] } |
Note:
When group_by_queue is set to false in the retrieve message request, the queue name is appended to each message record returned for the requestor to easily identify which device queues the messages are fetched from.
When group_by_queue is set to false in the retrieve message request, the queue name is appended to each message record returned for the requestor to easily identify which device queues the messages are fetched from.