Skip to content

getGroupChatHistory returns 404 (/api/group/history) while getGroupInfo works — endpoint moved? #367

Description

@saloprj

Version

zca-js@2.1.2 (latest published; also verified against main — identical source).

Summary

api.getGroupChatHistory(groupId, count) fails with ZaloApiError: Request failed with status code 404 for a valid group, while other group-service calls on the same session and same service host succeed.

Reproduction

const api = await zalo.login({ cookie, imei, userAgent }); // session OK
api.getOwnId();                       // ✅ returns own uid
await api.getAllGroups();             // ✅ group present in gridVerMap
await api.getGroupInfo(groupId);      // ✅ valid group, enableMsgHistory: 1, real members
await api.getGroupChatHistory(groupId, 50); // ❌ ZaloApiError 404
  • The groupId is confirmed correct (it's a key in getAllGroups().gridVerMap, and getGroupInfo returns its full info with name, creatorId, members).
  • The group is not empty — it has messages.
  • enableMsgHistory is 1 in the group settings.

Likely cause

Both calls target the same host (api.zpwServiceMap.group[0]), but:

  • getGroupInfo/api/group/getmg-v2works
  • getGroupChatHistory/api/group/history404

The working sibling is versioned (getmg-v2); the failing one is the unversioned /api/group/history. It looks like Zalo moved/retired the old group-history path server-side (possibly to a versioned endpoint), so the current getGroupChatHistory implementation 404s.

Request

Could the group-history endpoint URL / params be updated to whatever the current Zalo Web client uses? Happy to help capture the current request shape if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions