How can we read the app properties defined in the app profile in OTAG within the app?
I believe you can achieve that with the AppWorks Settings API.
A couple of things the swagger doc doesn't make explicit:
<your app name>.<your setting name>
demo_1.0.zip
llama.default=http://llama.com
gateway/v2/settings/demo.llama
You need to provide authentication to GET a setting. To do this:
for mobile apps, add an http header called otagtoken with the value of the javascript variable otag.auth.otagtoken
otagtoken
otag.auth.otagtoken
for Gateway web apps, include /webaccess/js/otag.js, and use otag.ajax() instead of jquery.ajax(); this wrapper sets the header for you
/webaccess/js/otag.js
otag.ajax()
jquery.ajax()
Thank you John this last part of getting the token is what I was missing.
While I was able to work directly with jquery.ajax, it looks like I cannot access otag.ajax. All I get is:
Object # has no method 'ajax'
Is it possible that I need to reference other js files other than jquery and otag.js?
Otag.js is currently just for web apps; mobile html5 apps should use $.ajax for now.