You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I needed the ability to rename clients so I added the following to your API:
/// <summary>
/// Rename Client
/// </summary>
/// <param name="client">Client to rename</param>
/// <param name="name">New Name</param>
public async Task<Responses.ResponseEnvelope<Responses.Clients>> RenameClient(Responses.Clients client, string name)
{
return await RenameClient(client.Id, name);
}
/// <summary>
/// Rename Client
/// </summary>
/// <param name="userId">Client's User Id for client to be renamed.</param>
/// <param name="name">New Name</param>
public async Task<Responses.ResponseEnvelope<Responses.Clients>> RenameClient(string userId, string name)
{
// Make the POST request towards the UniFi API to rename a client.
var resultString = await HttpUtility.PostRequest(new Uri(BaseUri, $"/api/s/{SiteId}/upd/user/{userId}"),
JsonConvert.SerializeObject(new {name}),
_cookieContainer,
ConnectionTimeout);
var resultJson = JsonConvert.DeserializeObject<Responses.ResponseEnvelope<Responses.Clients>>(resultString);
return resultJson;
}
The text was updated successfully, but these errors were encountered:
I needed the ability to rename clients so I added the following to your API:
The text was updated successfully, but these errors were encountered: