---
title: "Accessing Data by Resource Type - Streaming vs REST API"
canonical: "https://help.validic.com/space/VCS/1681260647/Accessing+Data+by+Resource+Type+-+Streaming+vs+REST+API"
format: markdown
---
###### **This article pertains to:** [Inform (v2)] 

Validic Inform makes data available via five resource types: **Measurements**, **Nutrition**, **Sleep**, **Summaries**, and **Workouts**. The response for these resources are formatted with the same json structure across both the Streaming and REST APIs. With the difference being in how the resource is accessed. 

For the REST API the resource type to consume is known ahead of time and a specific call to the API is made for that resource type. For example the REST API call below can be used to retrieve records of a specific type by replacing :object_type with the resource type: 

**GET /organizations/:org_id/users/:uid/:object_type?date=:date**

```
GET 
{
  "data": [
    {
      "category": "daily",
      "checksum": "76e2d9a5a3d79b4e4c478f4b5865b59f",
      "created_at": "2017-11-28T14:49:33.943Z",
      "deleted_at": null,
      "end_time": "2017-11-25T04:59:59Z",
      "id": "6151df06d2c52cf8a28a90aa81bd68b4",
      "log_id": "2017-11-24",
      "metrics": [
        {
          "type": "active_duration",
          "origin": "unknown",
          "unit": "s",
          "value": 15582
        },
        {
          "type": "active_energy_burned",
          "origin": "unknown",
          "unit": "kcal",
          "value": 871
        },
        {
          "type": "avg_heart_rate",
          "origin": "unknown",
          "unit": "bpm",
          "value": 85
        },
        {
          "type": "distance",
          "origin": "unknown",
          "unit": "m",
          "value": 6757
        },
        {
          "type": "floors_climbed",
          "origin": "unknown",
          "unit": "count",
          "value": 22
        },
        {
          "type": "max_heart_rate",
          "origin": "unknown",
          "unit": "bpm",
          "value": 141
        },
        {
          "type": "min_heart_rate",
          "origin": "unknown",
          "unit": "bpm",
          "value": 52
        },
        {
          "type": "steps",
          "origin": "unknown",
          "unit": "count",
          "value": 8932
        }
      ],
      "offset_origin": "source",
      "segments": [],
      "source": {
        "type": "garmin",
        "device": null
      },
      "start_time": "2017-11-24T05:00:00Z",
      "type": "summary",
      "user": {
        "organization_id": "59ba7cdaf758800001c29216",
        "user_id": "59ba7cf0164f2500019790b7",
        "uid": "user1"
      },
      "user_notes": [],
      "utc_offset": -18000,
      "version": "1.0"
    }
  ]
}

```

While the Streaming API is composed of a series of data events to be consumed. Each data event will contain the field "type" that will identify the resource being consumed. For example in the data event below the resource type is summary:

```
event:data
data:{  
  "category":"daily",
  "checksum":"76e2d9a5a3d79b4e4c478f4b5865b59f",
  "created_at":"2017-11-28T14:49:33.943Z",
  "deleted_at":null,
  "end_time":"2017-11-25T04:59:59Z",
  "id":"6151df06d2c52cf8a28a90aa81bd68b4",
  "log_id":"2017-11-24",
  "metrics":[  
     {  
        "type":"active_duration",
        "origin":"unknown",
        "unit":"s",
        "value":15582.0
     },
     {  
        "type":"active_energy_burned",
        "origin":"unknown",
        "unit":"kcal",
        "value":871.0
     },
     {  
        "type":"avg_heart_rate",
        "origin":"unknown",
        "unit":"bpm",
        "value":85
     },
     {  
        "type":"distance",
        "origin":"unknown",
        "unit":"m",
        "value":6757.0
     },
     {  
        "type":"floors_climbed",
        "origin":"unknown",
        "unit":"count",
        "value":22
     },
     {  
        "type":"max_heart_rate",
        "origin":"unknown",
        "unit":"bpm",
        "value":141
     },
     {  
        "type":"min_heart_rate",
        "origin":"unknown",
        "unit":"bpm",
        "value":52
     },
     {  
        "type":"steps",
        "origin":"unknown",
        "unit":"count",
        "value":8932
     }
  ],
  "offset_origin":"source",
  "segments":[  
  ],
  "source":{  
     "type":"garmin",
     "device":null
  },
  "start_time":"2017-11-24T05:00:00Z",
  "type":"summary",
  "user":{  
     "organization_id":"59ba7cdaf758800001c29216",
     "user_id":"59ba7cf0164f2500019790b7",
     "uid":"user1"
  },
  "user_notes":[  
  ],
  "utc_offset":-18000,
  "version":"1.0"
}


```

In summary, for the REST API the resource type is known in advance, while for the Streaming API the resource type will need to be determined.