Hello,
Is there any way that we can retrieve the MAC IDs, Major and Minor ID’s of estimote beacons as a list from the Estimote cloud account? We have about 100 of them and need to map each individual MAC id to the name that we have given to the beacon.
Thanks,
Meera
You can use our RESTful API for that:
https://cloud.estimote.com/docs/#api-Beacons-GetBeacons
Example via curl
:
$ curl -H 'Accept: application/json' -u my-webapp-xyz:aa17672c29e67ab2bcf338fe4fe2d57e https://cloud.estimote.com/v1/beacons
[{"id":"B9407F30-F5F8-466E-AFF9-25556B57FE6D:26000:61228","uuid":"B9407F30-F5F8-466E-AFF9-25556B57FE6D","major":26000,"minor":61228,"mac":"d121ef2c6590","settings":{"battery":80,"interval":950,"hardware":"D3.3","firmware":"A3.2.0","basic_power_mode":true,"smart_power_mode":true,"timezone":"Europe/Warsaw","scheduling":false,"scheduling_config":"0","scheduling_period":"0","security":false,"motion_detection":true,"conditional_broadcasting":"flip to stop","latitude":null,"longitude":null,"location_id":null,"clock_offset":null,"created_at":"2016-01-08T14:23:08.980Z","synced_at":"2016-01-08T14:23:08.966Z","broadcasting_scheme":"estimote","range":4,"power":4,"firmware_deprecated":false,"firmware_newest":true,"location":null},"color":"mint","context_id":105403,"name":"my mint","battery_life_expectancy_in_days":442,"tags":[]}, // etc.
Hi!
This call does not work for me. It returns what seems to be the login HTML page content. If I do the same call but to https://cloud.estimote.com/v1/beacons/pending_settings, I do receive the expected JSON object. Is this an issue on your side?
Thanks!
Sylvain
Can you double-check if you included the “Accept: application/json” header? Without that, you’ll get an HTML response, not JSON.
Hi Piotr,
Thanks for your reply. I did included the said header.
The calls made are:
curl -H ‘Accept: application/json’ -u myappID:myAppSecret https://cloud.estimote.com/v1/beacons -k --> No good, I get an html page content as a result
curl -H ‘Accept: application/json’ -u myappID:myAppSecret https://cloud.estimote.com/v1/beacons/pending_settings -k --> Works great, I get 1 beacon (as expected) in a json response format
Am I missing something?
That’s extremely weird, I just checked and it works for me:
Piotr at Piotrs-MacBook in ~/Code/estimote/cloud on master
$ curl -u app_253nrtyl61:xxx -H 'Accept: application/json' 'https://cloud.estimote.com/v1/beacons'
[{"id":"b9407f30-f5f8-466e-aff9-25556b57fe6d:1:1","uuid":"b9407f30-f5f8-466e-aff9-25556b57fe6d","major":1,"minor":1 // more here
Can you add “-v” to your curl options and private-message me the output?
Than you Piotr, as I sent you in private, using the -v parameter as you proposed allowed me to find the reason of this issue. Looking at the output header, it says, *Could not resolve host: application; Host not found, I therefore changed the command to take out the surrounding single quotes around Accept:application/json + the space character between Accept: and application/json and it now works as expected, I get the JSon output.
Right syntax for me within a Windows 10 cmd.exe window:
curl -H Accept:application/json -u myApp:MySecret https://cloud.estimote.com/v1/beacons -k -v
hth!
Glad to hear it works—must be something specific to the Windows implementation of curl.
How do you plan to use the JSON list of your beacons?