Get a Stream
GET /streams
Returns a list of customer streams for the authenticated customer. The streams are returned sorted by creation date with the most recent streams appearing first.
Request Parameters
Name | Required Field | Type | Description |
---|---|---|---|
q | optional | string | Used to query for a customer's streams. The query can return exact matches ('=') or matches that are like ('~') the provided term. Exact match example: ?q=name=workout_stream_1 Like match example: ?q=name~workout |
sort | optional | string | Used to sort the results. Ex: ?sort=-created_at or ?sort=updated_at |
HTTP Response Status
Response Code | Description |
---|---|
200 (Created) | Indicates the request was received and a result was returned. |
Code Samples
curl --request GET \
--url 'https://streams.v2.validic.com/streams/?token=6f46db36dd6543d2b82d91698fcd0896'
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://streams.v2.validic.com/streams/?token=6f46db36dd6543d2b82d91698fcd0896"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
require 'uri'
require 'net/http'
url = URI("https://streams.v2.validic.com/streams/?token=6f46db36dd6543d2b82d91698fcd0896")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
import requests
url = "https://streams.v2.validic.com/streams/"
querystring = {"token":"6f46db36dd6543d2b82d91698fcd0896"}
response = requests.request("GET", url, params=querystring)
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://streams.v2.validic.com/streams/?token=6f46db36dd6543d2b82d91698fcd0896",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
"streams": [
{
"id": "598372650b11e700018284ab",
"name": "meaningful-customer-name",
"resource_filter": [
"summary",
"measurement"
],
"start_date": "2017-07-25",
"group": "stream_598372650b11e700018284ab",
"members": 0,
"created_at": "2017-08-03T18:58:45Z",
"updated_at": "2017-08-03T18:58:45Z"
},
{
"id": "5978dc880b11e700010ae88b",
"name": "hospitalone",
"resource_filter": [],
"start_date": null,
"group": "stream_5978dc880b11e700010ae88b",
"members": 0,
"created_at": "2017-07-26T18:16:40Z",
"updated_at": "2017-07-26T18:16:40Z"
},
{
"id": "5978bfe10b11e70001748518",
"name": "hospitaltwo",
"resource_filter": [
"summary",
"measurement"
],
"start_date": "2017-07-25",
"group": "stream_5978bfe10b11e70001748518",
"members": 0,
"created_at": "2017-07-26T16:14:25Z",
"updated_at": "2017-07-26T16:14:25Z"
},
{
"id": "5978b73b0b11e70001645780",
"name": "wellnessone",
"resource_filter": [],
"start_date": null,
"group": "stream_5978b73b0b11e70001645780",
"members": 0,
"created_at": "2017-07-26T15:37:31Z",
"updated_at": "2017-07-26T15:37:31Z"
},
{
"id": "59778d430b11e70001565a2d",
"name": "bluthcyro",
"resource_filter": [
"summary",
"measurement"
],
"start_date": "2017-07-25",
"group": "stream_59778d430b11e70001565a2d",
"members": 1,
"created_at": "2017-07-25T18:26:11Z",
"updated_at": "2017-07-25T18:26:11Z"
}
],
"meta": {
"total": 5,
"sort": [
"-created_at"
]
}
}
Response Field Descriptions
Name | Type | Description |
---|---|---|
id | string | Unique identifier for the stream. |
name | string | The name of the stream provided by the customer. |
group | string | Validic name for the stream. |
members | integer | The number of clients currently connected. IE the number of connections to the stream |
start_date | string | Only events with start times on or after this field are sent. |
resource_filter | array | Only events with resource types included in this list are sent. |
created_at | string | The date and time the resource was created. |
updated_at | string | The date and time the resource was updated. |
Updated 8 months ago
What’s Next