DEV Community

Discussion on: Announcing the Twilio Hackathon on DEV

Collapse
 
h4roldov profile image
Haroldo Vivallo

Hi Phil, I have a question related to APIs, what is the best way to filter data by the attributes, does the API allow that or just returns a list (all channels, all users, etc) that I have to manually filter?

Collapse
 
dkundel profile image
Dominik Kundel

The filters that the REST APIs support varies from endpoint to endpoint. The best way to figure out what filters are available is by checking the docs for your specific doc and opening the REST reference docs for it

Collapse
 
philnash profile image
Phil Nash

Hi Haroldo, this depends on the API you are calling and whether it has attributes you can filter on. Do you have a particular API you are asking about?

Thread Thread
 
h4roldov profile image
Haroldo Vivallo

I'm working with the proglamable chat API, and I need to filter by the channel attributes and user attributes parameters. I've read the docs but there isn't explicit information about it. So what I am doing is getting all the users and all the channels and manually filtering by the attributes (attributes that I defined previously).

Thread Thread
 
philnash profile image
Phil Nash

Oh, ok. No, you can't filter by custom attributes on channels or users through the API itself. So what you are doing is the best thing right now.