diff --git a/src/Api/HipchatClient.cs b/src/Api/HipchatClient.cs
index c2dca7a..788feee 100644
--- a/src/Api/HipchatClient.cs
+++ b/src/Api/HipchatClient.cs
@@ -951,11 +951,11 @@ public bool UpdatePhoto(string idOrEmail, string photo)
#region ViewPrivateChatHistory
- public HipchatViewRoomHistoryResponse ViewPrivateChatHistory(string user, string date = "recent", string timezone = "UTC", int startIndex = 0, int maxResults = 100, bool reverse = true)
+ public HipchatViewRoomHistoryResponse ViewPrivateChatHistory(string username, string date = "recent", string timezone = "UTC", int startIndex = 0, int maxResults = 100, bool reverse = true)
{
using (JsonSerializerConfigScope())
{
- if (user.IsEmpty() || user.Length > 100)
+ if (username.IsEmpty() || username.Length > 100)
throw new ArgumentOutOfRangeException("user", "Valid roomName length is 1-100.");
if (date.IsEmpty())
throw new ArgumentOutOfRangeException("date", "Valid date should be passed.");
@@ -968,7 +968,7 @@ public HipchatViewRoomHistoryResponse ViewPrivateChatHistory(string user, string
try
{
- return HipchatEndpoints.ViewPrivateChatHistoryEndpoint.Fmt(user)
+ return HipchatEndpoints.ViewPrivateChatHistoryEndpoint.Fmt(username)
.AddQueryParam("date", date)
.AddQueryParam("timezone", timezone)
.AddQueryParam("start-index", startIndex)
diff --git a/src/Api/IHipchatClient.cs b/src/Api/IHipchatClient.cs
index 0e06f73..763b4eb 100644
--- a/src/Api/IHipchatClient.cs
+++ b/src/Api/IHipchatClient.cs
@@ -473,5 +473,34 @@ bool SendNotification(string roomName, string message, RoomColors backgroundColo
/// https://www.hipchat.com/docs/apiv2/method/update_photo
///
bool UpdatePhoto(string idOrEmail, string photo);
+
+ ///
+ /// Fetch the history of a private chat
+ ///
+ /// The username.
+ /// Either the latest date to fetch history for in ISO-8601 format, or 'recent' to fetch the latest 75 messages. Note, paging isn't supported for 'recent', however they are real-time values, whereas date queries may not include the most recent messages.
+ /// Your timezone. Must be a supported timezone name, please see wikipedia TZ database page.
+ /// The start index for the result set
+ /// The maximum number of results. Valid length 0-100
+ /// Reverse the output such that the oldest message is first. For consistent paging, set to false.
+ ///
+ /// A HipchatGetAllRoomsResponse
+ ///
+ ///
+ /// roomName;Valid username length is 1-100.
+ /// or
+ /// date;Valid date should be passed.
+ /// or
+ /// timezone;Valid timezone should be passed.
+ /// or
+ /// startIndex;startIndex must be between 0 and 100
+ /// or
+ /// maxResults;maxResults must be between 0 and 1000
+ ///
+ ///
+ /// Authentication required, with scope view_group, view_messages. https://www.hipchat.com/docs/apiv2/method/get_privatechat_message
+ ///
+ HipchatViewRoomHistoryResponse ViewPrivateChatHistory(string username, string date = "recent", string timezone = "UTC", int startIndex = 0, int maxResults = 100, bool reverse = true);
+
}
}
\ No newline at end of file