If you are developing a Workspace add-on (Gmail, Calendar, Drive), you are limited to using the cards and cardservice. If you are making an Editor add-on (Sheets, Docs, Slides, Forms), then you might be able to do what you want while serving HTML.
Otherwise, you should still be able to use the built-in
UrlFetchApp instead of creating your own Class.