vqndev / viper-smart-start-postman

Collection of HTTP Requests to interact with Viper SmartStart
3 stars 3 forks source link

Can't Get DeviceID #1

Open JSylvia007 opened 4 years ago

JSylvia007 commented 4 years ago

So, this looks promising. All of the other platforms to interact with Viper are dead, but I just can't figure out how to get the DeviceID. I'm not sure what you mean by use the "postman" post requests. Any help would be really appreciated!!

JSylvia007 commented 4 years ago

OK... So I used GetPostman to import the JSON from the repo, and I was able to get the device ID. Now, when I call the url, the response I get back is:

{"errors":[{"code":4,"message":"The command requested is not valid for this device."}],"results":null}

I have the new LTE Viper SmartStart. Any thoughts?

JSylvia007 commented 4 years ago

Ok... So I figured out that it's actually the "assetID" that you're supposed to use... Now I get this error message:

{"errors":[{"code":6,"message":"You are not authorized to complete this action."}],"requestMethod":"POST","path":"\/v1\/devices\/command"}

Do I need to enable something on my account? Do I need to call Viper?

rchampion commented 4 years ago

Any luck? I'm also stuck at the same point.

JSylvia007 commented 4 years ago

Any luck? I'm also stuck at the same point.

Unfortunately not... I really wish I could get this to work. There are so many things I want to use this for...

rchampion commented 4 years ago

I tried the php script and got the same error. :(

mikep809 commented 4 years ago

Is this viper program working?

JSylvia007 commented 4 years ago

I know this isn't the answer that anybody wants, but I've abandoned viper and gone instead for drone mobile. The drone works amazingly well, and the features are there.

rchampion commented 4 years ago

I got the PHP script to work and had to try multiple IDs before I found the right device ID. Instead of using arm_status / disarm_status it's just arm / disarm. I can start my car and open my garage with one voice command.

On Fri, Apr 17, 2020 at 4:27 PM Jacob Sylvia notifications@github.com wrote:

I know this isn't the answer that anybody wants, but I've abandoned viper and gone instead for drone mobile. The drone works amazingly well, and the features are there.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vqndev/viper-smart-start-postman/issues/1#issuecomment-615491402, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVDXMBORS4GGHWWTP3LS3TRNDJWTANCNFSM4JSBK52Q .

spoteat commented 4 years ago

Has anyone gotten this to work successfully? If so, so can someone please write out step-by-step instructions. I really interested. How do I get my apikey and deviceid?

spoteat commented 4 years ago

I got the PHP script to work and had to try multiple IDs before I found the right device ID. Instead of using arm_status / disarm_status it's just arm / disarm. I can start my car and open my garage with one voice command. On Fri, Apr 17, 2020 at 4:27 PM Jacob Sylvia @.***> wrote: I know this isn't the answer that anybody wants, but I've abandoned viper and gone instead for drone mobile. The drone works amazingly well, and the features are there. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#1 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVDXMBORS4GGHWWTP3LS3TRNDJWTANCNFSM4JSBK52Q .

Hi rchampion, How did you get the deviceId, apikey, and accesstoken?

mikep809 commented 4 years ago

Hi Spoteat

Do you have step by step programming instructions. Greatly appreciated.

Regards Mike

spoteat commented 4 years ago

I don't :( I would love to get them from someone who has successfully got it to work.

On Thu, Apr 30, 2020 at 7:13 PM mikep809 notifications@github.com wrote:

Hi Spoteat

Do you have step by step programming instructions. Greatly appreciated.

Regards Mike

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/vqndev/viper-smart-start-postman/issues/1#issuecomment-622167637, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHKELA53K655L4VAVEQUJTRPIAZBANCNFSM4JSBK52Q .

TannerFilip commented 3 years ago

I'm a bit late, but I'm pretty sure the API key is something you're supposed to set yourself and only used to authenticate you to this script. So your API key is ABC123 by default, but you can change it to whatever you want.

I threw together a Python script to get the info it needs for the device ID and access token. I believe you actually need the asset ID, but both are included (I haven't actually used the php script, just the Postman info). You'll need the requests module installed.

import requests

username = 'yourUsername'
password = 'yourPassword'

login = requests.post('https://www.vcp.cloud/v1/auth/login', {'username': username, 'password': password})

loginResp = login.json()
accountId = loginResp['results']['user']['accountId']
authToken = loginResp['results']['authToken']['accessToken']

deviceInfo = requests.get(
    f"https://www.vcp.cloud/v1/devices/search/null?limit=100&deviceFilter=null&sortCol&sortDir=desc&accountId={accountId}", headers={"Authorization": f"Bearer {authToken}"})

deviceResp = deviceInfo.json()
deviceId = deviceResp['results']['devices'][0]['id']
assetId = deviceResp['results']['devices'][0]['assetId']

print("Auth token: " + authToken)
print("Account ID: " + str(accountId))
print("Device ID: " + str(deviceId))
print("Asset ID: " + str(assetId))
guarddog13 commented 2 years ago

I'm not sure if anyone is interested or not but I was able to get this to work.

pumkapie commented 1 year ago

I'm not sure if anyone is interested or not but I was able to get this to work.

I'm interested! I followed your guide, but I'm getting the following error while trying to use any of the commands:

{
    "errors": [
        {
            "code": 6,
            "message": "You are not authorized to complete this action."
        }
    ],
    "requestMethod": "POST",
    "path": "/v1/devices/command"
}

I've tried getting new access tokens, but the error persists.