Skip to content

Zalo — Tải lên ​

Tải ảnh lên (Upload image) — zalo.upload_image ​

Upload a JPG or PNG (max 1 MB). Returns attachment_id, valid for 7 days.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
file_urlĐường dẫn tệpstringcóHTTPS URL of the file to upload (max 1000000 bytes). Pattern: ^https://.
file_nameTên tệpstringkhôngFile name to send to Zalo.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectThe uploaded file.
data.attachment_idstringID of the uploaded image. Pass it as attachment_id to send_image; valid for 7 days.

Tải GIF lên (Upload GIF) — zalo.upload_gif ​

Upload a GIF (max 5 MB). Returns attachment_id.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
file_urlĐường dẫn tệpstringcóHTTPS URL of the file to upload (max 5000000 bytes). Pattern: ^https://.
file_nameTên tệpstringkhôngFile name to send to Zalo.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectThe uploaded file.
data.attachment_idstringID of the uploaded GIF. Pass it as attachment_id to send_image. The reference field table calls it token, but its example returns attachment_id; this follows the example.

Tải tệp lên (Upload file) — zalo.upload_file ​

Upload a PDF, DOC, DOCX or CSV (max 5 MB). Returns the token for send_file.

Tác độngRủi roCần duyệtIdempotentScopes
WRITEmediumcókhông—

Input

FieldNhãnKiểuBắt buộcMô tả
file_urlĐường dẫn tệpstringcóHTTPS URL of the file to upload (max 5000000 bytes). Pattern: ^https://.
file_nameTên tệpstringkhôngFile name to send to Zalo.

Field thêm: bỏ qua.

Output

FieldNhãnKiểuMô tả
dataKết quảobjectThe uploaded file.
data.tokenstringToken of the uploaded file. Pass it to send_file.