view mod_post_msg/README.markdown @ 3355:3bc68057f232

mod_password_reset: Implement password policy enforcement (requires mod_password_policy)
author Matthew Wild <>
date Tue, 09 Oct 2018 14:12:45 +0100
parents 926aaaeb0d21
line wrap: on
line source

summary: 'Receives HTTP POST request, parses it and relays it into XMPP.'


Sometimes it's useful to have different interfaces to access XMPP.

This module allows sending XMPP
[`<message>`]( stanzas via a
simple HTTP API.

Example usage

    curl -u -H "Content-Type: text/plain" -d "Server@host has just crashed!"

This would send a message to user\ from me\


URL format

    /msg/ [recipient [@host] ].

The base URL defaults to `/msg`. This can be configured via Prosodys
[HTTP path settings][doc:http].


Authentication is done by HTTP Basic.

    Authentication: Basic BASE64( "username@virtualhost:password" )

Payload formats

Supported formats are:

:   The HTTP body is used as plain text message payload, in the `<body>`

:   Allows more fields to be specified.

:   Similar to form data.

Which one is selected via the `Content-Type` HTTP header.

### Data fields

The form data and JSON formats allow the following fields:

:   Can be used instead of having the receiver in the URL.

:   [Message type.](

:   Plain text message payload which goes in the `<body>` element.


Some code originally borrowed from mod\_webpresence