Archiving
The archiving feature allows to export messages for archiving purposes. It is only available to archiving admins, that is, admins that have been explicitly configured to be allowed access. See the “Teamwire Server VM Installation” documentation for more details.
User message archives
Download an archive of a user’s chats, messages and attachments
GET /v<api_version>/admin/archive/user/<user_id>/<start>-<end>.tar.pgp
Start and end timestamps must be provided to specify the time period for which the archive is to be generated.
Access restrictions
- Admins and Superadmins must be archiving admins for the user’s organisation.
URL parameters
The following parameters are specified as part of the URL, i.e. /<parameter>/:
| Name | Type | Optional | For use by | Description |
|---|---|---|---|---|
| api_version | String | No | All admins | The Enterprise API version targeted. |
| user_id | String | No | All admins | The ID of the user to generate the archive for. |
| start | Number | No | All admins | A timestamp in seconds since 1970-01-01 00:00:00 UTC. Messages older than this timestamp will not be included in the archive. |
| end | Number | No | All admins | A timestamp in seconds since 1970-01-01 00:00:00 UTC. Messages newer than this timestamp will not be included in the archive. |
GET parameters
The following parameters are specified as part of the query string
in the URL, i.e. ?param1=value2¶m2=value2:
| Name | Type | Optional | For use by | Description |
|---|---|---|---|---|
time_zone |
String | Yes | All admins | Time zone used by organization can be (usally is) not UTC. Archive is done from hour 0 UTC. Time zone param allows to ‘move’ archive start/end time. |
Result
The following return values indicate the outcome of the API call:
| HTTP status code | Description |
|---|---|
| 200 (OK) | The request was successful. A GPG-encrypted tar archive will be returned for download. |
| 400 (Bad request) | The request failed because no valid start and end parameters were provided. |
| 401 (Unauthorized) | The request failed because the caller failed to first login to the Enterprise API or her session expired. Login to obtain a new session and repeat the request. |
| 403 (Forbidden) | The request failed because either a.) the calling admin’s organisation has been disabled or b.) the calling admin has not been configured as an archiving admin for the user’s organisation. |
| 404 (Not found) | The request failed because the specified user could not be found. |
Organisation message archives
Download an archive of an organisation’s chats, messages and attachments
GET /v<api_version>/admin/archive/organisation/<start>-<end>.tar.pgp
Start and end timestamps must be provided to specify the time period for which the archive is to be generated.
Access restrictions
- Admins and Superadmins must be archiving admins for the affected organisation.
- Admins can request organisation archives of their own organisation only.
- Superadmins can request organisation archives of any organisation.
URL parameters
The following parameters are specified as part of the URL, i.e. /<parameter>/:
| Name | Type | Optional | For use by | Description |
|---|---|---|---|---|
| api_version | String | No | All admins | The Enterprise API version targeted. |
| start | Number | No | All admins | A timestamp in seconds since 1970-01-01 00:00:00 UTC. Messages older than this timestamp will not be included in the archive. |
| end | Number | No | All admins | A timestamp in seconds since 1970-01-01 00:00:00 UTC. Messages newer than this timestamp will not be included in the archive. |
GET parameters
The following parameters are specified as part of the query string
in the URL, i.e. ?param1=value2¶m2=value2:
| Name | Type | Optional | For use by | Description |
|---|---|---|---|---|
organisation_id |
String | Yes | All admins | The organisation to generate the archive for. |
time_zone |
String | Yes | All admins | The time zone used by the organisation. If unspecified, the times in the archive will be relative to UTC. |
Result
The following return values indicate the outcome of the API call:
| HTTP status code | Description |
|---|---|
| 200 (OK) | The request was successful. A GPG-encrypted tar archive will be returned for download. |
| 400 (Bad request) | The request failed because no valid start and end parameters were provided or an invalid organisation_id was specified. |
| 401 (Unauthorized) | The request failed because the caller failed to first login to the Enterprise API or her session expired. Login to obtain a new session and repeat the request. |
| 403 (Forbidden) | The request failed because either a.) the calling admin’s organisation has been disabled or b.) the calling admin has not been configured as an archiving admin for the specified organisation. |
| 404 (Not found) | The request failed because the specified organisation could not be found. |
Manage archiving admins
Return a list of configured archiving admins
GET /v<api_version>/admin/archive/list_admins/<organisation_id>/
Access restrictions
- Admins must be archiving admins for the specified organisation or Superadmins.
URL parameters
The following parameters are specified as part of the URL, i.e. /<parameter>/:
| Name | Type | Optional | For use by | Description |
|---|---|---|---|---|
| api_version | String | No | All admins | The Enterprise API version targeted. |
| organisation_id | Number | No | All admins | The ID of the organisation to return the archiving admins for. |
Result
The following return values indicate the outcome of the API call:
| HTTP status code | Description |
|---|---|
| 200 (OK) | The request was successful. Information about archiving admins is returned as a JSON object as described below. |
| 401 (Unauthorized) | The request failed because the caller failed to first login to the Enterprise API or her session expired. Login to obtain a new session and repeat the request. |
| 403 (Forbidden) | The request failed because either a.) the calling admin’s organisation has been disabled or b.) the admin is neither one of the configured archiving admins nor a Superadmin. |
| 404 (Not found) | The request failed because the organisation could not be found. |
| 409 (Conflict) | The request failed because the specified organisation has been disabled. |
If the request was successful, a JSON array of objects with the following elements is returned:
| Name | Type | Visible to | Description |
|---|---|---|---|
first_name |
String | All admins | The admin’s first name. |
last_name |
String | All admins | The admin’s last name. |
email |
String | All admins | The admin’s email address. |