I've been trying to work with my Nest thermostat so I can work it into home automation run by my Arduino-based projects. So far, I've completely failed to get anything done. I would greatly appreciate input or redirection to other resources.
I signed up under the Nest developer and created a client with read/write permissions.
I'm at the OAuth step where I want to start pulling basic information out of thermostat. I went to https://home.nest.com/login/oauth2?client_id=[clientID]&state=STATE where clientID is the clientID for my project. I left STATE as is.
I received the PIN that I'll call 99ITPUMP and I put that into Git BASH like so:
curl POST https://api.home.nest.com/oauth2/access_token?code=99ITPUMP&client_id=[clientID]&client_secret=[clientSecret]&grant_type=authorization_code
The response I get is
$ curl: (6) Could not resolve host: POST
{"url":"/oauth2/access_token?code=99ITPUMP","message":"404 Not Found"}
I've tried getting a new auth code multiple times and still can't get anything. Can anybody tell me what I'm doing wrong? I need to get basic information from my Nest within the bash console. For anyone providing an answer, please make it is idiot-proof as possible. I really have no idea what I'm doing so I'm doing my best to learn.
Try something like:
curl --data 'code=99ITPUMP&client_id=[clientID]&client_secret=[clientSecret]&grant_type=authorization_code' https://api.home.nest.com/oauth2/access_token
Related
I am trying to post a simple json to our backend api through REST POST snap. Everything was working. And then we changed the url to a new url and I updated the url in the snap.
But now request is simply not reaching our new api server.
In fact, the snaplogic pipeline also completes successfully, with all snaps turning green. Only when I click on the properties of pipeline, I get to know that REST POST snap has failed, with attached screenshot error.
Please note that we are able to reach the new api server via postman or any other rest client. Nothing has changed at all except for the url.
Can you please help me understand, what exactly is going wrong and where? How to debug this?
Just for everyone's reference, I was able to find out the root cause.
Reason was that the api url was not accessible to snaplogic pod running in our enterprise because of Zscaler firewall.
The confusing part here was the error message returned which says "SSL issue, connection was reset". So if you see issue saying "Connection was reset", assume that snaplogic is unable to access the url as the first problem. Only after making sure, it is not the case, go and look for what exactly the error says.
I am following this guide to build NodejS bot using Gupshup whatsapp https://www.gupshup.io/developer/docs/bot-platform/guide/gupshup-bot-library-for-node
I am running the code and getting the ngrok URL:
But when following steps are given, I get an error as below:
Not sure what is wrong here. Please let me know how can I solve this issue?
Sometimes ngrok service can be not reachable (for any reason).
First - make sure you can open ngrok link in the browser or by curl and make sure it reaches your server api.
Also if your backend check incoming requests for specific app key in header, you should also add it to url params, due to you have no way to manage GupShup api caller.
for the first time setting callback you need to return a 200 status.
res.status(200).send('ok');
Use this as first line for first time for setting callback and after call back is set you can comment this out. And save and relauch your code (make sure address of your hosted code is same don't restart ngrok :P) is same
I want to save the data column from this url to an array in python. I tried it with, for instance, pandas.save_table:
import pandas as pd
pd.read_table('https://adventofcode.com/2019/day/1/input', sep='')
but I get HTTPError: HTTP Error 400: Bad Request and I think this is not the right way to do that.
Can someone help me with that?
If you try to open the link in your question (in a browser using incognito mode or something similar i.e. delete your cookies) you'll see that you need login into the website to access the page. This is why the you're getting a 400 Bad Request error as a response from the server.
From the FAQ section of the website that you're trying to access:
How does authentication work? Advent of Code uses OAuth to confirm
your identity through other services. When you log in, you only ever
give your credentials to that service - never to Advent of Code. Then,
the service you use tells the Advent of Code servers that you're
really you. In general, this reveals no information about you beyond
what is already public; here are examples from Reddit and GitHub.
Advent of Code will remember your unique ID, names, URL, and image
from the service you use to authenticate.
The website uses OAuth to handle logins to the url that you create will need these access tokens. You can use a library like python-oauth2 to help you with this (there are others so you can read around and decide which you'd like to use). Creating and understanding how to make http requests is beyond the scope of this answer. I'd suggest you have a look around on the internet for some explanations and try again, if you have get stuck please ask another question. Otherwise it'll probably be easier to save the file from your browser...But I'll leave this answer here for the next person who runs into the same problem.
I tried
curl -F "file=#/mnt/usb/anime.txt" https://dbinbox.com/galihpa
but it gave me
curl: (51) Cert verify failed: BADCERT_NOT_TRUSTED
I just can't figure out what's wrong. The url I want to post to is https://dbinbox.com/galihpa
Please help me..
I'm the creator of DBinbox :D
Unfortunately the old API has become depreciated with the recent total rewrite, deployed September 1st. There is currently no predictable way to upload files to DBinbox with curl.
That said, I'm working on a much prettier API that would make this a lot easier. I'll update this answer with documentation when it's ready!
I'm trying to use the web api to query a user's playlists (using the spotipy Python library). I got the user to oAuth in, got an access token, made the request and got a 500 error:
SpotifyException: http status: 500, code:-1 - https://api.spotify.com/v1/users/125139403/playlists?limit=50&offset=0: Server error.
I then tried the same request in Web API test console and it worked fine.
But then things get kind of weird. I tried running the cURL command the console generated in a terminal and got the same 500 error.
Then I tried running the same request using cURL but just changing the username in the URL and it worked fine (at least for public playlists) for both my username and a random friend's user ID number.
I thought maybe I'm having a token issue but the token I'm using seems to work fine with other usernames. It's just the one specific user for whom I'm getting the error.
I'd rather not post the user's ID on this public forum but I can email it to someone if it's relevant.
My best guess for what's wrong at this point is a bug on Spotify's side but I certainly could be doing something wrong.
Again, thanks for reporting this. This bug was fixed by Matt M. and was just deployed to production.
Please try it out in our API Console. (which Matt was also part of building!)