Skip to content

[unExpected behavior] History API returns all organization calls instead of authenticated user's calls #31

@roest01

Description

@roest01

Describe the bug
When using the createHistoryModule to fetch call history with a user-authenticated OAuth token, the API returns all calls from the entire organization instead of only the calls where the authenticated user was involved.

To Reproduce

  const client = sipgateIO({ token: access_token });
  const webuserId = await client.getAuthenticatedWebuserId(); // Returns "w0"

  const historyModule = createHistoryModule(client);
  const calls = await historyModule.fetchAll({
    types: ['CALL'],
    startDate: new Date('2024-12-23'),
    endDate: new Date('2024-12-23')
  });

  // Returns ALL calls from the organization, including:
  // - Calls from colleagues
  // - Calls the authenticated user was NOT involved in

Expected behavior
When authenticated as a user, the history should only return events where that user was involved (incoming calls they answered, outgoing calls they made). If returning all organization events is intentional, there should be a userId or webuserId filter option

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions