Skip to content

pageSize opts not working #448

@simonemazzoni

Description

@simonemazzoni

Hello, I'm facing a wrong behaviour using the twilio-node sdk. If I try to retrieve the messages list from a channel setting a pageSize value, let's say equal to 25, the result contains all the messages like if the pageSize option is ignored.

I tried using the REST api instead, specifying the ?PageSize=25 param, and all works fine since I get the first 25 messages and the link for the next page and so on.

How can I solve this? Thanks.
Is there also a way to specify the starting page?

Thanks,
Simone

Version:
3.30.3

Code Snippet

const twilio = require('twilio');

const accountSid = 'acc sid';
const apikey_sid = 'apikey sid';
const apikey_secret = 'apikey secret';

const client = new twilio.Twilio(apikey_sid, apikey_secret, { accountSid: accountSid });

client.chat
    .services('serviceSid')
    .channels(encodeURIComponent('channelSid'))
    .messages
    .list({pageSize: 25})
        .then(ch => console.log("CHANNEL:", ch))
        .catch(err => console.error("ERR:", err));

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: docs updatedocumentation change not affecting the codetype: questionquestion directed at the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions