I connect to a lot of external APIs, and I tend to try and bunch their logic up into CFCs so they're there in a format I can reuse if needed.
So I'll do something like
/miscellaneous/xero/xero.cfc
then I can do stuff like
xero = new miscellaneous.xero.xero(
client_id = application.settings.XERO_CLIENT_ID,
client_secret = application.settings.XERO_CLIENT_SECRET
);
local.token = xero.refreshToken();
wherever I need to.
It just means I can encapsulate that logic in a single place, and standardise the return / get formats etc.
Nothing stopping you doing it in a tableless model I guess, but I tend to want the flexibility of it in a standard CFC incase I need to move it outside of wheels or share the code.
T