Hi, sorry this has happened.
Ideally, there should be nothing on the floor of your cage, apart from maybe some paper towels to catch any water. Any substrate, be it repti-carpet or mulch/dirt is bad for chameleons, as if they do ingest it, it can cause impaction.
My advice would be to keep an eye on him for the next 24 to 48 hours. If he poops okay, hopefully he should be fine. If not, I would recommend the vet, as impaction can be fatal.
Hope he's okay.