messages.initHistoryImport
Import chat history from a foreign chat app into a specific Telegram chat, click here for more info about imported chats ».
Import chat history from a foreign chat app into a specific Telegram chat, [click here for more info about imported chats »](https://core.telegram.org/api/import.md).
| Name | Type | Required | Description |
|---|---|---|---|
peer | InputPeer | Yes | The Telegram chat where the [history should be imported](https://core.telegram.org/api/import.md). |
file | InputFile | Yes | File with messages to import. |
media_count | int | Yes | Number of media files associated with the chat that will be uploaded using [messages.uploadImportedMedia](https://core.telegram.org/method/messages.uploadImportedMedia.md). |
Replies
messages.HistoryImport
MTProto RPC
- 400 · CHAT_ADMIN_REQUIRED — You must be an admin in this chat to do this.
- 400 · IMPORT_FILE_INVALID — The specified chat export file is invalid.
- 400 · IMPORT_FORMAT_DATE_INVALID — The date specified in the import file is invalid.
- 400 · IMPORT_FORMAT_UNRECOGNIZED — The specified chat export file was exported from an unsupported chat app.
- 400 · PEER_ID_INVALID — The provided peer id is invalid.
- 406 · PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_%dMIN — Import for this chat is already in progress, wait %d minutes before starting a new one.
- 400 · USER_NOT_MUTUAL_CONTACT — The provided user is not a mutual contact.