/// <summary> /// Constructor /// </summary> public MMS(string endPoint, string accessToken) { apiService = new APIService(endPoint, accessToken, "/mms/v3/messaging/"); }
/// <summary> /// Ads constructor /// </summary> /// <param name="endPoint">endPoint</param> /// <param name="accessToken">accessToken</param> public Ads(string endPoint, string accessToken) { apiService = new APIService(endPoint, accessToken, "/rest/1/"); }
/// <summary> /// Constructor /// </summary> public Speech(string endPoint, string accessToken) { apiService = new APIService(endPoint, accessToken, "/speech/v3/"); }
/// <summary> /// Constructor /// </summary> public MyMessages(string endPoint, string accessToken) { apiService = new APIService(endPoint, accessToken, "/myMessages/v2/"); }
/// <summary> /// This function gets access token with post request /// </summary> public bool RevokeToken(TokenTypeHint tokenType, String token) { TokenTypeHint t = tokenType; var query = HttpUtility.ParseQueryString(String.Empty); string oauthParameters = String.Empty; switch (t) { case TokenTypeHint.AccessToken: query["client_id"] = apiKey; query["client_secret"] = secretKey; query["token"] = token; query["token_type_hint"] = "access_token"; break; case TokenTypeHint.RefreshToken: query["client_id"] = apiKey; query["client_secret"] = secretKey; query["token"] = token; query["token_type_hint"] = "refresh_token"; break; } oauthParameters = query.ToString(); if (!String.IsNullOrEmpty(oauthParameters)) { var revokeService = new APIService(endPoint, "/oauth/v4/"); var apiRequest = new APIRequest("revoke"); apiRequest.requireAccessToken = false; apiRequest.contentType = "application/x-www-form-urlencoded"; apiRequest.setBinaryData(oauthParameters); if (revokeService.post(apiRequest)) { return true; } } throw new Exception(apiService.errorResponse); }
/// <summary> /// SMS constructor /// </summary> public Devices(string endPoint, string accessToken) { apiService = new APIService(endPoint, accessToken, "/rest/2/Devices/"); }
/// <summary> /// Addressbook constructor /// </summary> public AddressBook(string endPoint, string accessToken) { apiService = new APIService(endPoint, accessToken, "/addressBook/v1/"); }