C# Class Youbora.Analytics.Providers.API.Smartswitch.SmartswitchApi

Afficher le fichier Open project: NicePeopleAtWork/NicePlayers

Méthodes publiques

Méthode Description
GenerateToken ( string systemCode, string originCode, string resource, double niceNva, double niceNvb, string secretKey ) : string

In order to generate an authentication token, an md5 hashing algorithm must be applied to the following concatenated string chain: md5(systemcode + zonecode + origincode + resource + niceNva + niceNvb + secretKey) where, the secretKey is a secret key shared by NicePeopleAtWork and the customer to authenticate all the calls against the Smartswitch.

Smartswitch ( string systemCode, string originCode, string resource, double niceNva, double niceNvb, string token ) : string

Returns a JSON object with an array of different resource URLs sorted by the quality of experience they offer. The first item on that list is the best URL and the last one is the worst. Usage Example: http://smartswitch.youbora.com/?type=balance&systemcode=npawplug&zonecode=default&origincode=plOrigin&resource=%2Fmy_series1%2F2012%2F09%2F10%2F00001.mp4&niceNva=1400765784000&niceNvb=1398173784000&token=343a069a52e8f4fb16988a7036312670

Method Details

GenerateToken() public static méthode

In order to generate an authentication token, an md5 hashing algorithm must be applied to the following concatenated string chain: md5(systemcode + zonecode + origincode + resource + niceNva + niceNvb + secretKey) where, the secretKey is a secret key shared by NicePeopleAtWork and the customer to authenticate all the calls against the Smartswitch.
public static GenerateToken ( string systemCode, string originCode, string resource, double niceNva, double niceNvb, string secretKey ) : string
systemCode string Your Nice PeopleAtWork account code that indicates Youbora Smartswitch which customer account rules are going to be applied. This parameter will be provided by NicePeopleAtWork, if you don't have it yet, please contact your Customer Engineer or Support Agent.
originCode string Origin code configured in Smartswitch's Account Settings
resource string Urlencoded resource path where the file can be found inside the configured bucket
niceNva double "not valid after" parameter. It defines the timestamp (in milliseconds) after the generated URL won't be valid. This is the current UTC time + the amount of time you want, in milliseconds
niceNvb double "not valid before" parameter. It defines the timestamp (in milliseconds) that it will take that URL to be valid and accessible. This is the current UTC time + the amount of time you want, in milliseconds.
secretKey string secret key shared by NicePeopleAtWork and the customer to authenticate all the calls against the Smartswitch
Résultat string

Smartswitch() public static méthode

Returns a JSON object with an array of different resource URLs sorted by the quality of experience they offer. The first item on that list is the best URL and the last one is the worst. Usage Example: http://smartswitch.youbora.com/?type=balance&systemcode=npawplug&zonecode=default&origincode=plOrigin&resource=%2Fmy_series1%2F2012%2F09%2F10%2F00001.mp4&niceNva=1400765784000&niceNvb=1398173784000&token=343a069a52e8f4fb16988a7036312670
public static Smartswitch ( string systemCode, string originCode, string resource, double niceNva, double niceNvb, string token ) : string
systemCode string Your Nice PeopleAtWork account code that indicates Youbora Smartswitch which customer account rules are going to be applied. This parameter will be provided by NicePeopleAtWork, if you don't have it yet, please contact your Customer Engineer or Support Agent.
originCode string Origin code configured in Smartswitch's Account Settings
resource string Urlencoded resource path where the file can be found inside the configured bucket
niceNva double "not valid after" parameter. It defines the timestamp (in milliseconds) after the generated URL won't be valid. This is the current UTC time + the amount of time you want, in milliseconds
niceNvb double "not valid before" parameter. It defines the timestamp (in milliseconds) that it will take that URL to be valid and accessible. This is the current UTC time + the amount of time you want, in milliseconds.
token string Authentication token generated
Résultat string