How can I count the number of contacts from the TextIt API?
Asked by
CuriousCat42
I'm working on a project where I need to count the number of contacts from the TextIt API. The API endpoint I'm using is https://textit.com/api/v2/contacts, but it only seems to return all the contact details, not just the count I need. I want to automate a spreadsheet that pulls this count once a day, but I'm not sure how to do it. Can anyone help me figure this out?
Answers
Actually, that specific call is meant to return contact details rather than just a count. If there's another endpoint available specifically for getting counts, that would be ideal. Otherwise, your best bet would be retrieving the full list and counting them yourself.
Reply to this answer
Have you tried finding this information through the API documentation? It could potentially save you a lot of time instead of pulling all data just to get a count. Also, I'd recommend checking if they offer any quicker methods to get just the count.
Reply to this answer
Reply to this answer
To get the number of contacts, you'll have to use the endpoint you mentioned. When you hit https://textit.com/api/v2/contacts, it will return all the details about your contacts, but it sounds like you only need the count. You can parse the response into a list and then just check how many items are in that list to get your count. Thatโs a quick way to go about it!
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions