To make it easy to build apps with AT&T API, we just added the AT&T OAuth API Plug-in. The plug-in sets up the OAuth 2 authentication by returning an access token which then can be used to invoke any other AT&T API.
To import the plug-in, select Create New > From Plug-in > ATT OAuth API:
Once the plug-in is imported, open ATT_Settings file:
and set the client_it, client_secret, and scope. The client_id, and client_secret will be available once you register an app at http://developer.att.com. The scope value depends on the API you are going to use. For example, if you the Location API, it will be TL. Refer to docs for the correct scope for each API.
Here is an example of a registered app with three scopes (in red):
One more thing that needs to be set is the OAuth 2 redirect (or callback URL) in app settings
For the callback URL to work correctly, also do the following in the Test window (upper right):
- Uncheck Open in mobile frame
- Make the app pulbic
When running the app and you are not signed in into AT&T, you will see this page:
when signed in, you will see the access token:
The access token is also stored into local storage so you can use it to invoke other AT&T APIs.