Пример #1
0
        /// <summary>
        /// Creates an access token to use in API calls.
        /// </summary>
        public static Token CreateAccessToken(string clientId, string clientSecret)
        {
            // Set client credential
            Credential credential = new Credential();
            credential.ClientId = clientId;
            credential.ClientSecret = clientSecret;
            credential.GrantType = "client_credentials";

            // Create token
            RESTAPI api = new RESTAPI(new Uri(SettingsHelper.ApiBaseUrl));
            JSONObject json = api.Post(SettingsHelper.AppSecurityUri, credential.ToJSON(), ContentType.HTTP);
            Token token = new Token(json);

            return token;
        }
        /// <summary>
        /// Creates an access token to use in API calls.
        /// </summary>
        public static Token CreateAccessToken(string clientId, string clientSecret)
        {
            // Set client credential
            Credential credential = new Credential();

            credential.ClientId     = clientId;
            credential.ClientSecret = clientSecret;
            credential.GrantType    = "client_credentials";

            // Create token
            RESTAPI    api   = new RESTAPI(new Uri(SettingsHelper.ApiBaseUrl));
            JSONObject json  = api.Post(SettingsHelper.AppSecurityUri, credential.ToJSON(), ContentType.HTTP);
            Token      token = new Token(json);

            return(token);
        }
 /// <summary>
 /// Create a BaseHelper instance.
 /// </summary>
 public BaseHelper()
 {
     _api = new RESTAPI(new Uri(Properties.Settings.Default.ApiBaseUrl));
 }
Пример #4
0
 /// <summary>
 /// Create a BaseHelper instance.
 /// </summary>
 public BaseHelper()
 {
     _api = new RESTAPI(new Uri(SettingsHelper.ApiBaseUrl));
     _api.APICall += new APICallEventHandler(OnAPICall);
 }
Пример #5
0
 /// <summary>
 /// Create a BaseHelper instance.
 /// </summary>
 public BaseHelper()
 {
     _api          = new RESTAPI(new Uri(SettingsHelper.ApiBaseUrl));
     _api.APICall += new APICallEventHandler(OnAPICall);
 }