O'Reilly logo

Twilio Cookbook Second Edition by Roger Stringer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Blacklisting and whitelisting the submissions

Being able to blacklist and whitelist the submissions is also important to include trusted users or exclude abusive ones.

In our case, we're going to set up two arrays, one for blacklisted numbers and one for whitelisted numbers.

If a phone sends an image, we'll first check to see whether the phone number is in the blacklist and if not, then we'll check the whitelist.

If the phone number is in the blacklist, then we ignore it. If it's in the whitelist, then we skip the filtering we placed in the previous recipe and upload the photo directly to the gallery.

Just like the previous recipe, we won't change all of the files. We will just update our previously updated gallery. The files that we will change are ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required