Пример #1
0
        /// <summary>
        /// The Message API is used to post messages to the user’s contacts. After using the Contact API, you can send messages to the retrieved contacts.
        /// </summary>
        /// <param name="token">A valid session token,which is fetch from Access Token API.</param>
        /// <returns></returns>
        public string ExecuteAPI(Guid token)
        {
            string url = string.Format(Constants.APIRootDomain + Endpoint, token);

            HttpRequestParameter httprequestparameter = new HttpRequestParameter();
            httprequestparameter.Add("to", _To);
            httprequestparameter.Add("subject", _Subject);
            httprequestparameter.Add("message", _Message);

            return client.Request(url + "&" + httprequestparameter.ToString(), null, HttpMethod.POST);
        }
Пример #2
0
        /// <summary>
        /// The Message API is used to post messages to the user’s contacts. After using the Contact API, you can send messages to the retrieved contacts.
        /// </summary>
        /// <param name="token">A valid session token,which is fetch from Access Token API.</param>
        /// <returns></returns>
        public string ExecuteAPI(Guid token)
        {
            string url = string.Format(Constants.APIRootDomain + Endpoint, token);

            HttpRequestParameter httprequestparameter = new HttpRequestParameter();

            httprequestparameter.Add("to", _To);
            httprequestparameter.Add("subject", _Subject);
            httprequestparameter.Add("message", _Message);

            return(client.Request(url + "&" + httprequestparameter.ToString(), null, HttpMethod.POST));
        }
 /// <summary>
 /// This API allows you to query your LoginRadius Cloud Storage and retrieve up to 20 user records.
 /// </summary>
 /// <param name="select"> Fields included in the Query, default all fields, Optional: can be null or empty string</param>
 /// <param name="from">LoginRadius Table that details are being retrieved from, for now users only supported </param>
 /// <param name="where">Filter for data based on condition,Optional: can be null or empty string </param>
 /// <param name="orderBy">Determines ascending order of returned data,Optional: can be null or empty string</param>
 /// <param name="skip">Ignores the specified amount of values used to page through responses, value must be positive and default value is 0, Optional: can be null or empty string</param>
 /// <param name="limit">Determines size of dataset returned. default value is 20 and max value is 20, Optional: can be null or empty string</param>
 /// <returns></returns>
 public List<LoginRadiusIdentityModel> GetUserList(string select, string from, string where, string orderBy, string skip,
     string limit)
 {
     var postRequest = new HttpRequestParameter
     {
         {"From", string.IsNullOrWhiteSpace(from)?"users":from}
     };
     if (!string.IsNullOrWhiteSpace(select)) { postRequest.Add("Select",select); }
     if (!string.IsNullOrWhiteSpace(where)) { postRequest.Add("Where", where); }
     if (!string.IsNullOrWhiteSpace(orderBy)) { postRequest.Add("OrderBy", orderBy); }
     if (!string.IsNullOrWhiteSpace(skip)) { postRequest.Add("Skip", skip); }
     if (!string.IsNullOrWhiteSpace(limit)) { postRequest.Add("Limit", limit); }
     var response = Post(_object, postRequest);
     return response.Deserialize<List<LoginRadiusIdentityModel>>();
 }
        protected string Post(LoginRadiusObject @object, HttpRequestParameter getParams, HttpRequestParameter postParams)
        {
            if (getParams == null)
            {
                getParams = _commHttpRequestParameter;
            }
            else
            {
                foreach (var par in _commHttpRequestParameter)
                {
                    getParams.Add(par.Key, par.Value);
                }
            }

            var response = _httpClient.HttpPost(GetEndpoint(@object.ObjectName), getParams, postParams);
            return response.ResponseContent;
        }
        protected string Get(LoginRadiusObject @object, HttpRequestParameter parameter)
        {
            if (parameter == null)
            {
                parameter = _commHttpRequestParameter;
            }
            else
            {
                foreach (var par in _commHttpRequestParameter)
                {
                    parameter.Add(par.Key, par.Value);
                }
            }

            var response = _httpClient.HttpGet(GetEndpoint(@object.ObjectName), parameter);
            return response.ResponseContent;
        }
