Allo

Envoyer un fax

Envoie un PDF par fax depuis l'une de vos lignes Allo. La requête est en multipart/form-data avec trois parties : from , to et file .

POST/v2/api/faxes

Comportement

Envoie un PDF par fax depuis l'une de vos lignes Allo. La requête est en multipart/form-data avec trois parties : from, to et file.

curl -X POST https://api.withallo.com/v2/api/faxes \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -F "from=+14155550100" \
  -F "to=+14155551234" \
  -F "[email protected];type=application/pdf"

La réponse est 201 avec le nouvel élément de conversation : type SMS, message_type FAX, status PENDING, et le PDF dans attachments. Le fax part en arrière-plan. page_count vaut null dans cette réponse et est renseigné une fois le fax envoyé. Récupérez l'élément plus tard avec Obtenir un élément de conversation pour suivre son status.

Prérequis

  • Le fax est activé sur votre compte.
  • from est un numéro local des États-Unis ou du Canada que vous pouvez utiliser, avec Envoyer et recevoir des fax activé dans les paramètres du numéro, dans l'application Allo. Les numéros gratuits et les sender IDs ne peuvent pas envoyer de fax.
  • file est un PDF envoyé avec le type de contenu application/pdf, de 12 Mo au maximum.
  • Votre équipe a assez de crédits. Chaque page envoyée utilise des crédits de messages.

Voir la vue d'ensemble du fax pour savoir comment les fax apparaissent dans les conversations.

Erreurs

StatutCodeQuand
400MISSING_PARAMETERfrom, to ou file est absent
400FAX_NOT_SUPPORTED_ON_NUMBERLa ligne from ne peut pas envoyer de fax
400FAX_NOT_ENABLED_ON_LINEEnvoyer et recevoir des fax est désactivé sur la ligne from
400FAX_FILE_NOT_PDFfile n'est pas envoyé en application/pdf
400FAX_FILE_EMPTYfile est vide
400MAX_UPLOAD_SIZE_EXCEEDEDfile dépasse 12 Mo
402INSUFFICIENT_CREDITSVotre équipe n'a pas assez de crédits pour envoyer le fax
403FAX_NOT_AVAILABLELe fax n'est pas activé sur votre compte. Contactez le support Allo.
404FROM_NUMBER_NOT_FOUNDfrom n'est pas une ligne que vous pouvez utiliser

Les autres erreurs, comme un numéro to invalide, sont les mêmes que pour l'envoi d'un SMS. Voir Codes d'erreur.

Autorisation

Authorizationstring · headerrequis

Scope needed: FAX_SEND

Réponses

201Fax accepted for sending. Returns the new conversation item.
dataobject
26 champs
idstring
typeenum<string>

CALL for a call, SMS for a message. Faxes are SMS items with message_type set to FAX.

CALLSMS

directionenum<string>

INBOUNDOUTBOUND

allo_numberstring
contact_numberstring
contactsobject[]
4 champs
idstring
namestring
companyobject | null
2 champs
idstring
namestring
dealsobject[]
3 champs
idstring
namestring
statusenum<string>

OPENWONLOST

userobject
3 champs
idstring
namestring
emailstring
datestring<date-time>
durationinteger | null

Total call length in seconds, from when the call starts (ringing included) to when it ends. For the talk time shown in the Allo app, use recording_duration.

resultenum<string>

Call outcome. Null for SMS items. An outbound call that reached voicemail reports VOICEMAIL. FAILED_EXTERNAL only appears on older calls. New values may be added: handle unknown values gracefully.

ANSWEREDVOICEMAILTRANSFERRED_AITRANSFERRED_EXTERNALBLOCKEDFAILEDFAILED_EXTERNALRECEIVEDCLOSED

detected_outbound_voicemailboolean | null

Outbound calls only. true when the call was answered by an answering machine, false when a human answered, null when no detection ran for this call (never set on inbound calls or SMS). Note that result stays ANSWERED for these calls — the carrier considers a machine pickup an answer.

voicemail_leftboolean | null

Outbound calls only. true when a message was actually left on the voicemail, false when the caller hung up without leaving one, null when not determined. Independent of detected_outbound_voicemail: either can be set without the other.

recording_urlstring | null

Link to the call recording. Absent when the call was not recorded, and for accounts sold under a white-label partner's brand: use recording_download_url there.

recording_download_urlstring | null

Signed link that downloads the recording with no login, valid for 48 hours. Returned only for lines of accounts created by a partner, never for a call on a HIPAA-enabled team, and only when the key's user can play the recording. For a fresh link, call GET /v2/api/conversations/items/{id}/recording.

recording_download_expires_atstring<date-time> | null

When recording_download_url stops working.

recording_durationinteger | null

Length of the call recording in seconds: the talk time, excluding ringing. This is the duration shown in the Allo app for recorded calls. null when the call was not recorded.

summarystring | null
tagsstring[]
extracted_dataobject | null

Contact details Allo's AI picked up from the call transcript, under a contact object: name, company, job_title, website, address (strings, empty when not mentioned) and emails (array). Null for SMS items and for calls Allo has not analyzed.

1 champs
contactobject
6 champs
namestring
companystring
job_titlestring
websitestring
addressstring
emailsstring[]
data_collectedobject | null

Legacy field kept for compatibility. An empty object on current calls. Null for SMS items.

transcriptobject[]
3 champs
sourceenum<string>

USEREXTERNAL

timestring<date-time>
textstring
contentstring | null
statusenum<string>

PENDINGSENTDELIVEREDFAILED

message_typeenum<string>

SMSMMSWHATSAPPFAX

attachmentsobject[]

Photos and other files sent with the message, in the order they were sent. For a fax, the faxed PDF. An empty array for a message with no files, and null for a call.

5 champs
file_namestring
content_typestring

MIME type of the file.

file_sizeinteger<int64> | null

Size of the file in bytes.

download_urlstring | null

Signed link that downloads the file with no login, valid for 30 minutes. null for a message on a HIPAA-enabled team. For a fresh link, fetch the item again.

download_expires_atstring<date-time> | null

When download_url stops working.

page_countinteger | null

Number of pages of a fax. null for calls, for messages that are not faxes, and for a fax whose page count is not known yet.

400
401
402Not enough message credits to send the fax
errorobject
6 champs
typestring
codestring
messagestring
retryableboolean
request_idstring
retry_after_secondsinteger | null
403
404
429