Actions29
- Posts Actions
- Messages Actions
- Groups Actions
- Users Actions
- Photos Actions
Messages → Get History
AI-generatedOverview
The node interacts with the VKontakte (VK) API, a popular Russian social media platform. Specifically, for the Messages resource and the Get History operation, it retrieves the message history from a specified conversation or chat.
This operation is useful when you want to fetch past messages from a particular peer (user, group, or chat) in VK. For example, you might use this to archive conversations, analyze chat content, or trigger workflows based on recent messages.
Practical examples:
- Fetching the last 20 messages from a customer support chat to analyze user queries.
- Retrieving older messages for backup or audit purposes.
- Integrating VK message history into CRM or analytics platforms.
Properties
| Name | Meaning |
|---|---|
| Count | Number of messages to return from the history. |
| Offset | Offset for pagination to skip a number of messages before starting to return results. |
| Peer ID (required but not listed in your JSON) | The identifier of the conversation or chat whose history is being fetched. |
Note: Although "peerId" is not in the provided properties JSON snippet, the code shows it is required for the "getHistory" operation under Messages.
Output
The output is a JSON object representing the message history retrieved from VK. It typically includes an array of message objects containing details such as message text, sender ID, timestamps, and other metadata defined by VK's API.
No binary data output is indicated for this operation.
Dependencies
- Requires an API authentication token credential to access the VKontakte API.
- The node uses the base URL
https://api.vk.com/methodfor all requests. - Proper OAuth2 credentials must be configured in n8n to authenticate API calls.
Troubleshooting
- Missing or invalid peerId: The "peerId" parameter is mandatory for fetching message history. Omitting it or providing an incorrect value will cause errors.
- API rate limits: VK API enforces rate limits; excessive requests may result in temporary blocking.
- Invalid count or offset values: Providing negative numbers or excessively large counts may cause errors or unexpected results.
- Authentication errors: Ensure the API key or OAuth token is valid and has sufficient permissions.
- Error messages: The node throws errors like
Unknown operation: getHistoryif the operation name is misspelled or unsupported.
To resolve these issues:
- Double-check input parameters, especially "peerId".
- Verify API credentials and permissions.
- Respect VK API rate limits by adding delays or reducing request frequency.
- Use sensible values for count and offset.