Overview

Endpoint(s)

https://login.NetroMedia.com/rest.svc - currently only available in https.

Call Format

Using a POST, send a query in this format:

https://login.NetroMedia.com/rest.svc/methodname

Use this header, along with User-Agent:

Content-type: application/json; charset=utf-8

For the POST body, use the JSON string containing the parameters you would like to send to a method.

Return Formats

If a method is successfully executed, it will return a JSON string in the following format (where the return keys and values are the expected returns from the methods, as defined by the individual method calls' descriptions in this document):

{"Status":"Success","Data":{ "returnkey1":"returnvalue1","returnkey2":"returnvalue2",…}}

If a method fails for some reason, it will return a JSON string in the following format:

{"Status":"Failure","Error":"Error message here"}

1. Login

Returns a token that is used to perform API operations, which remains valid for either 1hr after the latest operation (up to a full 24 hours) or remains valid until you have reached the maximum number of API calls your account has been assigned. Also returns the Account ID and Active Order ID for the logged in user.

Syntax

public string Login 
( string Email, 
string Password
)

Parameters

Required
Email: string
Password: string

Return Values

Token: Guid
AccountId: Guid
ActiveOrderId: Guid

Remarks

  • Requires a valid email address and password
  • The returned token of a successful login is used to perform secure operations across the API.
  • A single token can be used across all methods

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/Login
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Email":"JohnDoe@acme.com","Password":"test123"}

2. GetLoggedInUserInfo

Return the user information associated with a token (same as info returned by login method)

Syntax

public string GetLoggedInUserInfo 
( string Token
)

Parameters

Required
Token: Guid

Return Values

Token: Guid
AccountId: Guid
ActiveOrderId: Guid

Remarks

  • Requires a valid token

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/GetLoggedInUserInfo
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881"}

3. CreateAccount

Create a NetroMedia account

Syntax

public string CreateAccount 
( string Token, 
string Email, 
string AccountName, 
string FirstName, 
string LastName, 
string PhoneNumber
)

Parameters

Required
Token: string
Email: string
AccountName: string
FirstName: string
LastName: string
PhoneNumber: string

Return Values

Message: string

Remarks

  • Requires a valid token
  • Confirmation email with login instructions and password will be sent to addressee

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/CreateAccount
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Email":"JohnDoe@acme.com","AccountName":"test123","FirstName":"Mike","LastName":"Brown","PhoneNumber":"15555551212"}

4. GetAccounts

List child NetroMedia accounts belonging to the logged in account

Syntax

public string GetAccounts 
( string Token
)

Parameters

Required
Token: Guid

Return Values

An array of information, grouped by account, is returned. For each account, the following values are included:

Account Id: Guid
Account Name: string
Contact Email: string

Remarks

  • Requires a valid token

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/GetAccounts
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881"}

5. GetContacts

List all contacts belonging to, or belonging to a child of, the logged-in account

Syntax

public string GetContacts 
( string Token, 
string AccountId
)

Parameters

Required
Token: Guid
Optional
AccountId: Guid

Return Values

An array of information, grouped by contact, is returned. For each contact, the following values are included:

Contact Id: Guid
Contact Name: string
Contact Phone: string
Contact Email: string

Remarks

  • Requires a valid token

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/GetContacts
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","AccountId":"4a494f67-b0de-43a1-a6dc-4e3f292cc3f0"}

6. CreateChannel

Creates a channel on a single server. Returns all information needed to view, publish to, or upload on-demand content to the channel. For full CDN coverage - please request this via a Support Case

Syntax

public string CreateChannel 
( string Token, 
string ChannelName, 
string ChannelFormat, 
string ChannelSource, 
string ChannelRegion, 
string MaxConnections, 
string MaxBitRate, 
string AccountId
)

Parameters

Required
Token: Guid
ChannelName: string
ChannelFormat: string
Optional
ChannelRegion: string
MaxConnections: int
MaxBitRate: float
AccountId: Guid
Other - See Remarks
ChannelSource: string

Return Values

What is returned depends on the type of the channel created. These are all the possible values that can be returned for a channel:

Channel Id: Guid
Channel Name: string
Channel Type: string
Primary DNS: string
Max Connections: int
Max Bitrate: float
User Name: string
Password: string
Channel Source: Uri
FTP String: string
Public Link: string
FMS URL: string
Example Link: string
Expression Push Link: string
Stream Destination: string

Remarks

  • Default valid ChannelFormat Codes: FLASH_LIVE, FLASH_LIVE_MOBILE, FLASH_OD, WMS_LIVE_PULL, WMS_LIVE_PUSH, WMS_OD, MPEGTS_STREAM, MPEGTS_STREAM_MOBILE (for more advanced ones, contact NetroMedia)
  • A valid ChannelSource must be a publicly accessible channel using any of these protocols: http, https, rtmp, rtsp or mms
  • Valid ChannelRegion codes: NA, UK, AS

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/CreateChannel
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","ChannelName":"livechannel2","ChannelFormat":"WMS_LIVE_PULL", "ChannelSource":"http://16.56.54.56:8087"}

7. DeleteChannel

Deletes a channel.

Syntax

public string DeleteChannel 
( string Token, 
string ChannelId, 
string AccountId
)

Parameters

Required
Token: Guid
ChannelId: Guid
Optional
AccountId: Guid

Return Values

Message: string

Remarks

  • Requires a valid token
  • Requires an existing ChannelId

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/DeleteChannel
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","ChannelId":"7975c01e-9526-479d-9ee7-0fb62e22a297"}

8. StartChannel

Allows viewing of a channel and publishing to it.

Syntax

public string StartChannel 
( string Token, 
string ChannelId, 
string AccountId
)

Parameters

Required
Token: Guid
ChannelId: Guid
Optional
AccountId: Guid

Return Values

Message: String

Remarks

  • Requires a valid token
  • Requires an existing ChannelId

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/StartChannel
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","ChannelId":"7975c01e-9526-479d-9ee7-0fb62e22a297"}

9. StopChannel

Prevents viewing a channel or publishing to it.

Syntax

public string StopChannel 
( string Token, 
string ChannelId, 
string AccountId
)

Parameters

Required
Token: Guid
ChannelId: Guid
Optional
AccountId: Guid

Return Values

Message: string

Remarks

  • Requires a valid token
  • Requires an existing ChannelId

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/StopChannel
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","ChannelId":"7975c01e-9526-479d-9ee7-0fb62e22a297"}

10. BlockViewing

Block viewing permissions for a channel, but continue to allow publishing

Syntax

public string BlockViewing 
( string Token, 
string ChannelId, 
string AccountId
)

Parameters

Required
Token: Guid
ChannelId: Guid
Optional
AccountId: Guid

Return Values

Message: 

Remarks

  • Requires a valid token
  • Requires an existing ChannelId

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/BlockViewing
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","ChannelId":"7975c01e-9526-479d-9ee7-0fb62e22a297"}

11. AllowViewing

Allow viewing permissions for a channel, and continue to allow publishing

Syntax

public string AllowViewing 
( string Token, 
string ChannelId, 
string AccountId
)

Parameters

Required
Token: Guid
ChannelId: Guid
Optional
AccountId: Guid

Return Values

Message: 

Remarks

  • Requires a valid token
  • Requires an existing ChannelId

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/AllowViewing
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","ChannelId":"7975c01e-9526-479d-9ee7-0fb62e22a297"}

12. ReloadChannel

Shuts down a channel so that when it is requested again, it will reload. NOTE: This method is not available for WMS channels.

Syntax

public string ReloadChannel 
( string Token, 
string ChannelId, 
string AccountId
)

Parameters

Required
Token: Guid
ChannelId: Guid
Optional
AccountId: Guid

Return Values

Message: string

Remarks

  • Requires a valid token
  • Requires an existing ChannelId

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/ReloadChannel
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","ChannelId":"7975c01e-9526-479d-9ee7-0fb62e22a297"}

13. GetChannelStats

Returns a string of statistics relevant to a specified channel. These statistics are updated about once per minute.

Syntax

public string GetChannelStats 
( string Token, 
string ChannelId, 
string AccountId
)

Parameters

Required
ChannelId: Guid
Other - See Remarks
Token: Guid
AccountId: Guid

Return Values

Connections: int
ThroughputKbps: int
CurrentStorage: string OR float (see remarks)
AllocatedStorage: string OR float (see remarks)
Status: string

Remarks

  • For live channels, CurrentStorage and Allocated Storage will be "Not Applicable" (type string). For on-demand channels, they will be of the format "# GB", where # can be parsed to type float.
  • If AccountId is used instead of Token, only public channel information will be shown
  • Requires an existing ChannelId
  • Requires either a valid Token or an existing AccountId

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/GetChannelStats
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","ChannelId":"7975c01e-9526-479d-9ee7-0fb62e22a297"}

14. GetAllChannelRunningStatuses

Returns whether an account’s channels are running, and their message bytes in rate. NOTE: This method is not available for WMS channels.

Syntax

public string GetAllChannelRunningStatuses 
( string Token, 
string AccountId
)

Parameters

Other - See Remarks
Token: Guid
AccountId: Guid

Return Values

An array of information, grouped by channel, is returned. For each channel, the following values are included:

ChannelId: Guid
ChannelName: string
Connections: string
IsRunning: boolean
PublisherCount: int

Remarks

  • Requires either a valid Token or an existing AccountId
  • If AccountId is used instead of Token, only public channel information will be shown

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/GetAllChannelRunningStatuses
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"AccountId":"61c94f66-b0de-43a0-a6cc-4e3f292cc881"}

