示例#1
0
        /// <summary>
        /// This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section <a href='https://www.loginradius.com/docs/api/v2/customer-identity-api/advanced-api-usage/'>Here</a> for more capabilities.
        /// </summary>
        /// <param name="accountUserProfileUpdateModel">Model Class containing Definition of payload for Account Update API</param>
        /// <param name="uid">UID, the unified identifier for each user account</param>
        /// <param name="fields">The fields parameter filters the API response so that the response only includes a specific set of fields</param>
        /// <returns>Response containing Definition for Complete profile data</returns>
        /// 18.15

        public ApiResponse <Identity> UpdateAccountByUid(AccountUserProfileUpdateModel accountUserProfileUpdateModel, string uid,
                                                         string fields = "")
        {
            if (accountUserProfileUpdateModel == null)
            {
                throw new ArgumentException(BaseConstants.ValidationMessage, nameof(accountUserProfileUpdateModel));
            }
            if (string.IsNullOrWhiteSpace(uid))
            {
                throw new ArgumentException(BaseConstants.ValidationMessage, nameof(uid));
            }
            var queryParameters = new QueryParameters
            {
                { "apiKey", ConfigDictionary[LRConfigConstants.LoginRadiusApiKey] },
                { "apiSecret", ConfigDictionary[LRConfigConstants.LoginRadiusApiSecret] }
            };

            if (!string.IsNullOrWhiteSpace(fields))
            {
                queryParameters.Add("fields", fields);
            }

            var resourcePath = $"identity/v2/manage/account/{uid}";

            return(ConfigureAndExecute <Identity>(HttpMethod.PUT, resourcePath, queryParameters, ConvertToJson(accountUserProfileUpdateModel)));
        }
示例#2
0
        public IActionResult LRUpdate([FromBody] AccountUserProfileUpdateModel updateModel, [FromQuery(Name = "uid")] String uid)
        {
            var apiresponse = new AccountApi().UpdateAccountByUid(updateModel, uid);

            if (apiresponse.RestException != null)
            {
                return(StatusCode(400, Json(apiresponse.RestException)));
            }
            return(Json(apiresponse.Response));
        }