Zang.io REST GET from workflow designer


#1

Hi, im trying to do a REST GET from a zang.io workflow to a Nest Home Simulator device. but there is a http error. Please help
Error encountered during execution of REST Service task: IllegalStateException: Received HTTP error response: HTTP/1.1 401 Unauthorized


#2

I’m not familiar with zang.io, but for the OAuth Token, perhaps you need to put “Bearer” at the beginning? So “Bearer c.1RY…”

Like in the Postman screenshot here: https://developers.nest.com/documentation/cloud/how-to-auth#postman_example_readwrite


#3

Hi Jeff, thanks for your comments.

We tried using Bearer and a few more ways, but still the same error.
Maybe the simulator is not allowing more authentications? We are making this GET from Shell, but we are still using the authentication given on Postman:

!/bin/sh

wget --quiet --method GET --header ‘content_type: application/json’ --header ‘Authorization: Bearer c.1RYJQj91UWDQEleptcPplgLEohWB7JUhDil8LJMNazZ0ZcsCrlzWDTozuGeNvc0iiV4JaKmJSdqGNxfGRXbH4YXJYWgqt41SMvcduwefCX6abmpGNzDJyvkTQxORmkdN0wwK8AmXi8XTM38a’ --header ‘Cache-Control: no-cache’ --header ‘Postman-Token: 360cdeae-0444-8993-1b9b-126dea0ca104’ --body-data ‘client_id=6c5aa818-1669-49fd-98e1-f34297725c3b&client_secret=fXvJohKNBgwQXQ9vSSs9VsESk&grant_type=authorization_code&code=RLZ989GR’ --output-document log.txt - https://developer-api.nest.com/devices/cameras/DlNROpc7f0RE8v0S35MDuR3FK83eVIayTU0gG-hZrmLPzUhVFSR5-w/last_event

That make sense for you?


#4

I need to authenticate from a REST service from Zang.io, but is not posible because of Zang doesn’t support grant_type authorization_code.

Is it posible to change my account to use this parameters to authenticate? Please Helppp

client_id xxxxxxxxxxx

client_secret xxxxxxxxxxx

grant_type password

username The usename you configured on the REST task property page;
password The password you configured on the REST task property page


#5

The grant_type must be “authorization_code”, we can’t change it.