Subject: Smappee - Electrical Signaturestonysantos wrote:I too just got my Smappee and sytarting the process of acessing data thru the API's.
Would be very interested on the curl commands that you used to get the data, if you could share that with me.
Ok I have finally pulled my finger out and here is what i did to curl some info out
curl -X POST -d "client_id=MyAPIUsername&client_secret=MyClientSecret&grant_type=password&username=MyAppUsername&password=MyAppPasword"
https://app1pub.smappee.net/dev/v1/oauth2/tokenWhich gave me my access token and my refresh token.
I then used my access token to get my serviceLocationID and Name:
curl --header "Authorization: Bearer MyAccessToken"
https://app1pub.smappee.net/dev/v1/servicelocation/I then requested info on all my appliances:
curl --header "Authorization: Bearer MyAccessToken"
https://app1pub.smappee.net/dev/v1/serv ... ionID/infoRequest consumption info (Time in Epoch milliseconds, applianceID being the appliance you want to report on, maxNumber being the max number of records to return):
curl --header "Authorization: Bearer MyAccessToken" "https://app1pub.smappee.net/dev/v1/servicelocation/MyServiceLocationID/consmption?aggregation=5&from=1305530000000&to=1405544940000"
Request event info:
curl --header "Authorization: Bearer MyAccessToken" "https://app1pub.smappee.net/dev/v1/servicelocation/MyServiceLocationID/events?applianceId=2&maxNumber=10&from=1405530000000&to=1405544940000"
API Guide found here:
https://smappee.atlassian.net/wiki/disp ... PI+Methodsepoch converter:
http://www.epochconverter.comMyAPIUsername, MyClientSecret, MyAppPasword, MyAccessToken, MyServiceLocationID are YOUR details/variables. The From and To numbers in the last 2 examples are time in epoch.
Hope that helps!