Get Rendered Notification Content
The Courier Messages API allows you to fetch the array of events of a message you’ve previously sent, including the rendered content by using the endpoint.
The Courier Messages API lets you get the rendered output of any Courier notification in your send history using the “Get Message Content” endpoint.
To fetch the content for a given message there are two API calls that you need to make
-
Fetch message history using GET /messages/:message_id/history and the message ID that was returned in response to your send command.
-
Fetch message content using a root-relative URL
Fetch Message History
Message history can be fetched by calling the history endpoint or by calling the getMessageHistory function in our SDKs.
Message history will contain a RENDERED
event that contains links to the rendered output for the message.
Example of a Rendered Event
Fetch Message Content
The output section in the history response contains the root-relative URL that can be used to fetch the content that was rendered and sent to the provider. The output url must be appended to the Courier API host (https://api.courier.com).
Here is an example of a rendered push event:
Example of a Rendered Push Event
Rendered Content for Emails
HTML
content is returned with a content-type
of text/html and the response is raw HTML:
The sample response:
Example of an Email Response