Avito icon

Avito

Взаимодействие с API Авито для бизнеса

Overview

This node integrates with the Avito API to retrieve structured data related to categories and their fields. Specifically, for the resource "Автозагрузка" (Autoload), it supports operations such as fetching the full category tree and obtaining detailed fields of a specific category.

Common scenarios where this node is beneficial include:

  • Building or updating product listings by dynamically retrieving category structures and their associated fields.
  • Automating data synchronization with Avito's catalog, ensuring that category slugs and field definitions are always up-to-date.
  • Creating custom forms or interfaces that adapt based on category-specific fields fetched from Avito.

Practical example:

  1. Use the "Дерево Категорий" (Category Tree) operation to get all available categories and find the current slug for a desired category.
  2. Use the "Поля Категории" (Category Fields) operation with the obtained slug to fetch all fields, dependencies, possible values, and types for that category.
  3. Use this information to validate or enrich your data before sending it to Avito.

Properties

Name Meaning
Дополнительные Заголовки (Additional Headers) Optional HTTP headers to include in the request. Mainly used to specify If-Modified-Since header with a date/time in RFC1123 UTC format to optimize data retrieval by only fetching updates since the specified time.
Slug Категории (Category Slug) The slug identifier of the category for which to retrieve fields. This is required for the "Поля Категории" operation. You should obtain the current slug by first running the "Дерево Категорий" operation, as slugs may change over time. Example placeholder: remont.
📂 Получение категорий и полей Notice Informational notice explaining how to use the category tree and category fields operations effectively:
• Use "Дерево Категорий" to get the full list of categories.
• Find the needed slug in the category structure.
• Use the slug to get fields for a specific category.
• Slugs can change, so always verify before use.
• Steps to find slug are provided.

Output

The node outputs JSON data containing the results of the requested operation:

  • For "Дерево Категорий" (Category Tree): A JSON array representing the full hierarchical structure of all available categories, including their slugs and metadata.
  • For "Поля Категории" (Category Fields): A JSON object detailing all fields associated with the specified category slug. This includes field dependencies, possible values, value types, and links to value catalogs if applicable.

No binary data output is indicated for these operations.

Dependencies

  • Requires an API key credential for authenticating with the Avito API.
  • The node depends on the Avito OAuth2 authentication mechanism configured in n8n.
  • Network access to Avito's API endpoints is necessary.
  • No additional external libraries beyond those bundled with the node are required.

Troubleshooting

  • Common Issues:

    • Using outdated or incorrect category slugs will result in errors or empty responses. Always fetch the latest category tree before querying category fields.
    • Incorrectly formatted If-Modified-Since header values may cause the API to ignore the header or return errors.
    • Missing or invalid API credentials will prevent successful API calls.
  • Error Messages:

    • "Unknown resource: ...": Indicates an unsupported resource was selected; ensure "autoload" is chosen for these operations.
    • API errors related to authorization typically mean the API key or OAuth token is missing or expired.
    • Errors about invalid slugs suggest the slug does not exist or has changed; refresh the category tree.
  • Resolutions:

    • Always run the "Дерево Категорий" operation first to get valid slugs.
    • Verify and correctly format any additional HTTP headers.
    • Check and update API credentials in n8n settings.

Links and References


Note: This summary is based solely on static analysis of the provided source code and property definitions without runtime execution.

Discussion