Updated Developer Docs!

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)

8 Likes

Nice job man! Love the new documentation!!

1 Like

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

2 Likes

@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)!

3 Likes

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

1 Like

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) ?

2 Likes

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:

4 Likes

Thank you for this! Great work as always.

Done

stnode.js

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

5 Likes

Nice!!!

Mind if we link to this in our docs?

2 Likes

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…

3 Likes

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

1 Like

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:

1 Like

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.

4 Likes

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

7 Likes

@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…

2 Likes

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).

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?

2 Likes

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

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:

1 Like