Getting Started
Step 1: Obtain API Key
Sign In into your StreamLabs account at https://my.streamlabswater.com/ and copy your apiKey
.
You will need an active StreamPlus™ subscription with API support in order to view your apiKey
and use the API. Visit https://streamlabswater.com/subscription for more information.
If your application will be requesting data on behalf of other users, head over to the Authentication with OAuth 2.0 section
Step 2: Make a test Request
Open your terminal and make a test request to the service.
Add the apiKey
to your Authorization header of type Bearer
curl -v https://api.streamlabswater.com/v1/hello/world \
-H "Authorization: Bearer {apiKey}"
Step 3: Create a HTTP Client
You can integrate the StremLabs Developer API to any existing application using the language's native HTTP client or popular modules available in your favorite language.
Javascript
You can use any of the popular HTTP Clients in your web site or node project. In the example below we use wreck to make the request.
const wreck = require('wreck')
const url = 'https://api.streamlabswater.com/v1/hello/world'
const headers = {
'Authorization': `Bearer ${apiKey}`
}
(async () => {
try {
const response = await wreck.request('GET', url, { headers })
const body = await wreck.read(response, { json: 'strict' })
console.log('RESULT', body)
} catch (err) {
console.error(err)
}
})()
Python
import requests
url = 'https://api.streamlabswater.com/v1/hello/world'
headers = {
"Authorization" : "Bearer {apiKey}"
}
req = requests.get(url, headers=headers)
print (req.text)