Expected Behavior:
- On success, your password will be updated.
- If the recovery code is incorrect or the request is invalid, an error message will be returned.
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public async Task UpdatePassword()
{
var client = new HttpClient();
var url = "https://auth.api.pinghome.io/v1/account/password";
var requestBody = new {
email = "pinghome@gmail.com",
code = "285009",
password = "UpdatedPassw0rd!"
};
var content = new StringContent(JsonConvert.SerializeObject(requestBody), Encoding.UTF8, "application/json");
var response = await client.PatchAsync(url, content);
var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
}