Updated Developer Docs!


(Jim Anderson) #1

We’ve recently updated some key areas of our developer docs today. The changes include:

  • Expanded documentation on storing data using state. This includes information about some of the gotchyas with state, and how to use atomicState to address those.
  • New guide on sending notifictions in SmartApps
  • Updated SmartApp Web Services Guide
    • Cleaned up the landing page and Overview sections to be more readable.
    • Refactored the “Implementation” section into a 2-part tutorial. Part 1 walks you through building a simple Web Services SmartApp, and uses curl to hit those endpoints. Part 2 builds an external application using Sinatra, that shows going through the OAuth2 flow programtically.

We hope you find the updated content useful! (and if you don’t, let us know)


(Tim Slagle) #2

Nice job man! Love the new documentation!!


(John S) #3

Nice job on that :slight_smile: Now, can you do it in Node.js? :stuck_out_tongue:


(Jim Anderson) #4

@schettj I want to. I really, really do! But… priorities :smile:

BUT - if you (or anyone else) wants to create a Node version, we can try to incorporate it into the docs (or at least link to the source for a Node example)!


(April Wong) #5

^ This is why @jim and team are my favorites. Nice job on the docs, dude!


(Jason Mok) #6

Information on State and Atomic State are really useful!

Any chance that you’ll be working on documenting any built in features by ST in the next update like celsiusToFahrenheit(BigDecimal) ?


#7

Oh, sure, it’s always the doc guys who get all the credit!
If it wasn’t for engineers, there’d be no need for documentation, remember that!

Oh…wait…:kissing:


(The fish is still dead.) #8

Thank you for this! Great work as always.


(John S) #9

Done

stnode.js

Takes the two secrets on the command line, displays the final url and bearer in your browser after authenticating


Amazon Echo Developers Access
Authentication changes
(Jim Anderson) #10

Nice!!!

Mind if we link to this in our docs?


(Jim Anderson) #11

Anything specific you want to know? Or just want it, ya know, just want it doc’d at all :smile:

Our plan for the next few weeks is to try and doc as much as we can around the new v2/UX stuff that has developer impact. Not sure if we have much bandwidth to fit other stuff in, but if you have a specific question, maybe we can help or get it doc’d quick…


(Tim Slagle) #12

Love this idea!! It’d be super cool to hit the ground running full steam ahead with V2/UX stuff


(John S) #13

Not at all, that’s why it’s there - I needed to stop being lazy and do that for some other project anyway - just made a clean sample version for anyone else wandering down this rabbit hole :smile:


(Jason Mok) #14

I don’t know what I don’t know, so I can’t be specific. We aren’t allowed to do a getClass() in the IDE, so lots of useful methods such as getTemperatureScale() instead of doing a location.temperatureScale are hidden from the developers.

Some of those functions are found in device types & smartapp examples and it’s kinda hard to find one out by going through a lot of those examples. I’d be nice to know so developers don’t have to spend too much time developing a custom method.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #15

Also would be extremely handy to have a link to the entire white list of importable classes, please.


(John S) #16

@Jim, does SmartThings process the revocation of access tokens? The examples and docs don’t mention it, but I’m guessing they do since that’s a core part of oauth?

If so, perhaps a code snippet on that would be useful…


(Jim Anderson) #17

Currently a long-living token (50 years) is issued, and no refresh token. That may be something that changes in the future, but as of right now, you get a token with a very long expiration (and no refresh token).


(Alex) #18

Long time ago, when createAccessToken() was called, it would invalidate any existing access tokens. Now it just creats additional ones. There is no apparent way to invalidate an access token.

@Jim, could you shed some light on that?


(Alex) #19

Also, @Jim are you aware of any updates on Android compatibility with external href style?

http://docs.smartthings.com/en/latest/smartapp-developers-guide/preferences-and-settings.html#href


(Jim Anderson) #20

I don’t have the answer on hand, but I’ll take an action item to find out.

Same answer… I’ll take a look.

So in summary, I have very little to offer on either of these questions at the moment. Sorry for being rather unhelpful here :smile: