Beispiel #1
0
        public ClickatellClient(RESTCredentials credentials, ILogger logger = null, int bulkHandsetsInterval = 5000)
        {
            //Sets the REST API credentials
            _credentials = credentials;

            _bulkHandsetsInterval = bulkHandsetsInterval;
            _logger = logger;
        }
Beispiel #2
0
        /// <summary>
        ///     Issues an access token for a user of an application. Application credentials can be obtained from the Adobe Sign
        ///     Application page. User credentials can be a combination of email and password, or the API key of the user. The
        ///     access token returned by this endpoint has a validity of 14 days and is a required header parameter for all the
        ///     other endpoints that requires an authenticated user.  NOTE: This endpoint is deprecated and will be removed in a
        ///     future release - please use an &lt;a href&#x3D;\&quot;javascript:void(0)\&quot; onclick&#x3D;\&quot;
        ///     window.open(oauthDoc(),&#39;oauthDoc&#39;).focus()\&quot;&gt;OAuth Access Token&lt;/a&gt; instead.
        /// </summary>
        /// <param name="rESTCredentials">The user and application credentials to use for issuing the access token.</param>
        /// <returns>AccessToken</returns>
        public AccessToken CreateAccessToken(RESTCredentials rESTCredentials)
        {
            // verify the required parameter 'rESTCredentials' is set
            if (rESTCredentials == null)
            {
                throw new ApiException(400, "Missing required parameter 'rESTCredentials' when calling CreateAccessToken");
            }


            string path = "/auth/tokens";

            path = path.Replace("{format}", "json");

            Dictionary <string, string>        queryParams  = new Dictionary <string, string>();
            Dictionary <string, string>        headerParams = new Dictionary <string, string>();
            Dictionary <string, string>        formParams   = new Dictionary <string, string>();
            Dictionary <string, FileParameter> fileParams   = new Dictionary <string, FileParameter>();
            string postBody = null;

            postBody = ApiClient.Serialize(rESTCredentials); // http body (model) parameter

            // authentication setting, if any
            string[] authSettings = { };

            // make the HTTP request
            IRestResponse response = (IRestResponse)ApiClient.CallApi(path, Method.POST, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

            if ((int)response.StatusCode >= 400)
            {
                throw new ApiException((int)response.StatusCode, "Error calling CreateAccessToken: " + response.Content, response.Content);
            }
            if ((int)response.StatusCode == 0)
            {
                throw new ApiException((int)response.StatusCode, "Error calling CreateAccessToken: " + response.ErrorMessage, response.ErrorMessage);
            }

            return((AccessToken)ApiClient.Deserialize(response.Content, typeof(AccessToken), response.Headers));
        }
Beispiel #3
0
 public REST(RESTCredentials credentials)
 {
     //Sets the REST API credentials
     _credentials = credentials;
 }
 public ClickatellClient(RESTCredentials credentials)
 {
     //Sets the REST API credentials
     _credentials = credentials;
 }
Beispiel #5
0
 public RestClient(RESTCredentials credentials)
 {
     //Sets the REST API credentials
     _credentials = credentials;
 }
Beispiel #6
0
 public REST(RESTCredentials credentials)
 {
     //Sets the REST API credentials
     _credentials = credentials;
 }