This topic contains 3 replies, has 2 voices, and was last updated by  nigel_thorne 7 years, 10 months ago.

How to Create Channel Groups programatically.

  • I need to push new channels to an Iguana instance, then lock them so local users can’t change them.

    I can currently programatically deploy new channels. I am unable to find an API to allow me to group the channels and set roles so the local users are unable to make changes.

    Can this be done?

    I have a fallback plan of simulating the conversation the web UI had with the server by doing the following (although it’s not yet tested):

    HTTP POST to http://localhost:6543/channel_groupings_control.html
    With form data

    group: LAAPS
    old_group_name:
    action: createGroup
    description: xxx
    included_channels: 567D7B37C714D9DDCA1E7A874251930C,3C177095DB412FE64EF5E5F7AE60D9A6,67271FA7F0A73F0549A34DD6EC00DF29,72BEE42FA4FC36BB0923C892F2FAB573

    Then POST http://localhost:6543/role_control.html

    role:Users
    action:editRole
    description:
    channel_group_view_logs_547707F301BFA6A09ED270729F2E3A87:on
    channel_group_startstop_816785B44FBD36D7D50A94E55E078ED9:on
    channel_group_export_816785B44FBD36D7D50A94E55E078ED9:on
    channel_group_view_logs_816785B44FBD36D7D50A94E55E078ED9:on
    547707F301BFA6A09ED270729F2E3A87:visible
    816785B44FBD36D7D50A94E55E078ED9:visible

    Is there a better way?

    No there isn’t a better way. I would recommend that you:

    1. Document what you have done by referring to this thread.
    2. Share the code with our code sharing system
    3. Then in the event an official API is created who ever is maintaining that code can come back to this thread
    4. And of course make sure you package up the call as a module so that it’s easy to change the implementation in the future

    Hope that helps! Did you just use the Chrome or equivalent tools to reverse engineer the form of the web calls to do this?

    (may be incorrectly presuming you are using lua code for the interaction)

    Yep I just monitored the web calls using Chrome devtools. Obviously being an undocumented API anything I implemented could break whenever we upgrade Iguana.

    I will probably implement this as C# code. Obviously I will need to also handle starting a session (authenticating) first. Again I’ll reverse engineer it unless there is a nicer way.

Tagged: 

You must be logged in to reply to this topic.