Turn Access Token into Client ID/Secret

samsungsmartthings
oauth
hubv2
api

(Jack) #1

Hi,

I am trying to turn my Smartthings access token into a client ID and secret.

I got my token from https://account.smartthings.com/tokens.

I am trying to use a curl command, similar to Particle IO, to turn my token into the client id/secret I need.

Does anyone know how to do this?

The link in the curl command below is my problem. The Particle IO client site is https://api.particle.io/v1/clients (“access token URL”). This site works for turning a Particle IO access token into the client id/secret. However, when I try with Smartthings (https://api.smartthings.com/v1/clients), it gives me an error.

What is the correct URL for Smartthings (“access token URL”) to get this all working?

Below is the curl command I use to turn an access token into the cliend id/secret:

curl https://api.smartthings.com/v1/clients -d name=Tek -d type=web -d access_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -d redirect_uri=https://pitangui.amazon.com/api/skill/link/M2JG8VGTIBNOSK


#2

Okay…I’m a bit confused. Why are you trying to do this? Or more accurately, what functionality are you trying to accomplish by doing this? Are you trying to send a command to the Particle API from SmartThings?


(Jack) #3

I need to do this so I can put the client ID and secret in my configuration for an Alexa skill (this is for account linking). I use particle IO command as an example, showing that it works to turn a token into a client id and secret, but really I just want to turn my Smartthings token into a client id and secret.


#4

You’re not making any sense. You haven’t said anything SmartThings related yet. What are you trying to make SmartThings do? What device are you referring to?
Are you are trying to link the particle api to Alexa through ST? Doesn’t work that way.
Just cause SmartThings apps have client id’s and secrets doesn’t mean you can use it to authenticate you for two other systems. That’s not what SmartThings does. It’s a home automation platform


(Jack) #5

I’m simply asking if there is a way to turn my Smartthings access token into a client id and secret. That’s all. Is there a way?


#7

What access token? Each smart app gets a client id and secret when you give it oath.


(Jack) #8

When you login into this link, https://account.smartthings.com/tokens, it gives you an access token for your account. This is not related to smartapps, but it is the required token for endpoints like AWS lambda to make commands (on/off) to the Smartthings hub.


#9

Ok… So why do you need to change that into a client id /secret. Your question makes no sense.


(Jack) #10

I need to configure account linking for my Amazon Alexa skill, but it only accepts cliend id and secret. I only have access token.


#11

Wrong. You cannot link Alexa and st directly. You have to use a smartapp. LOL. Try searching for Alexa and SmartThings. A lot of people have created different apps to link them.


(Jack) #12

Yes, many people have created stuff like this. But I am making a Smart Home Skill, not a custom skill.


#13

Yes, on the Alexa side. On the smartthings side you have to have a smart app. That’s what will give you the client ID and Secret. There is no way to do what you are trying to do without a smart app


(Jack) #14

Why is this so… because it seems like it could be all controlled the Alexa skill, according to their API: https://smartthings.developer.samsung.com/develop/api-ref/st-api.html#operation/executeDeviceCommands?


#15

LMAO…you just won’t accept ity no matter what I say. Didn’t you wonder why no one else bothered to reply to your post? I’m the only one who’s bothered to help you but you refuse to accept the solution.


(Jack) #17

Isn’t it possible to control my Smartthings now, with the new Smartthings API? According to https://smartthings.developer.samsung.com/develop/api-ref/st-api.html#operation/getDevices, I am able to retrieve a list of my devices. I have tested this using Postman and my access token. So, I do not need a Smartthings Smartapp. On this site, it says “For personal access tokens, the scope is limited to the account associated with the token.” So this means I should be able to have control over my devices right? Can you verify if this is true please?

Also just wondering, from all the previous posts you’ve made, were you referencing the old Smartthings API or the new Smartthings Rest API?