4.2.3.15. HTTP REST Gateway Out
With a HTTP REST out Gateway, outgoing messages are available from a Babelway HTTP server.
The specific settings are:
| Authentication Method | Which protocol do you want to use to authenticate to the server. Can be Basic (username and password) or via certificate. |
| Username | Username to access the service (if you chose basic authentication). |
| Password | Password to access the service (if you chose basic authentication) . |
2-way auth. certificate | The client certificate to authenticate (if you chose cert authentication). |
| Time out | Specifies the duration for which the file will remain available on the HTTP server. After this timeout, the file will be automatically removed from the HTTP server (it you did not do it before). If the file was never downloaded, the file will also be marked in ERROR, because it has not reached its destination. To be warned the soonest possible of errors, we recommend that you set here the lowest possible value. Example : if an automatic process polls the files from here every hour, a value of "3 hours" will allow you to be notified of the problem after just 2 or 3 failed/missing pollings, while a value of "30 days" would lead to files leaving there, without any automatic notification, until some user worries about lack of files. |
| HTTP URL | The URL to use in your HTTP client to retrieve the messages |
After channel deployment, your connection will be available to send messages.
Authentication Method
Choose your authentication method:
• Basic: Use username/password credentials sent with each HTTP request
• Certificate: Use client SSL certificates for mutual TLS authentication
For Basic authentication:
- Include credentials in Authorization header: Authorization: Basic base64(username:password)
- Most HTTP clients support basic auth with -u username:password parameter
For Certificate authentication:
- Configure your HTTP client to present the client certificate
- Server will validate the certificate against trusted CAs
REST endpoints
The gateway supports 3 different calls.
GET Message list
Access the gateway base URL (/ws/RestOut/{gatewayId}) to retrieve a list of available messages in JSON format. The format is the following:
{"messages": [
{ "key": "23496ca8-3f8f-4a2e-9367-331c2911cb3c",
"size": 121},
{ "key": "c156d009-7f14-4b43-b2f0-bf9af41c0634",
"size": 121}]
}key is the message key that can be used to find the message in Babelway Selfservice application and to download a single message file content. The size indicate the size of the file. The messages are always sorted by available time on the server.limitMaximum number of messages to return (default 100, max 1000)ascendingiftruethe sort will be ascending, iffalseotherwise, default totrue
GET Message detail
Append a message key to the base URL (/ws/RestOut/{gatewayId}/{messageKey}) to download specific message content. It supports an extra non mandatory parameter delete. If true the message will be deleted from the server gateway out, and cannot be downloaded a second time, default to false. The returned content type can be either application/xml, application/json or in all other cases application/octet-stream.
GET Latest Message
Append "latest" to the base URL (/ws/RestOut/{gatewayId}/latest) to download the most recently received message content. This endpoint automatically retrieves the message with the most recent available time without requiring you to know the specific message key. It supports the same optional delete parameter as the message detail endpoint - if set to true, the latest message will be deleted from the server gateway after download and cannot be downloaded again, default to false. The returned content type follows the same rules as message detail: application/xml for XML content, application/json for JSON content, or application/octet-stream for all other file types. If no messages are available for the gateway, it returns a 404 error with a JSON response indicating no messages were found.
DELETE Message
Send an HTTP DELETE request to the message-specific URL (/ws/RestOut/{gatewayId}/{messageKey}) to remove the message from the gateway. Note that the message will still be visible in Babelway Selfservice, but you will not be able to delete the message again.
Error Responses
All endpoints return JSON error responses when something goes wrong:
{
"status": 400,
"message": "Invalid limit parameter: limit"
}Common HTTP status codes:
• 400 Bad Request - Invalid parameters (e.g., limit=ABC, invalid gateway ID)
• 401 Unauthorized - Missing or invalid authentication credentials
• 404 Not Found - Gateway or message not found
• 405 Method Not Allowed - Unsupported HTTP method
• 500 Internal Server Error - Server-side error
Usage Examples
List first 10 messages, newest first:curl -u "username:password" "https://{infra-url}/ws/RestOut/123?limit=10&ascending=false"
Download a specific message:curl -u "username:password" "https://{infra-url}/ws/RestOut/123/23496ca8-3f8f-4a2e-9367-331c2911cb3c"
Download and delete in one operation:curl -u "username:password" "https://{infra-url}/ws/RestOut/123/23496ca8-3f8f-4a2e-9367-331c2911cb3c?delete=true"
Delete a message:curl -X DELETE -u "username:password" "https://{infra-url}/ws/RestOut/123/23496ca8-3f8f-4a2e-9367-331c2911cb3c"