MENU

Soracom

Users

送信するデータフォーマット

SORACOM アプリケーションサービスを利用してクラウド連携する 場合の送信するデータフォーマットは以下の通りです。

Beam

Beam には HTTP もしくは HTTPS で転送されます。 フォーマットは以下のとおりです。

Header

{
  "host": "xxxxxxx.com",
  "connection": "close",
  "content-type": "application/json",
  "x-soracom-timestamp": "1524554877520",
  "x-soracom-device-id": "d-vlqqxxxxxxxxxxxxxxx",
  "x-soracom-operator-id": "OP0000000000",
  "transfer-encoding": "chunked",
  "x-request-id": "feexxxxxxxxxxx-xxxxxxxxxx",
  "x-forwarded-for": "13.112.xxx.xxx",
  "x-forwarded-proto": "https",
  "x-forwarded-port": "443",
  "via": "1.1 vegur",
  "connect-time": "0",
  "x-request-start": "1524554879323",
  "total-route-time": "0"
}

Body

{
  "deviceId": "d-vlqqxxxxxxxxxxxxxxx",
  "path": "/3/0",
  "lastModifiedTime": 1524554897553,
  "resources": {
    "13": {
      "name": "Current Time",
      "value": "Apr 24, 2018 7:28:17 AM"
    }
  }
}

Funnel

Resource を Observe した場合以下のようなデータが 1 つずつ送信されます。

/3/0/13 を Observe した場合の例

{
  "operatorId": "OP0000000000",
  "timestamp": 1524551762283,
  "destination": {
    "resourceUrl": "https://xxxxx.us-west-2.amazonaws.com/my-kinesis-firehose",
    "service": "firehose",
    "provider": "aws"
  },
  "credentialsId": "aws-credentials",
  "payloads": {
    "path": "/3/0",
    "lastModifiedTime": "1524551761992",
    "deviceId": "d-vlqqxxxxxxxxxxxxxx",
    "resources": {
      "13": {
        "name": "Current Time",
        "value": "Apr 24, 2018 6:36:01 AM"
      }
    }
  },
  "sourceProtocol": "device",
  "deviceId": "d-vlqqxxxxxxxxxxxxxx"
}

ObjectInstance を Observe した場合は、以下のようなフォーマットで送信されます。

/6/0 を Observe した場合の例

{
  "operatorId": "OP0000000000",
  "timestamp": 1524551772514,
  "destination": {
    "resourceUrl": "https://xxxxx.us-west-2.amazonaws.com/my-kinesis-firehose",
    "service": "firehose",
    "provider": "aws"
  },
  "credentialsId": "aws-credentials",
  "payloads": {
    "path": "/6/0",
    "lastModifiedTime": "1524551771914",
    "deviceId": "d-vlqqxxxxxxxxxxxxxx",
    "resources": {
      "1": {
        "name": "Longitude",
        "value": 65.1006164550781
      },
      "0": {
        "name": "Latitude",
        "value": 56.1010437011719
      },
      "5": {
        "name": "Timestamp",
        "value": "Apr 24, 2018 6:36:11 AM"
      }
    }
  },
  "sourceProtocol": "device",
  "deviceId": "d-vlqqxxxxxxxxxxxxxx"
}

Harvest

Harvest の場合、リソース名(パス)、値が以下のように送信されます。

{
  "Example resource (/3303/0/5757)": 123,
  "Example resource2 (/3303/0/5758)": 456
}