User GuideReference ManualIntegration Scenarios
 

7.3. Messages

List messages

Search and list messages

URL Endpoint

http://www.babelway.net/SelfService/rest/v1/hub-{hubId}/messages.{format}

where

  • format : either 'json' or 'xml'

  • hubId : the ID of your environment. It can be found on your account page.

HTTP Method

GET

Requires authentification

yes ( About authentication )

Parameters can be added to filter the query

key

A message key

channel

a string search in the channel name

since

Returns messages created after the given timestamp. Timestamp should be formatted as a UNIX Epoch time (number of seconds since the first of January 1970)

before

Returns messages created before the given timestamp. Timestamp should be formatted as a UNIX Epoch time (number of seconds since the first of January 1970)

uploaded_by

a string search in the uploader's name

gw_in

a string search in the gateway in name

gw_out

a string search in the gateway out name

max_size

the maximum size of the message (in bytes)

min_size

the minimum size of the message (in bytes)

error_descr

a string search within the error description

ref

the message reference

status

The status of the message, one from the following list. If the entry is not within the list, a HTTP Status code 400 (bad request) will be returned.

  • IN_PROGRESS

  • WAITING_ACK

  • DONE

  • ERROR

  • CLOSED

type

The type of ticket, one in the following list. If the entry is not within the list, a HTTP Status code 400 (bad request) will be returned.

  • REGULAR

  • TEST

start

An integer to set the first result. By default, the value is at 0. The API returns 25 results per query. To get the 25 next one, it should be 25, then 50, then 75, ...

Get message details

URL Endpoint

http://www.babelway.net/SelfService/rest/v1/message-{key}.{format}

where

  • format : either 'json' or 'xml'

  • key : the message key as found by listing messages

HTTP Method

GET

Requires authentification

yes ( About authentication )

