nav spacer

GoLive API Documentation

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 is valid for 1hr and auto-extends after each operation.

Syntax

public string Login ( string Email , string Password ) 

Parameters

Required
Email: string Password: string 

Return Value

Token: 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.

HTTP Method: POST

Example:

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. CreateAccount

Create NetroMedia account

Syntax

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

Parameters

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

Return Value

Message: string "Successfully created an account."

Remarks

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

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"}

3. CreateChannel

Creates a channel on NetroMedia's network. Returns all information needed to view, publish to, or upload on-demand content to the channel.

Syntax

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

Parameters

Required
Token: string ChannelName: string ChannelFormat: string 
Optional
ChannelSource: string * ChannelRegion: string MaxConnections: int MaxBitRate: float

*ChannelSource is required if ChannelFormat is WMS_LIVE_PULL

Return Values

Always Returned
Channel Id: Guid Channel Name: string Channel Type: string Primary DNS: string 
Returned for all but WMS_LIVE_PULL channels
User Name: string Password: string 
Returned for on-demand channels
FTP String: string
Returned for live channels
Public Link: string
Returned for Flash channels
FMS URL: string Example Link: string 
Returned for WMS_LIVE_PUSH
Expression Push Link: string
Returned for MPEGTS channels
Stream Destination: string

Remarks

  • Valid ChannelFormat Codes: FLASH_LIVE, FLASH_LIVE_MOBILE, FLASH_OD, WMS_LIVE_PULL, WMS_LIVE_PUSH, WMS_OD, MPEGTS_STREAM, MPEGTS_STREAM_MOBILE
  • Future ChannelFormat Codes (will be available next version): IP_CAM, IP_CAM_MOBILE, FLASH_LIVE_LL
  • Valid ChannelSource Input: Can be a publicly accessible channel using any of these protocols: http, https, rtmp, rtsp or mms
  • Valid ChannelRegion codes (will be available next version): US-EAST, US-WEST, UK

HTTP Method: POST

Example:

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"}

4. DeleteChannel

Deletes a channel.

Syntax

public string DeleteChannel ( string Token , string ChannelId ) 

Parameters

Required
Token: string ChannelId: string 

Return Value

Message: string "Channel successfully deleted."

Remarks

  • Requires an existing ChannelId

HTTP Method: POST

Example:

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"}

5. StartChannel

Starts a channel.

Syntax

public string StartChannel ( string Token , string ChannelId ) 

Parameters

Token: string ChannelId: string 

Return Value

Message: string "Channel successfully started."

Remarks

  • Requires an existing ChannelId

HTTP Method: POST

Example:

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"}

6. StopChannel

Stops a channel.

Syntax

public string StartChannel ( string Token , string ChannelId ) 

Parameters

Token: string ChannelId: string 

Return Value

Message: string "Channel successfully stopped."

Remarks

  • Requires an existing ChannelId

HTTP Method: POST

Example:

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"}

7. GetChannelStats

Returns an XML string of stats relevant to specified channel.

Syntax

public string GetChannelStats ( string Token , string ChannelId ) 

Parameters

Required
Token: string ChannelId: string 

Return Value

Connections: int ThroughputKbps: int CurrentStorage: string * AllocatedStorage: string * 

* For live channels, these values will be 'NotApplicable'. For on-demand channels, they will be of the format "# GB", where # can be parsed to type float.

Remarks

  • Requires an existing ChannelId

HTTP Method: POST

Example:

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"}

8. GetChannelStatus

Returns whether a channel is active or not.

Syntax

public string GetChannelStatus ( string Token , string ChannelId ) 

Parameters

Required
Token: string ChannelId: string 

Remarks

  • Requires an existing ChannelId

HTTP Method: POST

Example:

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

9. GetChannels

Returns basic information on all a user's channels.

Syntax

public string GetChannels( string Token )

Parameters

Required
Token: string

Return Value

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

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

Remarks

  • Requires a valid token

HTTP Method: POST

Example:

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"}

10. GetPublishInfo

Returns basic information on all a user's channels.

Syntax

public string GetPublishInfo ( string Token , string ChannelId ) 

Parameters

Required
Token: string ChannelId: string 

Return Value

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

Remarks

  • Requires a valid token

HTTP Method: POST

Example:

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"}

Troubleshooting

The following are possible error messages you may receive while using the API. Click to expand.




