UiBuilder - How to use Instance API's

Hello everyone,

I am looking for some help setting up Instance APIs via uibuilder. I am using the latest version (7.5) and have followed the implementation described in the documentation( Create instance-specific API's), even replicating the examples, but I am unable to get it to work. The uibuilder.instanceApiAllowed parameter is set to true, but the response is always the same: Cannot GET /test/api/. There is nothing in the logs, and I don't know where else to look...

Does anyone have any ideas? What step have I missed? Thank you for your assistance.

I would follow the advice in the linked article:

Also note that it is best practice when using Node-RED to define API endpoints using http-in/out nodes rather than making use of this facility.

Bottom line is that Instance API's should be a facility of last resort and used sparingly.

1 Like

Hi, apologies for not replying, Just had some eye operations and can barely see just now.

As Steve has kindly responded. This feature was included for a specific request and, while it does work, it probably isn't brilliantly documented so sorry if you haven't been able to get it going.

As Steve points out. I would recommend using http-in/-response node pairs to implement a Node-RED specific API. The main exception to this would be if you wanted to make use of UIBUILDERs custom ExpressJS web server feature to separate out your API (and probably the API's authentication/authorisation) from the rest of Node-RED.

Not really in a position to help with code or testing just now I'm afraid, I should be back to it in a couple of weeks.

1 Like

Thank you very much for your answers. I will follow your advice :wink: