Capturing and Calling an api to send ROOM ID and Participant ID on muc-room-created

function room_created(event)
    local room =;
    local t = 20;
    local payload = [[value=t]];
    log("info", "VS: Room Created");
    local request = http.request(keyurl, {
                headers = http_headers or {},
                method = "POST",
                body = payload
        }, cb);

function process_host(host)
    if host == muc_component_host then -- the conference muc component
    module:log("info","Hook to muc events on %s", host);

    local muc_module = module:context(host);
    muc_module:hook("muc-room-created", room_created, -1);

In the above code how to capture and send the following information:

  1. Room ID
  2. Participant ID


You can get room._occupants here is some example of using that:

You can also import inspect and print the event object you have in those handlers and you will see which information works for you and extract it.