RESTful Basics - Storm Streaming Cloud

Introduction

Below, you'll find a basic example of how to use our RESTful API to manage your streams on Storm Streaming Cloud. The API provides total control over your streams, allowing for further automation of the stream creation process. A complete API Collection for Postman can be downloaded here.

API Authentication

The Storm Streaming Cloud API endpoint requires the 'x-api-key' header to authenticate and authorize requests. Your personal API key can be acquired from the following webpage: https://cloud.stormstreaming.com/settings/api-key.

Storm Player Cloud API authentication

Basic Stream Create Request

Stream creation with minimal parameters.
Request type POST
URL https://api.stormstreaming.com/api/request/stream
Headers
x-api-key <your api key>
Form-data
name My stream
regionId 1
Response Code 200
Body
                                        
{
  "message": "Stream has been created.",
  "stream": {
    "streamKey": "9ed8b119f8ed9425a428a47846e55c6b761afc6c",
    "name": "My stream",
    "description": null,
    "regionId": 1,
    "isPublished": true,
    "countdown": {
      "isCountdown": false,
      "startDate": null,
      "timezone": null
    },
    "sourceType": "PUSH",
    "encoderMode": "PASSTHROUGH",
    "credentials": {
      "username": "902aee51",
      "password": "f9aef6eac1d977d"
    },
    "thumbnail": null,
    "splashscreen": null,
    "source": null,
    "targets": [],
    "theme": {
      "id": 54,
      "name": "test",
      "isDefault": 1,
      "theme": {
        "settings": {
          "autoStart": false
        },
        "interface": {
          "autoGUIHide": true,
          "autoGUIHideTime": 3,
          "showBigPlayBTN": false,
          "showTimeline": false,
          "nativeMobileGUI": true
        },
        "style": {
          "progressBar": {
            "gradientColor1": "#ff915a",
            "gradientColor2": "#ff785a"
          },
          "unmuteLabel": {
            "backgroundColor": "#e00b0b",
            "primaryColor": "#da0c0c"
          },
          "icons": {
            "primaryColor": "#b51a1a",
            "secondaryColor": "#000000",
            "activeColor": "#ff915a",
            "errorColor": "#df0f33"
          },
          "backgroundColor": "#ed0e0e",
          "text": {
            "titleColor": "#ffffff",
            "subtitleColor": "#ffffff",
            "errorColor": "#ffffff"
          },
          "borderRadius": "10px",
          "watermark": {
            "position": "bottom_left",
            "imgURL": "https://cdn.stormstreaming.com/storage/8037062a1dee385162/YHe7GgBhLGG8Xwpv5pVk68zfUTYdxLuUpntEiTUc.png"
          }
        },
        "translations": {
          "broadcastRemainingTime": "Remaining time",
          "broadcastStartTime": "Broadcasting will start at",
          "live": "LIVE",
          "timeDays": "days",
          "timeHours": "hours",
          "timeMinutes": "minutes",
          "timeSeconds": "seconds",
          "unmute": "UNMUTE SOUND",
          "disconnected": "Disconnected from streaming server.",
          "streamNotFound": "Stream with given key was not found.",
          "connectionFailed": "Failed to connect to the streaming server.",
          "compatibilityError": "Your device is not compatible with the available video source.",
          "noSSLError": "This connection requires a secure SSL connection.",
          "streamError": "Error while playing the stream.",
          "streamStop": "The stream has ended."
        }
      },
      "logo": {
        "id": 1341,
        "path": "https://cdn.stormstreaming.com/storage/8037062a1dee385162/YHe7GgBhLGG8Xwpv5pVk68zfUTYdxLuUpntEiTUc.png"
      },
      "created_at": "2024-01-24T12:15:24.000000Z",
      "updated_at": "2024-01-24T16:32:56.000000Z"
    },
    "isCreated": true,
    "createdAt": "2024-01-25T11:10:53.000000Z"
  }
}
                                        
Table 1. Basic create stream request table

Possible Response Code Explanation

Code Sample body Description
200
                                            
{
  "message": "Stream has been updated."
}
                                        
Request processed successfully.
400
                                            
{
  "message": "The selected source type is invalid."
}
                                        
Validation error has occurred.
401
                                            
{
  "message": "Unauthenticated."
}
                                        
Provided x-api-key header is incorrect.
403
                                            
{
  "message": "You have exceeded the limit of concurrent live streams. Please end an existing stream before starting a new one, or upgrade your subscription plan."
}
                                        
This server response indicates that the user has surpassed the allowed number of concurrent live streams. It advises the user to either terminate an existing stream before initiating a new one or to consider upgrading their subscription plan for increased streaming limits. This response may occur during the request to publish a stream or when attempting to create a stream with 'isPublished' set to 1.
404
                                            
{
  "message": "Stream not found."
}
                                        
The resource was not found.
429
                                            
{
  "message": "Too Many Attempts."
}
                                        
An error has occurred due to an excessive number of requests. The limit is capped at 500 requests per minute. Please moderate your request frequency to comply with this limit.
500
                                            
{
  "message": "Internal Server Error."
}
                                        
Internal server error has occurred.
Table 2. Possible response code explanation table
Next Step

In the next step you'll learn how to control broadcasts in Stream Management guide.

Support Needed?

Create a free ticket and our support team will provide you necessary assistance.