Junebug Message API ------------------- This application provides bidirectional messaging over HTTP, primarily intended for integration with RapidPro. Configuration ^^^^^^^^^^^^^ The application has the following configuration options: **Common to all vumi workers** All the configuration items from the base worker (see :ref:`base-worker-configuration` for details) are available. However, :py:data:`http_bind` is required rather than optional. **Junebug Message API specific** .. py:currentmodule:: vumi2.applications.junebug_message_api .. py:data:: connector_name :type: str The name of the AMQP queue to publish outbound message on, and to consume inbound messages and events from. Required. .. py:data:: mo_message_url :type: str The URL to send HTTP POST requests to for inbound messages. If a username and password are included in the URL, they will be used for basic authentication. Required. .. py:data:: mo_message_url_auth_token :type: str The authorization token to use for inbound message HTTP requests. Token authentication will only be used if a token is provided. Defaults to no token. .. py:data:: default_event_url :type: str The default URL to send HTTP POST requests to for events that don't have stored event delivery info from the associated outbound message. If unset, such events cannot be delivered and will be logged instead. .. py:data:: default_event_auth_token :type: str The authorization token to use for events sent to the :py:data:`default_event_url`. Token authentication will only be used if a token is provided. Defaults to no token. .. py:data:: base_url_path :type: str Base URL path for outbound message HTTP requests. Outbound message requests must be POSTed to ``/messages``. For compatibility with existing Junebug API clients, set this to ``/channels/``. Defaults to an empty string. .. py:data:: transport_type :type: str The transport_type to use for non-reply outbound messages. Defaults to ``sms``. .. py:data:: default_from_addr :type: str The from address to be used for non-reply outbound messages that don't specify a from address. By default, non-reply outbound messages are required to specify a from address. .. py:data:: allow_expired_replies :type: bool If ``True``, outbound messages with both ``to`` and ``reply_to`` set will be sent as non-reply messages if the ``reply_to`` message can't be found. Defaults to ``False``. .. py:data:: state_cache_class :type: str The python path to the class used for the application state cache. This class is resposible for caching inbound messages for outbound replies and event info for outbound messages. Defaults to ``vumi2.applications.junebug_message_api.junebug_state_cache.InMemorySmppCache``, which stores the data in memory. See :ref:`junebug-state-caches` for a list of state caches. .. py:data:: state_cache_config :type: dict The config that :py:data:`state_cache_class` requires. See :ref:`junebug-state-caches` for details. .. py:data:: request_timeout :type: float The maximum time allowed (in seconds) for outbound message request handling. Defaults to 240. .. py:data:: mo_message_url_timeout :type: float Maximum time allowed (in seconds) for inbound message HTTP requests. Defaults to 10. .. py:data:: event_url_timeout :type: float Maximum time allowed (in seconds) for event HTTP requests. Defaults to 10. How it works ^^^^^^^^^^^^ The application worker listens on HTTP for outbound messages from the external application and forwards them over AMQP to a router or transport. Inbound messages and events are forwarded to the external application over HTTP. Outbound message API """""""""""""""""""" .. http:post:: /messages Send an outbound (mobile terminated) message. : :/messages` have the following format: .. http:post:: / :