API V1
Using the REST API directly
If you don’t plan to use one of our SDKs you then you will need the following data to make calls to our API:
- API Address: https://api.cloud.telestream.net/notifications/v1.0
subscriptions
Subscriptions define where notifications should be delivered. It is triggered on selected events.
list subscriptions
Code samples
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Api-Key' => 'API_KEY'
}
result = RestClient.get 'https://api.cloud.telestream.net/notifications/v1.0/subscriptions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Api-Key': 'API_KEY'
}
r = requests.get('https://api.cloud.telestream.net/notifications/v1.0/subscriptions', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.cloud.telestream.net/notifications/v1.0/subscriptions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"X-Api-Key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.cloud.telestream.net/notifications/v1.0/subscriptions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /subscriptions
Example responses
200 Response
[
{
"id": "string",
"type": "email",
"topic": {
"account": "string",
"service": "qc",
"event": "video-passed",
"project": "string"
},
"params": {
"addresses": [
"string"
],
"url": "string",
"method": "GET",
"retries": 0,
"content_type": "application/json"
}
}
]
401 Response
Responses
Status | Description | Schema |
---|---|---|
200 | OKOK | Inline |
401 | UnauthorizedNot authorized | string |
Response Schema
Status Code 200
anonymous optional none undefined |
» id string optional [read-only] Subscription identifier read-only |
» type string required Type of subscription (email, webhook) undefined |
» topic object optional none undefined |
»» account string optional [read-only] Account identifier connected to subscription notification read-only |
»» service string required Name of service undefined |
»» event string required Name of the event; Quality Control (video-passed, video-error, video-warning, video-rejected, video-canceled) undefined |
»» project string required Project ID undefined |
» params object optional none undefined |
»» addresses [string] optional #email; E-mail addresses undefined |
»» url string optional #webhook; Webhook URL undefined |
»» method string optional #webhook; HTTP method; default: POST (GET, POST) undefined |
»» retries integer optional #webhook; Number of retries before forgetting the notification; default: 0 undefined |
»» content_type string optional #webhook; default: application/json (application/json, application/x-www-form-urlencoded) undefined |
Enumerated Values
type email |
type webhook |
service qc |
event video-passed |
event video-error |
event video-warning |
event video-rejected |
event video-canceled |
method GET |
method POST |
content_type application/json |
content_type application/x-www-form-urlencoded |
create subscription
Code samples
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => '*/*',
'X-Api-Key' => 'API_KEY'
}
result = RestClient.post 'https://api.cloud.telestream.net/notifications/v1.0/subscriptions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': '*/*',
'X-Api-Key': 'API_KEY'
}
r = requests.post('https://api.cloud.telestream.net/notifications/v1.0/subscriptions', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.cloud.telestream.net/notifications/v1.0/subscriptions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"*/*"},
"X-Api-Key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.cloud.telestream.net/notifications/v1.0/subscriptions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /subscriptions
Create a new subscription
Body parameter
{
"type": "email",
"topic": {
"service": "qc",
"event": "video-passed",
"project": "string"
},
"params": {
"addresses": [
"string"
],
"url": "string",
"method": "GET",
"retries": 0,
"content_type": "application/json"
}
}
Parameters
optional none |
Example responses
400 Response
401 Response
405 Response
Responses
Status | Description | Schema |
---|---|---|
200 | OKSubscription created | None |
400 | Bad RequestInvalid input | string |
401 | UnauthorizedNot authorized | string |
405 | Method Not AllowedInvalid input | string |
delete subscription
Code samples
require 'rest-client'
require 'json'
headers = {
'Accept' => '*/*',
'X-Api-Key' => 'API_KEY'
}
result = RestClient.delete 'https://api.cloud.telestream.net/notifications/v1.0/subscriptions/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': '*/*',
'X-Api-Key': 'API_KEY'
}
r = requests.delete('https://api.cloud.telestream.net/notifications/v1.0/subscriptions/{id}', params={
}, headers = headers)
print r.json()
URL obj = new URL("https://api.cloud.telestream.net/notifications/v1.0/subscriptions/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"*/*"},
"X-Api-Key": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.cloud.telestream.net/notifications/v1.0/subscriptions/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /subscriptions/{id}
Parameters
id string In path required none |
Example responses
400 Response
401 Response
405 Response
Responses
Status | Description | Schema |
---|---|---|
200 | OKSubscription created | None |
400 | Bad RequestInvalid input | string |
401 | UnauthorizedNot authorized | string |
405 | Method Not AllowedInvalid input | string |
Schemas
subscription
{
"id": "string",
"type": "email",
"topic": {
"account": "string",
"service": "qc",
"event": "video-passed",
"project": "string"
},
"params": {
"addresses": [
"string"
],
"url": "string",
"method": "GET",
"retries": 0,
"content_type": "application/json"
}
}
Properties
id string optional [read-only] Subscription identifier read-only |
type string required Type of subscription (email, webhook) |
topic optional none |
params optional none |
Enumerated Values
type email |
type webhook |
params
{
"addresses": [
"string"
],
"url": "string",
"method": "GET",
"retries": 0,
"content_type": "application/json"
}
Properties
addresses [string] optional #email; E-mail addresses |
url string optional #webhook; Webhook URL |
method string optional #webhook; HTTP method; default: POST (GET, POST) |
retries integer optional #webhook; Number of retries before forgetting the notification; default: 0 |
content_type string optional #webhook; default: application/json (application/json, application/x-www-form-urlencoded) |
Enumerated Values
method GET |
method POST |
content_type application/json |
content_type application/x-www-form-urlencoded |
topic
{
"account": "string",
"service": "qc",
"event": "video-passed",
"project": "string"
}
Properties
account string optional [read-only] Account identifier connected to subscription notification read-only |
service string required Name of service |
event string required Name of the event; Quality Control (video-passed, video-error, video-warning, video-rejected, video-canceled) |
project string required Project ID |
Enumerated Values
service qc |
event video-passed |
event video-error |
event video-warning |
event video-rejected |
event video-canceled |