Telegram bot - importing contacts and request for number - contacts

We have a company that has to get in touch with its user over Telegram, we've been thinking a lot and this is what came to my mind, I just want to know is it really possible to do such thing or not.
So basically we made an account to be our customer care service where people can tell us what their problem is and stuff. We also gathered all of our users Phone numbers + first and last name into a xlsx file during their first ever purchase.
Now this has to be done:
Is it possible to import all the phone numbers + names into a bot, and then whenever we receive a message from a customer on our customer care account, we forward their message to the bot, and it gives us their phone number.
This is technically possible for the account itself (not bot) but as Telegram has a limitation for number of contacts (I think it's 10k per acc), we can't do it. (We have over 50k users)
Is that clear or more explanation is needed.
P.S: My question was if it's possible to create a bot to be able to receive a message from a customer and return their number. (We already have their number so it's just like a quick search)
Additional info: If telegram did not have such limitation for number of contacts, we could simply add 50k contacts with a vcf file (on a phone) and see their number when they message us but since there is a limitation, we just want the bot to do this job for us but it has to able to give us their number too.

It will require a lot of work to setup, but it could be done.
Telegram gives every user a userid, but it won't tell you the phone number given that user id. So you have to get the userid by asking Telegram "what userid has phone number xyz" for every user and storing that information.
While it is possible to use the bot api and send a contact with each number to get the user_id of that user, the bot api is rate limited, and 50k users will either trigger that rate limit or will require some time.

Related

How to Implement "Your contact just joined app" feature

I am building a mobile app (in flutter firebase, but the answer does not have to be firebase specific). And I would like to implement a feature that notifies users whenever anyone from their contact list joins the app. This seems like a very EXPENSIVE feature.
At the top of my head, I see a lambda/cloud function that is triggered everytime a user joins and then searches a database of users and their respective contacts for the existence of the new user's phone number. To me, this solution does not scale well for two reasons: if the number of total users is in the millions and the number of users joining simultaneously is a lot.
My better solution is to get the user's contacts upon joining and then searching a database of current users contacts for any of the phone numbers of the newly joined user.
Is there a solution better than the second one? If so, what is it? If the second solution is standard, what kind of backend storage mechanism provides the best search and retrieval time for a database of users and their respective contacts?
In the case of large users ill not do first solution because that may slow the sign up process instead i will creat a cron job that runs at a specific time or periodically it will get the list of the latest users signed up that day or that hour whatever you prefer then that cron will check the new user if related to any user in the databases and send a notification right away, or a better solution create a temporary table in a database in another server insert the notification informations into the other server, creat another cron job in the second server it will run at a specific time to sendthe notification

How to send message to specific facebook user from website?

My goal is to make a website, in which user could customize a photo and then provide his friends indicators like name or id. My next task is to fetch that info from database and send messages on specific date to provided users. Ex birthday wishes, greetings, and so on.
I studied facebook send api for a few days now and couldn't find solution for myself. If I want to send message, I need to have Page-scoped id of user, which is acquired when the person text you first, which is not desired, because person wouldn't know what it is.
Also I was looking into Customer matching API, also seems to require the same PSID. The next thing I checked was Send Dialog API, which seems to send messages instantly, but not on the specific date. Also I checked unofficial facebook-chat-api, which asks for user ID, whereas I can find my id, I couldn't find ids of my friends.
So I just want to know is it even possible, if yes, I'd really appreciate your help.
User to User communication is not possible (and not allowed) in an automatic way, there is no API for it except for the Send Dialog. The Messenger platform is for page to user communication only.
Do not use inofficial tools, they are not allowed and might get you banned.

Facebook APIs using checkins as an entry to raffle

I've been exploring ways that it might be possible to promote the business of a friend of mine. One of these ways is by encouraging users to check in to his business, the incentive for this being that they go into the draw to win some kind of prize.
I've been trying to find if the code for this already exists but I might be looking in the wrong places. If it doesn't what would be the best way to do it using the graph APIs.
Thanks.
You can use Facebook app to check-in to your page/business.
All page check-ins can be fetched using following request by your code
https://graph.facebook.com/PAGE_ID/checkins?access_token=PAGE_ACCESS_TOKEN
If you want to get only specific time period check-ins use since and until params in query.
You have to parse the json response and store in an array and randomly select the winner.
you can contact the winner using their facebook id and send them a message.
You will have to write the code yourself, but it would essentially work like this:
Get the user to allow access to the "Raffle" application and get their email address and permissions to look at their check-ins. Email is required to contact the winner.
Use a scheduled script (cronjob) to periodically check if the user has checked-in anywhere (in particular, the business you want to promote).
Award a raffle ticket for each unique check-in within a 24 hour period.
Hold a draw between all the users who checked in on that day or week and award the prize to someone randomly.
Pretty simple flow, but complex code.

How to stop spam accounts

I have a web site using Facebook Connect where people have a strong incentive to create fake Facebook accounts and login multiple times in order to get more "votes" in my singing competition.
Anyways, I've come up with a strategy to identify these fake accounts and not let them use my site. (Haven't done the programming yet)
If their earliest wall post is more than 30 days old, then validate them.
If they have more than 20 friends, then validate them.
If their first profile picture is more than 30 days old, then validate them.
If their account has been phone verified, then validate them.
Number 4 is the one I'm having trouble with. One post I read says the GRAPH API has a verified field, but suggests that shows if the email has been verified (but not phone). This has proven a tough thing to search for. So I'm still unsure if this is possible.
Any comments on my strategy or help with #4 would be appreciated.
Thanks.
Actually the verified field should be what you are looking for. From the docs:
A user is considered verified if she takes any of the following
actions:
Registers for mobile
Confirms her account via SMS
Enters a valid credit card
We use verified and friend count to limit people. We even put those requirements into our legal terms so there's no misunderstanding.

What is the purpose these long string reply-to email addresses?

For example Groupon and Facebook seem to use these.
Groupon <reply-fec4e341ec32311-125727_HTML-677829183-96988-0#e.groupon.com>
Reply to Comment <g+41wq2z1j00000000u2kx002eqs1u620s0037hlmwm4621up33#groups.facebook.com>
In the facebook example - it makes sense that I could be replying to a particular comment thread and this is a unique hash that lets me do so from within an e-mail.
As for the groupon example, I am not aware of the purpose.
If I had to guess, I'd say Groupon does it so they can tie replies/complaints to a specific campaign. They must send out many millions of mails a day, and probably have many hundreds of campaigns running at the same time. Being able to automatically link feedback to a campaign is probably a huge time saver, and provides useful KPI stats.