Zalo OA icon

Zalo OA

Tương tác với Zalo Official Account API

Overview

This node integrates with the Zalo Official Account (OA) API to perform various operations related to messaging, user management, content publishing, and media uploads. Specifically, for the "Chuẩn Bị Upload Video" operation under the Zalo OA resource, it prepares the necessary parameters to initiate a video upload process to the Zalo OA platform.

Typical use cases include automating interactions with Zalo OA such as sending messages, managing followers, creating or updating articles, and uploading media files like images, GIFs, and videos. The "Prepare Upload Video" operation is useful when you want to upload a video file to Zalo OA by first preparing the upload session with the video name and size, which is often required before the actual upload.

Example scenario: You have a marketing workflow where you want to post promotional videos on your Zalo Official Account. This node helps you prepare the upload by registering the video metadata (name and size) with Zalo OA, enabling subsequent steps to upload the video content.

Properties

Name Meaning
Tên Video The name/title of the video to be uploaded.
Kích Thước Video (byte) The size of the video file in bytes.

These properties are required inputs for the "Chuẩn Bị Upload Video" operation and must be provided to correctly initialize the video upload process.

Output

The node outputs JSON data containing the response from the Zalo OA API after preparing the video upload. This typically includes information such as an upload URL, upload token, or other metadata needed to proceed with the actual video file upload.

If the node supports binary data output (not explicitly shown for this operation), it would represent the actual media content or related binary payloads. However, for this operation, the output is primarily JSON metadata about the prepared upload session.

Dependencies

  • Requires an API key credential for authenticating with the Zalo Official Account API.
  • Uses the Zalo OA API endpoints (e.g., https://openapi.zalo.me/v3.0/oa).
  • Requires proper OAuth tokens (access token and refresh token) managed either via environment variables, static workflow data, or database storage.
  • Depends on the axios HTTP client library for making API requests.
  • Uses form-data package for handling multipart form uploads (for other operations involving file uploads).

Troubleshooting

  • Common issues:

    • Invalid or expired access tokens causing authentication failures.
    • Incorrect video size or name parameters leading to API errors.
    • Network connectivity problems affecting API calls.
    • Insufficient permissions granted to the OA application for uploading media.
  • Error messages:

    • Errors indicating missing or invalid tokens suggest checking the API credentials and refreshing tokens.
    • API response errors about parameters usually mean the video name or size is incorrect or missing.
    • HTTP status codes like 401 (Unauthorized) or 403 (Forbidden) indicate permission or token issues.
  • Resolutions:

    • Ensure that the API key and tokens are valid and refreshed as needed.
    • Verify that the video size matches the actual file size in bytes.
    • Confirm that the OA app has the required permissions for media upload.
    • Check network settings and retry failed requests.

Links and References


Note: The summary focuses on the "Chuẩn Bị Upload Video" operation within the Zalo OA resource, based on the provided input properties and static code analysis of the bundled source.

Discussion