How to get xmpp MUC group chat history messages from server (or discussion history)

I am developing the chatting app in which there is one to one chat as well as group chat. I am able to get messages history of one to chat using mod_mam at server & sending iq from client. But for group chat, I am not getting history. Message archiving module is enabled at server side. For fetching history I am sending iq like

iq to="room@conference.xmpp.org" type="get"
history xmlns="http://www.jabber.com/protocol/muc#history" start="1970-01-01T00:00:00Z" direction="forward" count="100"
/iq

If anyone worked on this please let me know how to do this? Is there different iq for fetching the message history of group chat?

In ejabberd.yml, enable

In ejabberd.yml, enable mod_mam.

Create a room, configure it and enable Archiving in it.

Join the room, send some message, and then request the history:

<iq type='set' id='juliet1' to='room1@conference.localhost'>
  <query xmlns='urn:xmpp:mam:1' queryid='f27' />
</iq>
Syndicate content