15. GetChannels

Return channel information for a specified account, or, if no account is specified, return information on channels belonging to the logged-in account and its child accounts.

Syntax

public string GetChannels 
( string Token, 
string AccountId
)

Parameters

Required
Token: Guid
Optional
AccountId: Guid

Return Values

An array of information, grouped by channel, is returned. For each channel, the following values are included:

Channel Id: Guid
Channel Name: string
Channel Type: string

Remarks

  • Requires a valid token

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/GetChannels
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881"}

16. GetPublishInfo

Returns relevant information for a specified active channel (not a suspended one)

Syntax

public string GetPublishInfo 
( string Token, 
string ChannelId, 
string AccountId
)

Parameters

Required
Token: Guid
ChannelId: string
Optional
AccountId: string

Return Values

This function returns the information originally returned when the stream was created. See CreateChannel's return values.

Remarks

  • Requires a valid token

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/GetPublishInfo
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","ChannelId":"7975c01e-9526-479d-9ee7-0fb62e22a297"}

17. GetReports

Returns various types of usage reports for an account's channels. NOTE: This currently only returns the LISTENER_SECONDS report, but will include more in time.

Syntax

public string GetReports 
( string Token, 
string StartDate, 
string EndDate, 
string SamplingFrequency, 
string AccountId
)