Examples

  • Get regular messages that ended up in succes in JSON format in environment 12345

    https://www.babelway.net/SelfService/rest/v1/hub-12345/messages.json?status=DONE&type=REGULAR

    [
       {
    	  "messageRecord":{
    		 "acknowledgmentTimestamp":0,
    		 "channel":{
    			"id":36100,
    			"name":"6.b AS2 To Web",
    			"subType":"CHANNEL",
    			"type":"CHANNEL"
    		 },
    		 "channelId":36100,
    		 "createdOn":1300454799803,
    		 "gatewayIn":{
    			"id":36092,
    			"name":"6.a AS2 In",
    			"subType":"GATEWAY_IN_AS2_IN",
    			"type":"GATEWAY_IN"
    		 },
    		 "gatewayInMessageKey":"20110318-142639-42777@88.128.233.246",
    		 "gatewayInMessageStatus":"Processed",
    		 "gatewayInTimestamp":1300454799821,
    		 "gatewayOut":{
    			"id":36108,
    			"name":"6.b Web Out",
    			"subType":"GATEWAY_OUT_WEB_OUT",
    			"type":"GATEWAY_OUT"
    		 },
    		 "gatewayOutTimestamp":1300454801044,
    		 "hubId":25334,
    		 "inSize":17408,
    		 "lastUpdatedOn":1300454801397,
    		 "longTerm":false,
    		 "messageFormatFileNameIn":"attachment0",
    		 "messageFormatFileNameOut":"attachment0",
    		 "messageKey":"263e0531-74f3-4afe-827d-9c8c19133dac",
    		 "messageRef":"attachment0",
    		 "outSize":334,
    		 "receivedTimestamp":1300454799792,
    		 "resultCount":16,
    		 "resultPosition":1,
    		 "status":"DONE",
    		 "statusHint":"Success",
    		 "testCaseId":0,
    		 "type":"REGULAR",
    		 "uploadedBy":"BABELGOM_AS2_25333"
    	  }
       },
    ]
    			
  • Get regular messages that are waiting for an ack the gatewayout 9876 in environment 12345 in XML format

    https://www.babelway.net/SelfService/rest/v1/hub-12345/messages.xml?type=REGULAR&status=WAITING_ACK&gw_out=9876

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <collection>
    	<messageRecord>
    		<acknowledgmentTimestamp>0</acknowledgmentTimestamp>
    		<channel>
    			<id>10000</id>
    			<name>test</name>
    			<subType>CHANNEL</subType>
    			<type>CHANNEL</type>
    		</channel>
    		<channelId>100001</channelId>
    		<createdOn>1301417508227</createdOn>
    		<gatewayIn>
    			<id>42687</id>
    			<name>Soap In</name>
    			<subType>GATEWAY_IN_HTTP_IN</subType>
    			<type>GATEWAY_IN</type>
    		</gatewayIn>
    		<gatewayInMessageKey>d73a2314-ba2e-4f7d-9db7-61e88f312b63</gatewayInMessageKey>
    		<gatewayInMessageStatus>Received from demo with IP 987.65.43.21.</gatewayInMessageStatus>
    		<gatewayInTimestamp>1301417508249</gatewayInTimestamp>
    		<gatewayOut>
    			<id>9876</id>
    			<name>soap out</name>
    			<subType>GATEWAY_OUT_HTTP_OUT</subType>
    			<type>GATEWAY_OUT</type>
    		</gatewayOut>
    		<gatewayOutTimestamp>1301417510271</gatewayOutTimestamp>
    		<hubId>123456</hubId>
    		<inSize>76</inSize>
    		<lastUpdatedOn>1301417510686</lastUpdatedOn>
    		<longTerm>false</longTerm>
    		<messageFormatFileNameIn>attachment</messageFormatFileNameIn>
    		<messageFormatFileNameOut>attachment</messageFormatFileNameOut>
    		<messageKey>d73a2314-ba2e-4f7d-9db7-61e88f312b63</messageKey>
    		<messageRef>attachment</messageRef>
    		<outSize>76</outSize>
    		<receivedTimestamp>1301417508209</receivedTimestamp>
    		<resultCount>23</resultCount>
    		<resultPosition>1</resultPosition>
    		<status>WAITING_ACK</status>
    		<testCaseId>0</testCaseId>
    		<type>REGULAR</type>
    		<uploadedBy>demo</uploadedBy>
    	</messageRecord>
    </collection>
    			
  • Get the details for the message with key 'abcdef' in JSON format

    https://www.babelway.net/SelfService/rest/v1/message-abcdef.json

    {
       "messageRecord":{
          "acknowledgmentTimestamp":0,
          "channel":{
             "id":10000,
             "name":"test",
             "subType":"CHANNEL",
             "type":"CHANNEL"
          },
          "channelId":100001,
          "createdOn":1301417508227,
          "gatewayIn":{
             "id":42687,
             "name":"Soap In",
             "subType":"GATEWAY_IN_HTTP_IN",
             "type":"GATEWAY_IN"
          },
          "gatewayInMessageKey":"d73a2314-ba2e-4f7d-9db7-61e88f312b63",
          "gatewayInMessageStatus":"Received from demo with IP 987.65.43.21.",
          "gatewayInTimestamp":1301417508249,
          "gatewayOut":{
             "id":9876,
             "name":"soap out",
             "subType":"GATEWAY_OUT_HTTP_OUT",
             "type":"GATEWAY_OUT"
          },
          "gatewayOutTimestamp":1301417510271,
          "hubId":123456,
          "inSize":76,
          "lastUpdatedOn":1301417510686,
          "longTerm":false,
          "messageFormatFileNameIn":"attachment",
          "messageFormatFileNameOut":"attachment",
          "messageKey":"d73a2314-ba2e-4f7d-9db7-61e88f312b63",
          "messageRef":"attachment",
          "outSize":76,
          "receivedTimestamp":1301417508209,
          "resultCount":0,
          "resultPosition":0,
          "status":"WAITING_ACK",
          "testCaseId":0,
          "type":"REGULAR",
          "uploadedBy":"demo"
       }
    }