Channel either does not exist, or you do not have permission to access it.
Method(s):
All, except Login and CreateAccount
Solution:
Make sure that you are using the correct ChannelId, and that you own the channel – you cannot modify somebody else's channel!
ChannelSource is not in a proper URI format. Please check the format and try again.
Method(s):
CreateChannel
Solution:
ChannelSource was not in proper URI format. Change it to a proper format and try again.
ChannelSource protocol not valid. Accepted protocols are http, https, rtmp, rtsp and mms.
Method(s):
CreateChannel
Solution:
The ChannelSource must begin with one of the given protocols.
Could not change running status.
Method(s):
StartChannel and StopChannel
Solution:
If calling StartChannel, the channel was unable to be started. If calling StopChannel, the channel was unable to be stopped. Either way, the state was not recorded and GetChannelStatus will show no change. Try making the call again.
Could not fetch channel info.
Method(s):
GetChannels, GetPublishInfo
Solution:
If this occurred in GetChannels, there was a database read error. Try making the call again. If it occurred in GetPublishInfo, ensure the ChannelID is a valid GUID format and try again.
Could not insert this information into database. Please double-check your parameters.
Method(s):
CreateChannel
Solution:
Check that your parameters are valid and conform to the specs of this document. If there is additional information, it probably refers to the MaxBitRate or MaxConnections parameters.
Could not sync server info with DB info.
Method(s):
CreateChannel, DeleteChannel, StartChannel, StopChannel
Solution:
A channel's information was updated, but the channel itself could not be updated. Try running the command again. If the error persists, contact NetroMedia.
Database delete error.
Method(s):
DeleteChannel
Solution:
The channel was not successfully deleted. Try making the call again.
Email already in use.
Method(s):
CreateAccount
Solution:
The specified email already exists in our system – choose a different one.
Exceeded maximum number of API calls with this token.
Method(s):
All, except Login
Solution:
Possible reasons for this:
  • You may have exceeded your daily limit of API calls.
  • Your token may have expired.
Generate a new token using Login and try the method again.
Exceeded maximum number of API calls.
Method(s):
Login
Solution:
Possible reasons for this:
  • You have exceeded your daily limit of unsuccessful logins.
  • You may not have API access.
If you do not have API access, contact contact NetroMedia.
Failed to create an account - Database exception occurred.
Method(s):
CreateAccount
Solution:
An error occurred. Try again later.
Failed to create an account.
Method(s):
CreateAccount
Solution:
An error occurred. Try again later.
Failed to log in - Exception occurred.
Method(s):
Login
Solution:
An error occurred. Try again later.
Failed to log in.
Method(s):
Login
Solution:
An error occurred. Try again later.
Failed to start channel.
Method(s):
StartChannel
Solution:
The channel's status was updated to "Online", but it was not started. Try making the call again.
Failed to stop channel.
Method(s):
StopChannel
Solution:
The channel's status was updated to "Offline", but it was not stopped. Try making the call again.
Invalid channel format. Valid channel formats are as follows: FLASH_LIVE, FLASH_LIVE_MOBILE, FLASH_OD, MPEGTS_STREAM, MPEGTS_STREAM_MOBILE, WMS_LIVE_PULL, WMS_LIVE_PUSH, WMS_OD
Method(s):
CreateChannel
Solution:
Channel format must be one of the formats included in the provided list.
Invalid channel name. Only numbers 0-9 and letters a-z, A-Z can be used. Please check for invalid characters.
Method(s):
CreateChannel
Solution:
Channel names can only contain the numbers 0-9 or the letters a-z (upper or lower case). Remove characters which do not match these criteria and try again.
MaxBitRate must be a decimal or integer, and MaxConnections must be an integer. Please check these parameters.
Method(s):
CreateChannel
Solution:
Either MaxBitRate or MaxConnections parameters have invalid formats. Make sure there are no letters or symbols in either of them, and that MaxConnections does not have a decimal value.
Maximum amount of channels reached.
Method(s):
CreateChannel
Solution:
You cannot create another channel because you already have reached your maximum amount of them. You will need to either upgrade your account or delete an existing channel.
No channels available.
Method(s):
GetChannels
Solution:
The account has no channels to get information for.
Not a valid user.
Method(s):
Login
Solution:
You do not have a NetroMedia account. Visit login.netromedia.com and create one, then contact NetroMedia for API access.
One or more required parameters missing.
Method(s):
All
Solution:
Check that you have all the required JSON parameters included in the body of your POST.
This account does not have permission to create mobile channels.
Method(s):
CreateChannel
Solution:
You tried to make a mobile channel, but do not have permission to do so. You will need to either upgrade to include mobile streaming, or use a more basic service format.
This operation requires a secure connection. Please try again using HTTPS.
Method(s):
All
Solution:
Make sure the URL you are using to make the call begins with "https".
Token not authorized.
Method(s):
All, except Login
Solution:
Generate a new token using Login.
WMS_LIVE_PULL channel format requires a ChannelSource.
Method(s):
CreateChannel
Solution:
If you are specifying a WMS pull-type channel, you need to specify a source to pull from.