Skip to main content
Back

Attach a message API technical guide

Use this service to attach text messages to an existing application


Version and Status


How to use the Attach a message API

To attach a message to an existing application, make an HTTP POST request to the attach message endpoint.

The body of the request contains:

  • the message (text) to be attached to the application

Once the request to attach a message has been validated, an empty ‘202 Accepted’ response will be returned on success. If validation fails, a ‘400’ response will be returned containing details of the error.

After the request has been accepted, message attachment begins. Once this completes (successfully or otherwise) a notification will be sent.

Notifications

Once the message attachment process finishes, notifications will be available from the Notifications API about the status of the attached message:

  • application.message-success - the message has successfully been attached to the application

  • application.message-failed - the message failed to attach to the application

Validation rules

To pass validation, the provided application id must exist in HMLR’s system. If the application is not found, a ‘HTTP 404’ response will be returned.

The application must also be in a pending state. It must not have been completed or cancelled.

Business unit and customer ids are not provided in the request directly but are computed when sending the request. The ids must match those on the application the message is being attached to. If either id values do not match the values on the application, a ‘HTTP 400’ response will be returned.

The message being attached must be no more than 4034 characters.

Example requests and responses

Attach a message

{  

  "data": {  

    "message_text": "This is a message!"   

}   

Upon successful validation, this request will return an empty 202 Accepted response.

If the application is not found, a 404 response will be returned:

{  

  "errors ": [  

    {  

      “type”: “OC200”,  

      “detail”: “Application creation request not found in the system for request id ‘application-id’”,  

      “pointer”: null  

    }  

  ]  

}     

If the application has already been completed or cancelled, a 400 response will be returned:

{  

  "errors ": [  

    {  

      “type”: “OC036”,  

      “detail”: “Application status is not PENDING”,  

      “pointer”: null  

    }  

  ]  

}      

Related APIs