I'm trying to follow the article http://msdn.microsoft.com/en-us/library/office/fp179895%28v=office.15%29.aspx
For a SharePoint 2013 hosted under O365, do I need to create an app to use the SP.* methods in sp.js? I need to call a remote API from the root domain (https://mycompany.sharepoint.com). But the app, as mentioned in the article above, deploys on a whole different URL (https://mycompany-a2d3f4t454.sharepoint.com).
I need to be able to call the API from pages like https://mycompany.sharepoint.com/pages/default.aspx. Is this not possible?