Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How do I export 1-1 ALL chat history?

AlanA September 7, 2016

I'm able to export most history for my 1-1 chats using the command below, but with mixed results:

 

 

curl --header "content-type: application/json" --header "Authorization: Bearer MYTOKEN" -X GET https://api.hipchat.com/v2/user/12345/history/latest?max-results=1000&auth_token=MYTOKEN


For some users, the history goes back 9 months or so, and for others it seems to go back to the beginning of our chats. Am I just seeing the last 1000 messages? How can I specify more, paginate or "get all"?

 

Thanks!

Alan

2 answers

0 votes
crivers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 12, 2016

In order to view/export history between users other than yourself, you will need to contact support (https://support.atlassian.com/servicedesk/customer/portal/32) - they will be able to initiate a full export for you.

0 votes
Steven F Behnke
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 7, 2016

The API docs are here – https://www.hipchat.com/docs/apiv2/method/view_recent_privatechat_history

You can only export 1000 messages to start. After that the system paginates. To get the next 1000, you could add the 'startIndex' parameter – 

curl --header "content-type: application/json" --header "Authorization: Bearer MYTOKEN" -X GET https://api.hipchat.com/v2/user/12345/history/latest?max-results=1000&startIndex=1001&auth_token=MYTOKEN
crivers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 12, 2016

Unfortunately, the API method will only allow you to view your own private chat history, not history for the entire group.

Jaakko Tuosa December 4, 2017

Actually, 'startIndex' in request does nothing, you get the same messages again.

The documentation mentions 'start-index' for history query. It has to be used with date parameter (otherwise you get error code 400, "Cannot page through recent values"). This seems to work for me:

https://api.hipchat.com/v2/user/email_of_other_user/history?max-results=1000&reverse=true&date=2017-11-16T15:33:30%2B02:00&start-index=1000

Btw, auth_token in url is unnecessary, if you already have the Authorization header.

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events