03-28-2025 07:36 AM
I'm trying to use the xAPI to modify or create macros on RoomOS devices. Even though the API responds with success, the macro doesn't reflect that it's updated in the web UI. Is this because the macro is managed by Control Hub or locked for editing via xAPI?
Thanks
03-28-2025 09:20 AM
No it’s not because of Control Hub management of macros or that is locked. If you share exactly what you’re doing it might be easier for us to help you.
03-28-2025 10:06 AM
We’re using PowerShell to push macros to RoomOS endpoints via HTTP POST to the /putxml endpoint. Here’s the request format:
HTTP POST Endpoint
https://<device_ip>/putxml
Headers
Authorization: Basic <base64-encoded admin:password>
Content-Type: text/xml
Body
<Command>
<Macros>
<Macro>
<Save>
<Name>reportIssue</Name>
<Source>
import xapi from 'xapi';
console.log('test from PowerShell');
</Source>
<Overwrite>true</Overwrite>
</Save>
</Macro>
</Macros>
</Command>
We’re using Invoke-WebRequest in PowerShell to send this payload. The macro is a test version that works fine when entered manually via SSH with xCommand Macros Macro Save.
What’s Going Wrong
• The request appears to succeed (no 401/403 errors)
• But the macro is not saved on the device
• Or we get XML syntax error: EntityRef: expecting ';' Line 9, Column ###
• Or no macro content is returned afterward
When trying interactively via SSH, the macro saves and runs correctly, so we know the source is valid.
What We’re Trying to Confirm
• Are there limitations when saving macros via HTTP putxml with multiline JavaScript source?
• Is there a different encoding or escaping requirement for <Source> contents?
Any insights would be appreciated — thanks!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide