How to use Facebook API's "folder" and "tag" parameters when reading a page's mailbox? - facebook

I'm trying to read my test page's mailbox using the /conversations edge.
What I want is getting conversations related to a specific folder but whenever I try something like /page-id/conversations?folders=done I get the same results as /page-id/conversations. The same goes whenever I try the 'tags' parameter.
And once I move a conversation to another folder like the 'done' using
the Facebook website, it disappears from the results of /page-id/conversations
Anyways, besides the 'folder' thing, is there a way to get a conversation's "label" and "notes" specified by the page's admin?
And it seems that the messages' tags are not affected by the folder they reside in. So even after I move a conversation to the "done" folder, its messages still have the "inbox" tag associated with them. Am I missing something obvious here?
P.S. Solution suggested at How to query conversations by folder via Graph Api? didn't work for me.

You're very close to solution. Instead of folders=done, try folder=page_done with Page access token.
{page-id}/conversations?folder=page_done

Related

Using m.me links with ref param

I'm trying to deeplink users into my facebook messenger bot, and I need to pass some data in at the same time. Supposedly this can be done by using m.me links, along with a query param.
My bot's page is https://www.facebook.com/Willy-1610141399078870/
The m.me url would be something like this. https://m.me/Willy-1610141399078870?ref=somedatagoeshere
The m.me link works to a degree on desktop, but the data isn't passed to the bot. I don't particularly need it to work on desktop.
However, when I try to open that link on ios or android, I get an error message.
Android
This user name doesn't exist. Try another code or link
iOS
Username was not found
The bot hasn't been published yet, so it won't be visible to anyone else. I need to be able to test this functionality before I publish, so I hope that's not what is causing the failure.
Has anyone else been able to use this feature?
It seems that the facebook-generated username can't be used for m.me links. It requires you to register an explicit username.
My page's generated name was Willy-1610141399078870, so https://m.me/Willy-1610141399078870 wasn't a valid url.
To register a username for your page, go to your page > About > Create Page #username.
Then, you can attempt to pick a username that isn't already taken. Somehow, #willy-the-test-page is already taken (?), so I got this incredibly confusing error message:
Taking the error message at face value, I decided to create another page and try again. This time, realizing that the message didn't mean what it said. Picking an available username clears the error message, and allows registration.
Just kidding! It will tell you again that the page isn't eligible.
The solution was to create a totally new page, and go through the #username creation flow again. It worked for me on the second attempt.
It's rumored that a page needs at least 25 likes to become eligible for an #username, but this isn't true in all cases.

Getting a SoundCloud API client ID

Encountered a problem accessing my tracks from browser.
Usually i type this link in my browser to access downloadable tracks:
http://api.soundcloud.com/tracks/294324164/download?client_id=02gUJC0hH2ct1EGOcYXQIzRFU91c72Ea
But now i can not access it anymore, probably the client id is changed.
How can i obtain a new client id?
Thanks.
Simple.. Go to any tracks that you can download on soundcloud, press f12 and look at networks tab, click download and it will show you something like
https://api.soundcloud.com/tracks/322109493/download?client_id=2t9loNQH90kzJcsFCODdigxfp325aq4z&oauth_token=2-274121-85658-y9KQYyZ6qG9oT2uvPq
Grab that client_id, replace it and amend the url from download? to stream?.. use streams? if you want a list of urls in json format
http://api.soundcloud.com/tracks/294324164/stream?client_id=2t9loNQH90kzJcsFCODdigxfp325aq4z
As no one else has mentioned it, in a Chrome-based browser under DevTools ctrl+shift+i, you can grab your client_id from the Network tab on reload. Many items listed here reference the SoundCloud API and require your client_id to access it. Simply click any item in the list that isn't an image/base64 item (preferably something that begins with id?...), then check the Request URL for a client_id.
It's the simplest way to grab the ID; now that you know how, don't do anything illegal k thx.
For those thinking this is the same as the other answer mentioning a download link, this method skips that entirely as many songs are no longer available from SoundCloud itself, but from external sources that are linked instead.
Amazing it's been this long, yet there's no "public" Soundcloud API. I'm amazed to find something worse off than the Twitch API.
See this user's solution for a way to do this without a CLIENT ID which you can no longer get from soundcloud: https://stackoverflow.com/a/27461646/179571
youtube-dl https://soundcloud.com/my-fav-artist
seems to work and pull all tracks as mp3
no client_id needed, if you needed the client_id to get something
like soundcloud-dl to work
You can apply for a client ID by filling in the SoundCloud Application Registration form.

Tag users in Facebook post without using drop down