Parameters

Required
Token: Guid
StartDate: string
EndDate: string
SamplingFrequency: string
Optional
AccountId: Guid

Return Values

An array of information, grouped by channel, is returned. For each channel, the following values are included:

ChannelId: Guid
ChannelName: string
Period: Date
Data: float

Remarks

  • Requires a valid token
  • Future codes for ReportType: TRAFFIC, CONNECTIONS, TOTAL_CONNECTIONS, AVERAGE_DURATION, MAX_DURATION, ADS, LISTENER_SECONDS, PEAK_BANDWIDTH, AVERAGE_PERIOD, DEVIATION, UNIQUE_LISTENERS, OS, ON_DEMAND, COUNTRY, DISTRIBUTIONS, REPEAT_LISTENERS
  • Valid SamplingFrequency Codes: MONTH, WEEK, DAY, HOUR
  • For hourly sampling frequencies, the report period cannot be longer than a day.
  • For daily sampling frequencies, the report period cannot be longer than a week.
  • For weekly sampling frequencies, the report period cannot be longer than a month.
  • For monthly sampling frequencies, the report period cannot be longer than three months.

Example

HTTP Method:
POST
URL:
https://login.NetroMedia.com/rest.svc/GetReports
Request Headers:
Content-type: application/json; charset=utf-8
Request Body:
{"Token":"61c94f66-b0de-43a0-a6cc-4e3f292cc881","StartDate":"2012-5-9","EndDate":"2012-5-10","SamplingFrequency":"MONTH"}

Welcome

The GoLiveAPI opens up the NetroMedia global network to partners and resellers by allowing broadcasters to create and control Live or on-Demand streams and distribute those streams around the world.

This service is built on the RESTful specification standards to take advantage of the superior design principles allowed in this sytem and enable ease of use through POST methods.

Using JSON structured parameters in your methods allows for improved readability over XML and allows you to more easily collect, transfer and process the return strings.

Adding the NetroMedia API to your product offerings brings a significant value-add proposition for broadcasters and content providers.

The primary implementation areas for this service are:

  • Integration with hardware or software encoders to pre-configure channel access
  • Automated provisioning of channels for IP Cameras
  • Channel creation and control for streaming service providers
  • Providing and monitoring User Generated Content
  • Programatic access to reporting data
  • Use our packetization system to access iOS, Android and BlackBerry devices
    • Contact NetroMedia at support@netromedia.com
      or 888-818-3846 x702 for access and support.

GoLive API Contents

    Overview
    Return Formats
  1. Login
  2. GetLoggedInUserInfo
  3. CreateAccount
  4. GetAccounts
  5. GetContacts
  6. CreateChannel
  7. DeleteChannel
  8. StartChannel
  9. StopChannel
  10. BlockViewing
  11. AllowViewing
  12. ReloadChannel
  13. GetChannelStats
  14. GetAllChannelRunningStatuses
  15. GetChannels
  16. GetPublishInfo
  17. GetReports