-
Notifications
You must be signed in to change notification settings - Fork 599
searchForThread could not find thread name #396
Comments
You're right, I just tried to search by thread name and nothing is found... but when I'm putting e.g. name of one of the participants then I get array of threads with that user :/ |
Must be a Facebook thing then - this has worked in the past. I'll poke around in the chrome dev tools and see what I can find |
Ok it has changed, Facebook now sends a call to messenger.com/api/graphqlbatch/ which returns three JSON strings - one for users that match your search, one for threads that match your search, and a paging info string. It's a get request with form data - the important bits of data that I could see are these:
Looks like they've got their own query language. I've replaced my search with [my search], and it looks like there are a bunch of numbers that we could add into a function. The |
Yup, their query language is called GraphQL and it's apparently quite popular (I've never heard of it 😛). There's a node.js module for it here |
I haven't heard about it to... :/ |
Haha I'll have a shot |
Wow, one of these requests shows the affinity between you and all of your friends - i.e. my girlfriend as an affinity of 0.99999999999973, whereas a less interacted-with friend has an affinity of 0.58893558687104 |
woow 😃 |
Nice investigation @lyneca, we've been wondering for a while when graphql would come to haunt us. |
Hey @lyneca if you're interested you could look at other requests they make from messenger.com. That would be an immense help and could be super fun. If we can understand their query language for messenger we can have a much more solid API. |
Yeah, I reckon supporting the graphql backend would be pretty awesome. One question, which method in your API allows you to send a cookied request? Once I know where that is I can do a lot more testing |
@lyneca sorry, never saw your question. |
@lyneca Hey I just commited https://github.com/Schmavery/facebook-chat-api/blob/9df16a7727edc080cb4974a8f888bfeddab0abc0/src/getThreadHistoryGraphQL.js which is our first graphql support. |
Oh awesome! Sorry, I completely forgot about that. I'll have a look when I have some time. |
The docs for
searchForThread
say that it can be used to search for "chat titles", but when I search for the name of one of my group chats, it returnsCould not find thread [name]
. Is the documentation old or am I just using it wrong?The text was updated successfully, but these errors were encountered: