Hello.
I am trying to get data from getpublicdata via
curl -X GET "https://api.netatmo.com/api/getpublicda ... lter=false" -H "accept: application / json" -H "Authorization: Bearer <client id>|<client secret> ".
When I substitute <client id>|<client secret> from the TRY IT OUT page, I get the data. When substituting my <client id>|<client secret> from "MY APPS" I get {"error": {"code": 2, "message": "Invalid access_token"}}. Please, help. What is wrong with me?
Problem with getpublicdata
Re: Problem with getpublicdata
Hello,
In your cURL request, you are using "Authorization: Bearer"
How did you retrieve the needed token ?
Have a good day,
Leslie - Community Manager
In your cURL request, you are using "Authorization: Bearer"
How did you retrieve the needed token ?
Have a good day,
Leslie - Community Manager
Re: Problem with getpublicdata
https://dev.netatmo.com/apps/ - I created app and get client id and client secret from App Technical Parameters
Re: Problem with getpublicdata
Ok for this part
But you need to obtain a token by doing a POST request to /token endpoint. You can follow our documentation here : https://dev.netatmo.com/apidocumentatio ... ation-code
Once access_token and refresh_token generated and accessible via the JSON response, you can make your GET request to /getstationsdata with this Bearer token to access data
Have a good day,
Leslie - Community Manager
But you need to obtain a token by doing a POST request to /token endpoint. You can follow our documentation here : https://dev.netatmo.com/apidocumentatio ... ation-code
Once access_token and refresh_token generated and accessible via the JSON response, you can make your GET request to /getstationsdata with this Bearer token to access data
Have a good day,
Leslie - Community Manager
Re: Problem with getpublicdata - 2
Hello.
I am using GETPUBLICDATA and I want to get data only from the territory limited by the specified coordinates. But GETPUBLICDATA also returns points outside this territory. Why? I don't need this data.
I am using GETPUBLICDATA and I want to get data only from the territory limited by the specified coordinates. But GETPUBLICDATA also returns points outside this territory. Why? I don't need this data.
Re: Problem with getpublicdata
Hello,
Can you please send me the coordinates you use and which area you wanted to reach in order me to check it ?
Have a good day,
Leslie - Community Manager
Can you please send me the coordinates you use and which area you wanted to reach in order me to check it ?
Have a good day,
Leslie - Community Manager
Re: Problem with getpublicdata
for examle , for lat_ne=55, lon_ne=144, lat_sw=46, lon_sw=141 i am getting extra data :
"_id": "70:ee:50:2c:93:c8",
"place": {
"location": [
140.181745, !!!
41.971589 !!!
],
"_id": "70:ee:50:05:f1:88",
"place": {
"location": [
140.430287299808, !!!
42.1174762398397 !!!
],
...
"_id": "70:ee:50:2b:43:68",
"place": {
"location": [
141.779694,
42.75144 !!!
],
etc , mo than 40 extra points
"_id": "70:ee:50:2c:93:c8",
"place": {
"location": [
140.181745, !!!
41.971589 !!!
],
"_id": "70:ee:50:05:f1:88",
"place": {
"location": [
140.430287299808, !!!
42.1174762398397 !!!
],
...
"_id": "70:ee:50:2b:43:68",
"place": {
"location": [
141.779694,
42.75144 !!!
],
etc , mo than 40 extra points
Re: Problem with getpublicdata
Indeed, you seem to use coordinates for Sakhaline island and I retrieve data also for Tokyo ... Maybe an issue with the size of the square. I report it to developers to check it
Meanwhile, you can try to ask for smaller squares in your /getpublicdata research. It seems to display more relevant data
Meanwhile, you can try to ask for smaller squares in your /getpublicdata research. It seems to display more relevant data
Re: Problem with getpublicdata
Yes, developers need to add two checks for the received data, or, perhaps, add a key to receive data only from a specified territory or with data around a territory
Thanks
Thanks