Developer

Aus smart-me
Wechseln zu: Navigation, Suche

Together we can make the World a little bit more Energy Efficient and more aware. With the smart-me REST API you get Access to all your devices in the smart-me Cloud and you can add your own devices. So it's a easy way to add the smart-me Cloud support to your Hardware or Software Product.

API

Please also have a look at our smart-me API training site on our Web-Site

Authentication

To keep it simple, the smart-me API uses "Basic Authentication". Every call to the API must include the Authentication. HTTP Basic Authentication allows credentials (such as a username and password or an API token) to be transferred in HTTP headers. The secret is encoded using Base64.
Example:
Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

Card Access Token

After you have created a Card Access Token (e.g for NFC Card) you can also use this Token to authenticate. For this you have to send "cardaccesstoken_" plus the Card ID as Username and the Token Key as Password.
Example: Username: cardaccesstoken_123456
Password: 155ece3459ad09d5f98aad04fcfc28ac
Authorization: Basic Y2FyZGFjY2Vzc3Rva2VuXzEyMzQ1NjoxNTVlY2UzNDU5YWQwOWQ1Zjk4YWFkMDRmY2ZjMjhhYw==


REST API Samples

A few REST API samples can you find here: REST API Samples

Realtime (Webhook) API

The smart-me Realtime (Webhooks) API allows you to subscribe to new data of a device. You can subscripe to a single device or to all devices of a user. When a device sends new data to the cloud, a webhook sends this data as a POST request to a preconfigured URL. More Information [1]

Proto File

package RealtimeApi.Containers;
import "bcl.proto"; // schema for protobuf-net's handling of core .NET types

message DeviceData {
   required bcl.Guid DeviceId = 1;
   required bcl.DateTime DateTime = 2;
   repeated DeviceValue DeviceValues = 3;
}
message DeviceDataArray {
   repeated DeviceData DeviceDataItems = 1;
}
message DeviceValue {
   required bytes Obis = 1;
   required double Value = 2;
}