title: XMPP 0059/0313 Archive message - paging backwards through result set
body: <p>I have gotten the last 10 messages from archive, and trying to get the 10 before that on request and so on.</p>
  
  <p>On the XMPP doc. it said i set the before with my UID??</p>
  
  <p><a href="http://xmpp.org/extensions/xep-0059.html#backwards" rel="nofollow">http://xmpp.org/extensions/xep-0059.html#backwards</a></p>
  
  <pre><code>&lt;iq type='set' from='stpeter@jabber.org/roundabout' to='users.jabber.org' id='back1'&gt;
    &lt;query xmlns='jabber:iq:search'&gt;
      &lt;nick&gt;Pete&lt;/nick&gt;
      &lt;set xmlns='http://jabber.org/protocol/rsm'&gt;
        &lt;max&gt;10&lt;/max&gt;
        &lt;before&gt;peter@pixyland.org&lt;/before&gt;
      &lt;/set&gt;
    &lt;/query&gt;
  &lt;/iq&gt;
  </code></pre>
  
  <p>or this?? <a href="http://xmpp.org/extensions/xep-0313.html#query-paging" rel="nofollow">http://xmpp.org/extensions/xep-0313.html#query-paging</a></p>
  
  <p>with some ID in the after tag? I am very confused, can anyone give me some pointer, thanks!</p>
  
  <pre><code>&lt;iq type='set' id='q29303'&gt;
    &lt;query xmlns='urn:xmpp:mam:1'&gt;
        &lt;x xmlns='jabber:x:data' type='submit'&gt;
          &lt;field var='FORM_TYPE' type='hidden'&gt;&lt;value&gt;urn:xmpp:mam:1&lt;/value&gt;&lt;/field&gt;&gt;
          &lt;field var='start'&gt;&lt;value&gt;2010-08-07T00:00:00Z&lt;/value&gt;&lt;/field&gt;
        &lt;/x&gt;
        &lt;set xmlns='http://jabber.org/protocol/rsm'&gt;
           &lt;max&gt;10&lt;/max&gt;
           &lt;after&gt;09af3-cc343-b409f&lt;/after&gt;
        &lt;/set&gt;
    &lt;/query&gt;
  &lt;/iq&gt;
  </code></pre>
  
  <p>I tried putting in before with my UID and it didnt work <code>&lt;before&gt;peter@server.org&lt;/before&gt;</code></p>
  
  <p>ANd i have an error <code>&lt;error code='400' type='modify'&gt;&lt;bad-request xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/&gt;&lt;/error&gt;&lt;/iq&gt;&lt;/body&gt;</code></p>
  
  <p>I am using strophe.js mam plugin and rsm plugin</p>