I manage a large Facebook group and once a year we need to delete a big chunk of users. I have already generated a list of these user names and their Facebook IDs, but now I want to copy-paste these IDs into a Facebook post and have the users be automatically be tagged - I don't want to go through the drop down menu that appears when you type #. (This way I can say "If your name is on this list, you will be removed" and know that the users will be tagged by facebook and will receive a notification.)
I have tried various things like #[user-id] in my post but nothing seems to work. I followed an old article suggesting something like ##[user-id:0:text] would work, but Facebook apparently patched this.
Can anybody help me figure out if it is possible to copy-paste a list of names (or ID's, or a combination with the # symbol and any other formatting) and have those names be automatically tagged in the Facebook post? I really want to avoid typing the first few characters, pressing TAB to complete and tag the name, and repeating hundreds of times.
Thanks.
Edit: Tried doing this more recently and the issue still exists. I know you can press ESC to drop out of the name popup but that doesn't work when trying to do this programmatically.
Having problems with tagging a photo when FB offers you a drop-down list of potential names? Here is the solution. Continue writing the name you have in mind. Instead of pressing RETURN right away, press ESC. The drop-down list of suggestions should disappear. Now you can press RETURN.

How to find Facebook group id by name

I have a Facebook application, which I would like to be able to read facebook group feeds.
I have a user-input feed url, that looks like this: http://www.facebook.com/groups/music.sharing/
To access the feed though, I can only use its id, like this: http://graph.facebook.com/[id of group]/feed
I cannot find anything for that in the reference, FQL doesn't allow querying by name so .. I'm stuck. Any ideas ?
Thanks!
Its not possible right now, there are multiple open "bugs" and another stating the issue...
All the ways I have tried have failed... e.g. (below would work for pages)
fql?q=select id from profile where username='music.sharing'
We are facing this same problem on our current project. It is not an elegant solution that uses the API, but for now we will be using a workaround by scraping the HTML of the group landing page. The group ID number appears four times on this page in the html via links. The most reliable way to search for the ID is to search for "cid=" as it only appears once (right now, anyway) on the page (what follows cid= is the numerical ID). You'll see what I mean when you examine the html of a group page.
If you found a more efficient solution, I'd be grateful if you shared :)
A possible alternative until bug resolution could be: if you are asking your users for permissions then you can ask for the additional permission, user_groups, and then query graph api http://graph.facebook.com/[id of user]/groups. The returned data has group name, id, version, bookmark_order.

Facebook Send Dialog fails to send links to Facebook itself -- why?

I'm trying to use Facebook Send Dialog in a WinForms frame with a browser control and direct URI (you can repro just by clicking the links below). It works fine with link=http://www.foo.com, sending the message properly if you enter a message and click "Send":
http://www.facebook.com/dialog/send?app_id=179873125388138&link=http://www.foo.com&redirect_uri=http://jonnewman.com/&display=popup&to=100002395463043
However, this fails with link=http://www.facebook.com or any path under it. Clicking "Send" just gets you "Sorry, something went wrong. We're working on getting this fixed as soon as we can.":
http://www.facebook.com/dialog/send?app_id=179873125388138&link=http://www.facebook.com&redirect_uri=http://jonnewman.com/&display=popup&to=100002395463043
The aim is to write a script to make it easier to send messages asking all users in a particular group to a page (prepopulating the recipient list). Since Facebook has restricted groups larger than 500 members, our organization has to move to a Facebook Page, and I want the Send Dialog to link the new Facebook Page. Why won't this work? Is there a workaround? Are there other criteria for what links Send Dialog will and won't send?
Also, is there a way I can determine whether the send occurred or not, for example an event to catch? Whether you send or cancel, the Navigated event is still redirect_uri/#_=_.
Once I have Send Dialog working, I will add Show-FBSendDialog to Facebook PowerShell Module, which already has numerous capabilities to automate Facebook from PowerShell.
ran some tests and it seems it is blocking any fb domain http://on.fb.me/91S2P8, sometimes this is temporary otherwise need to rethink...
I see your second link isn't working... but if you add your company page id or name to link it should work. following link works for me:
https://www.facebook.com/dialog/send?app_id=179873125388138&link=http://www.facebook.com/Intel&redirect_uri=http%3A%2F%2Fjonnewman.com%2F&display=popup&to=100002395463043
hope this helps
I got solution. I also had same problem. No post helped me. Solving error for 2 days.
There were posibility of two mistakes(that was done by me).
Link Parameter given in url should be working. I have linked to api namespace but not given SSL url. So it was giving problem. You can given your web site address.
And redirect_uri parameter should be working. Try to give redirect_uri to same page most probably.