Merge pull request #1327 from alphagov/create-inbound-api

Create inbound api
This commit is contained in:
kentsanggds
2017-06-22 12:36:28 +01:00
committed by GitHub
7 changed files with 350 additions and 10 deletions

View File

@@ -57,6 +57,17 @@
{{ edit_field('Change', url_for('.service_set_inbound_sms', service_id=current_service.id)) }}
{% endcall %}
{% if can_receive_inbound %}
{% call row() %}
{{ text_field('API endpoint for received text messages') }}
{{ text_field(
'None' if not inbound_api_url else inbound_api_url,
status='' if inbound_api_url else 'default'
) }}
{{ edit_field('Change', url_for('.service_set_inbound_api', service_id=current_service.id)) }}
{% endcall %}
{% endif %}
{% call row() %}
{{ text_field('Letters') }}
{{ boolean_field(current_service.can_send_letters) }}
@@ -72,6 +83,7 @@
{{ edit_field('Change', url_for('.service_set_letter_contact_block', service_id=current_service.id)) }}
{% endcall %}
{% endif %}
{% endcall %}
</div>

View File

@@ -0,0 +1,38 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Inbound api
{% endblock %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-five-sixths">
<h1 class="heading-large">API endpoint for received text messages</h1>
<p>
This is the https url that the inbound SMS messages will be posted to
and the bearer token used in the authorisation header of the request.
</p>
<form method="post">
{{ textbox(
form.url,
width='2-3',
hint='Valid https url'
) }}
{{ textbox(
form.bearer_token,
width='1-4',
hint='At least 10 characters'
) }}
{{ page_footer(
'Save',
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
</form>
</div>
</div>
{% endblock %}