Retrieval of all events and messages

It is also possible to retrieve full history of login/logout events, and history of Jingle calls and messages.

Retrieve a list of entries

To retrieve items with informations about every archived entry item-type attribute needs to be added to <retrieve/> element from section 7.2 Retrieving a Collection of XEP-0136 specification with value set to any.

A result will be returned as specified in XEP-0136, but instead of <chat/> element <events/> element will be returned. <from/> and <to/> elements will have item-type attribute set to message, login, logout or call depending on type of returned event. Subelements of <from/> and <to/> elements will depend on type of archived event it represents.

Example

Request to retrieve events of juliet@capulet.com between 2014-02-01 13:00:00 and 2014-05-01 00:00:00 (sent from juliet@capilet.com account)

<iq type="get" id="query1">
    <retrieve xmlns='urn:xmpp:archive'
      with='juliet@capulet.com'
      start='2014-02-01T13:00:00Z'
      end='2014-05-01T00:00:00Z'
      item-type='any'/>
</iq>

Response with single login entry at 2014-02-01 13:01:34 with call SID.

<iq type="result" id="query2">
    <events xmlns='urn:xmpp:archive' with='juliet@capulet.com' start='2014-02-01T13:00:00Z'>
        <from secs='34' item-type='message'><body>Example message</body></from>
        <from secs='64' item-type='call'><sid>SID_OF_CALL</sid></from>
        <from secs='94' item-type='login'><bind>balcony</bind></from>
        <set xmlns="http://jabber.org/protocol/rsm">
            <first index='0'>0</first>
            <last>2</last>
            <count>3</count>
        </set>
    </events>
</iq>