2018-01-25 15:29:05 +00:00
{% from "components/table.html" import mapping_table, row, text_field, edit_field, field, row_heading with context %}
2017-11-03 14:24:10 +00:00
{% extends "withoutnav_template.html" %}
{% block per_page_title %}
2017-12-18 14:14:36 +00:00
Callback documentation
2017-11-03 14:24:10 +00:00
{% endblock %}
{% block maincolumn_content %}
< div class = "grid-row" >
< div class = "column-two-thirds" >
2017-12-18 14:14:36 +00:00
< h1 class = "heading-large" > Callback documentation< / h1 >
2017-12-08 10:52:38 +00:00
< p > A callback lets you receive messages from Notify to a URL you choose.< / p >
< p > You’ ll need to provide a bearer token, for security. We’ ll add this to the authorisation header of the callback request.< / p >
< p > The callback message is in JSON.< / p >
2017-12-04 15:07:11 +00:00
2017-12-11 12:03:23 +00:00
< h2 class = "heading-medium" > Email and text message delivery receipts< / h2 >
< p > When you send an email or text message through Notify, we can send a receipt to your callback URL to tell you if we were able to deliver it or not.< / p >
2017-11-03 14:24:10 +00:00
< div class = "bottom-gutter-3-2" >
{% call mapping_table(
caption='Callback message format',
field_headings=['Key', 'Description', 'Format'],
field_headings_visible=True,
caption_visible=False
) %}
{% for key, description, format in [
2017-12-11 12:03:23 +00:00
('id', 'Notify’ s id for the status receipts', 'UUID'),
('reference', 'The reference sent by the service', '12345678'),
('to', 'The email address of the recipient', 'hello@gov.uk'),
('status', 'The status of the notification', 'delivered | permanent-failure | temporary-failure | technical-failure'),
('created_at', 'The time the service sent the request', '2017-05-14T12:15:30.000000Z'),
('completed_at', 'The last time the status was updated', '2017-05-14T12:15:30.000000Z'),
('sent_at', 'The time the notification was sent', '2017-05-14T12:15:30.000000Z or nil'),
('notification_type', 'The notification type', 'email | sms | letter')
2017-11-03 14:24:10 +00:00
] %}
{% call row() %}
{% call row_heading() %} {{ key }} {% endcall %}
{{ text_field(description) }}
{{ text_field(format) }}
{% endcall %}
{% endfor %}
{% endcall %}
< / div >
2017-12-11 12:03:23 +00:00
< h2 class = "heading-medium" > Text messages you receive< / h2 >
< p > If your service receives text messages in Notify, we can forward them to your callback URL as soon as they arrive.< / p >
2017-12-04 15:07:11 +00:00
< div class = "bottom-gutter-3-2" >
{% call mapping_table(
caption='Callback message format',
field_headings=['Key', 'Description', 'Format'],
field_headings_visible=True,
caption_visible=False
) %}
{% for key, description, format in [
2017-11-03 14:24:10 +00:00
('id', 'Notify’ s id for the received message', 'UUID'),
('source_number', 'The phone number the message was sent from', '447700912345'),
('destination_number', 'The number the message was sent to (your number)', '07700987654'),
('message', 'The received message', 'Hello Notify!'),
('date_received', 'The UTC datetime that the message was received by Notify', '2017-05-14T12:15:30.000000Z')
2017-12-04 15:07:11 +00:00
] %}
{% call row() %}
{% call row_heading() %} {{ key }} {% endcall %}
{{ text_field(description) }}
{{ text_field(format) }}
{% endcall %}
{% endfor %}
{% endcall %}
< / div >
2017-11-03 14:24:10 +00:00
{% endblock %}