Get Batch of Messages

URL

https://{{HOST}}/udp/topic/message?topicName={topicName}&batchSize=10&page=1&size=1

Method

GET

Required IMS Scopes

  • apollo_read

URL Query Parameters

Name Description Example Type
topicName
required
Topic from which messages are to be read /udp/topic/message?topicName=Streaming String
batchSize
required
Max number of messages to be read /udp/topic/message?batchSize=1 String
page
required
Page number /udp/topic/message?page=1 String
size
required
Page size /udp/topic/message?size=1 String

Request Header Parameters

Type Value Description
Content-Type
required
application/json Content Type
Authentication
required
Bearer {access_token} IMS access token

Example

Request

curl -X GET 
  'https://{{HOST}}/udp/topic/message?topicName=temperature&batchSize=1&page=1&size=1' 
  -H 'Authorization: Bearer {access_token}' 
  -H 'Content-Type: application/json'

Response

[
    "{rn  "messageType" : "Fire_Alarm",rn  "id" : "sample_id"rn}",
    "{rn  "messageType" : "Fire_Alarm",rn  "id" : "sample_id"rn}",
    "{rn  "messageType" : "Fire_Alarm",rn  "id" : "sample_id"rn}"
] 

Errors

Code Description
403 The request can not be processed if token is not valid or expired.
500 Any other error e.g. DB operation failed

Response Body Parameters

Name Description Schema
message completed or bad request message String
status success String