GET /v1/channels/{id}/history-import
const url = 'https://seu-endereco-da-api/v1/channels/example/history-import';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://seu-endereco-da-api/v1/channels/example/history-import \ --header 'Authorization: Bearer <token>'Permissão que a Chave de acesso precisa: Gerenciar canais (channels:manage).
Authorizations
Seção intitulada “Authorizations”Parameters
Seção intitulada “Parameters”Path Parameters
Seção intitulada “Path Parameters”Responses
Seção intitulada “Responses”The channel’s latest import, or null when it never imported
object
Receiving: the source is still sending and every batch is only stored; importing: the stored batches are being written at a pace set by the database load
Batches received and stored, including batches that arrive after the source’s end
Known only after the source’s end message
Chats without a resolvable phone: reported by the source in its end message plus those the importer received and could not resolve
Messages already present (received live or in an earlier batch)
Receiving: the source’s own percent; importing: stored messages already written; never goes back within a phase; 100 when done
Human-readable pt-BR sentence, shown as is
Lite import with no news from the phone for 30 minutes while receiving: waiting_first_batch when nothing arrived yet, no_end when batches stopped before the source’s end; null otherwise
Example
{ "source": "gateway", "status": "running", "phase": "receiving", "stall": "waiting_first_batch"}