Cant find the way to display friends, who achieve it, on achievement page.
/USER_ID/achievements - returns users achievements
/FRIEND_ID/achievements - returns one of my friend achievements
/APP_ID/achievements - returns list of defines
Help me please! Do I need to do many requests for each my friend (I think it is not good way)?
Yes, you need to retrieve the friends' achievements individually.
You can call /achievements?ids=[CSV_LIST_OF_FRIENDS] though - and calling /[USER]/friends?fields=installed will show you which friends have the app installed to help you limit the number of IDs you need to include in the CSV list in the first query.
Related
As you know, with Facebook Graph API v2.0 upgrade you no longer can retrieve all the friends using the "me/friends" endpoint. That endpoint will now return only those friends who are also registered for the same app (app-scoped users). To retrieve all the friends, Facebook provided a new API (taggable friends) at endpoint "me/taggable_friends".
The problem I am having is that taggable friends list is a super set of the friends list and there is no reliable way to exclude the latter from the former. Thus the users from the "me/friends" list will also appear under the users from "me/taggable_friends" list.
For example, let's say I have total of 2 different friends on Facebook and both of them are called "Joe Hammer". Let's further imagine that only one of them is also using the app that I am using. The app allows users to tag friends on Facebook. For this there is a drop-down that shows all the friends that a user can tag. Previously it would show both "Joe Hammers" in the list as "me/friends" API would return all the friends. Now there has to be two separate lists, one to show the friends that are already using the app ("me/friends" result, or app-scoped users), and a second list, to invite the ones who are not using the app yet ("me/taggable_friends" result). However, on the page the first list will correctly show only one user "Joe Hammer" that is registered with the app. But the second list will show both Joe Hammers, as technically they are both taggable. Since the result set returned from "me/taggable_friends" is using encrypted temporary user IDs there is no way for me to filter out the users from the taggable friends list who are already on the "registered" friends list. As you can imagine this makes the UI look a bit ugly with duplicate users showing up on both lists.
One may argue that this is not a common case and you can filter by a user name, as so far that is the only field that is common between the nodes of both lists. However, this scenario is not uncommon. I would say at least 5% of users would have two or more friends with the same name.
The only way i can think of (and i assume that was your intention too) is to read friends with /me/taggable_friends and /me/friends and compare them by name. Those who are not in the result of /me/friends donĀ“t use the App, obviously.
But keep in mind that you are only supposed to use taggable_friends for tagging friends and nothing else. So it would actually not make much sense to filter them, the user should decide which friends he would like to tag, no matter if they are already using the App or not.
I am currently trying two methods of web service API (Moodle 2.6) to call with REST:
1 core_course_get_categories
2 core_course_create_courses
With both I have the following problems:
1
The function returns me categories back but unfortunately no subcategories. Even if I add like the documentation says the parameter "addsubcategories = 1", only the top-level Categories are sent back. An idea what the issue could be?
2
The course creation works so far, but I would like to assign the instructor to a specific user. Now when I create a course, it is indeed created under the users with the WS-rights. Is there a possibility to change the instructor?
Short background:
We have a central system where teachers can save new course information. Here should you have the opportunity to create a Moodle course immediately. We have in both systems a unique identifier of the user that should become the instructor. Of course, must be prior to the course, the Category / Subcategory be selected.
I would be happy about feedback!
This is a very late answer however I think it might be a valid solution to the first issue above and hopefully will help someone with similar issues.
A webservice user with the permission moodle/category:manage will be able to see all categories, hidden or visible as well as all levels of categories.
However there is no mention of this restriction in the Moodle API docs (that I could find at least).
Hope that helps anyone with this issue in the future.
Regards
Maybe this isn't the correct place to ask, but I asked this question on Joomla forums and did not get any answers. If someone can help me or at least point me in the right direction, I would really appreciate.
My question is: In a Joomla 2.5 website, I want to create two different kinds of forms for registering users. Maybe "registering" isn't the correct term. I want to create something like a very simple database which will hold records for two kinds of users:
- one which will be interested in working in projects, so in this case the form will have more fields and specific details to fill
- one which will be interested only in receiving newsletters from the site, and in this case only basic contact information will be required.
I did some research and found an extension named AcyMailing which can handle the newsletters for example, but I need to have all my potential users registered as Joomla users. I would like to avoid that if possible. If not, how can I differentiate the two kinds of users on registration, so the visitor can choose which option he wants and in this case, add more information to the registering process, if possible.
I'm not very experienced with Joomla, but since the site in question is already implemented using it, I don't have much choice.
Thanks in advance!
Chronoforms. Most definitely here would be a great use for their AWESOME free component. Your forms can work as registration forms (should you desire that); or can also just be free standing forms that log the information filled out on them to your database which you can later use however you would like (i.e. compiling a mailing list or something of that sort).
The form wizard makes it almost bullet proof, then you can have a form for 1 type of user to fill out, and a form for a different user build different ways.
That will get you the data - in order to mass mail those people you'll need a way to extract their emails out of the database (or find an email component that will let you email based on certain fields in the database or what have you); but it's totally possible and would be easily done I think with 1 simple mySQL query on your database table created by chronoforms.
In terms of something that will solve your issue quickly and get you the info you're looking for in two separate ways - chronoforms will do that exactly.
The graph Api gives me the user's friends.
But I want to know who its close friends are (SmartLists).
How can I do that using the Graph API?
You can call /me/friendlists to get the friends list. One of them should be close friends. Then go to /closeFriendsListId/members to see who is on that list. You will need read_friendlists extended permissions.
I recently saw a simpler way. /me/friendlists/close_friends?fields=members will give you the list of all members at one shot. Just wanted to put it out here in case if somebody needs help.
Similarly, call to /me/friendlists/family?fields=members will give family members.
P.S: "close_friends" and "family" are keywords and no need for a ID.
This is no longer possible. Facebook removed the ability to see the members of a friend list somewhere before version 2.5 of their API.
is there a way with the Graph API or even the old API to get the number of friends (not the list of names, just the count) of each friend of my user?
so if John is using my app and John has 3 friends, Stacy , Amy and Bill, I would like to know how many friends Stacy, Amy and Bill have..
I know you can't get the list of friends (only the ones in common), I just want the count.
I don't think the count is private. In fact, even for people who block their friend list, I get a count of how many friends they have on the original email I get when they friend me., right under their name.
Graph API and FQL don't provide this information. It is publicly available without being logged in on alot of users pages by going to https://www.facebook.com/profile.php?id=5 and then scraping it. Although its against the terms of service and isn't available for every user.
You can get this information from the Graph API by issuing a request to the /PROFILE_ID/friends endpoint. This will return a list of the user's friends as an array-- which you can count.