Пример #6
0
        /// <summary>
        /// The Status API is used to update the status on the user’s wall.
        /// </summary>
        /// <param name="token">A valid session token,which is fetch from Access Token API.</param>
        /// <returns></returns>
        public string ExecuteAPI(Guid token)
        {
            string url = string.Format(Constants.APIRootDomain + Endpoint, token);

            HttpRequestParameter httprequestparameter = new HttpRequestParameter();

            httprequestparameter.Add("title", _title);
            httprequestparameter.Add("url", _url);
            httprequestparameter.Add("imageurl", _imageurl);
            httprequestparameter.Add("status", _status);
            httprequestparameter.Add("caption", _caption);
            httprequestparameter.Add("description", _description);

            return(client.Request(url + "&" + httprequestparameter.ToString(), null, HttpMethod.POST));
        }
 /// <summary>
 /// This method is used to generate an email-token that can be sent out to a user in a link in order to verify their email.
 /// </summary>
 /// <param name="emailId">User's email address</param>
 /// <param name="link">Verification Url link address</param>
 /// <param name="template">Verification Email Template,Optional</param>
 /// <returns></returns>
 public LoginRadiusEmailVerificationToken ResendUserVerificationEmail(string emailId, string link, string template)
 {
     _valuesToCheck = new ArrayList {emailId, link};
     _validate.Validate(_valuesToCheck, "Resend User Verification Email");
     var getRequest = new HttpRequestParameter
     {
         { "emailid", emailId },{"link",link}
     };
     if (!string.IsNullOrWhiteSpace(template))
     {
         getRequest.Add("template", template);
     }
     var response = Get(_object.ChildObject("verificationemail"), getRequest);
     return response.Deserialize<LoginRadiusEmailVerificationToken>();
 }
 /// <summary>
 /// Method which deletes the User account with email confirmation and allows them to re-register for a new account.
 /// </summary>
 /// <param name="accountId">An account id is set of unique numerics and characters that uniquely identifies a user's account or the identifier for each user account.</param>
 /// <param name="deleteUserLink">Link that handles the delete logic</param>
 /// <param name="template">Name of the email template to be send for the delete confirmation</param>
 public LoginRadiusPostResponse DeleteAccountWithEmailConfirmation(string accountId, string deleteUserLink, string template)
 {
     _valuesToCheck = new ArrayList {accountId, deleteUserLink};
     _validate.Validate(_valuesToCheck, "DeleteAccount");
     var getRequest = new HttpRequestParameter
     {
         { "accountid", accountId },
         {"deleteuserlink",deleteUserLink}
     };
     if (!string.IsNullOrWhiteSpace(template))
     {
         getRequest.Add("template", template);
     }
     var response = Get(_object.ChildObject("deleteuseremail"), getRequest);
     return response.Deserialize<LoginRadiusPostResponse>();
 }
Пример #9
0
        /// <summary>
        /// The Status API is used to update the status on the user’s wall.
        /// </summary>
        /// <param name="token">A valid session token,which is fetch from Access Token API.</param>
        /// <returns></returns>
        public string ExecuteAPI(Guid token)
        {
            string url = string.Format(Constants.APIRootDomain + Endpoint, token);

            HttpRequestParameter httprequestparameter = new HttpRequestParameter();
            httprequestparameter.Add("title", _title);
            httprequestparameter.Add("url", _url);
            httprequestparameter.Add("imageurl", _imageurl);
            httprequestparameter.Add("status", _status);
            httprequestparameter.Add("caption", _caption);
            httprequestparameter.Add("description", _description);

            return client.Request(url + "&" +httprequestparameter.ToString()  , null, HttpMethod.POST);
        }