Facebook graph api Events and Venue Information, sometimes it only returns venue id when the event was created in a known venue - events

I'm creating an app in Titanium that uses the Facebook Graph API to get all the users events, however, the venue information, it only brought to me, after I was very specific about the field, and some times, a lot of the times, when the Event was created in a known location, it only brings the venue_id, and when I query the venue(via http://graph.facebook.com), then it gives me the venue location details, more importantly, the latitude and longitude of the thing.
Is it possible to bring the information of the venue in the same response?
Also, it only brings the events that the user is attending, is there any way to show the events recommended to him also?
Ti.Facebook.requestWithGraphPath('me/events?limit=5000&fields=id,owner,name,description,start_time,end_time,location,venue,privacy,updated_time', {}, 'GET', function(e) {
obj = JSON.parse(e.result);
Ti.API.info('Events: '+JSON.stringify(obj));
}}); // Facebook Events

Also, it only brings the events that the user is attending, is there any way to show the events recommended to him also?
Not sure what exactly you mean by “recommended” … if you mean events the user has been invited to, then you can query the FQL event_member table with the user id.
You can kind of “join” the info from the table above with the event table by selecting from that using WHERE eid IN (SELECT … FROM event_member WHERE …)
Is it possible to bring the information of the venue in the same response?
Using a multi-query you can do it, similar to as it is described here: FQL: query for event table returns venue.name instead of venue.id

Related

Google Reports API for Meet attendance - strange conference_id

I'm trying to query attendance for a Google Meet conference created via Google Calendars API.
I've found that the conferenceId returned by Calendar API > Events > insert it's different from the one I can use to filter in Reports API.
conferenceId from Calendar API --> ["conferenceId"]=>string(12) "xxx-xxxx-xxx"
conferenceId from Reports API{"name": "conference_id", "value": "xxxxxxx_12234XXXXXxxxxXX56"}
Does anyone knows why?
How can I query attendance based on the data returned by Calendar API > Events > insert ?
Steps to reprocuduce:
Insert calendar events (be sure to add conferenceData structure to create also the Meet conference):
https://developers.google.com/calendar/api/v3/reference/events/insert
Use the conference
List activities from Report API and check the conference_id: https://developers.google.com/admin-sdk/reports/reference/rest/v1/activities/list
It seems that the conferenceId from the Calendar event object is different from the conference_id in the Reports (note that the name is different). The activities.list output also has another field called meeting_code, it's also under items.events.parameters:
{
"name": "meeting_code",
"value": "ASDFASFFGJ"
}
This one matches the conferenceId in a calendar event, except that it's without dashes and capitalized, so for the example "conferenceId": "asd-fasf-fgj" in a Calendar Event object you'll find "meeting_code": "ASDFASFFGJ" in the activity reports. So you can just remove the dashes and capitalize the conferenceId to match it to its corresponding meeting_code.
As to why this discrepancy exists, my guess after reading the definition of the Meet activity events is that it tracks different "conference sessions" within the same meeting code. For example, if you join the meeting asd-fasf-fgj it will create a new conference_id until everyone leaves the meeting. Then if the same meeting code is used again a different conference_id will be created to track the new session and so on.
I did some cursory testing and the logs do create a different conference_id every time I joined the same Meeting code. I didn't have multiple accounts to test so I'm not sure if two users can have matching IDs, but I may be close. I couldn't find any in-depth documentation so it would require more testing to figure out exactly how it works.
Either way, to address your immediate concern, you should be able to match the Event's conferenceId with the Report's meeting_code to track the attendance.
Reference:
Meet Activity log definition

DynamoDB Event Scheduling Table Structure

I'm building out a scheduling app, where users can invite other users to events. However, I'm having a little trouble figuring out how I want to set up my tables.
Since DynamoDB is a NoSQL database we want to try to keep data that is related, in the same table. However, this problem gets a bit more confusing because some events for my app may have roles, such as organizer, planner, etc. Therefore, I want users for an event to be able to accept the invitation to the event with specific roles.
Therefore, in this case, would I want to use two tables, one that stores the event (UUID, Name, etc.) and the other that has the users attending events (UUID of Event, Username, etc.) or use one table?
Plus, when I create my get request to fetch the event data if I use two tables, would I have to query the user table to get the number of people attending that event or should I store that value in the event table, and then when a user signs up, add a new row to the users table, and update the number of people attending in the event table?
For the app I am using Lambda functions on AWS.
Any help would be appreciated, thanks!
You can have
userid as hash-key
eventid as range-key
role as LSI
You can also have a GSI on event-id to query based on eventid
sample table:
user1, event1, organizer
user2, event1, planner
user3, event1, attendee
user4, event1, attendee

Fetch Facebook Event using location

I am able to fetch user event but i require to fetch event using location wise like event in usa , uk , india.
How can fetch event location or b/w date range in Facebook
Way #1: Graph API using the event object From: http://developers.facebook.com/docs/reference/api/event/
When you call the graph API using https://graph.facebook.com/{EventId}?fields=location you should get back a location if it was specified by the event admin. You can then try to see if that location is in the area you're looking for. If not, then move onto the next one.
Way #2: Graph API using the event fql table From: http://developers.facebook.com/docs/reference/fql/event/
When you call the graph API using https://graph.facebook.com/fql?q=SELECT name, location FROM event WHERE eid={EventId} you will also get back the event and location. If you want to be tricky and get a listing of all events for an authenticated user, then you can do FQL such as SELECT name, location FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid=me())

What datastructure should i use storing and recording events?

I want to record events based on on a date. I also want people to be able to search for event based on a particular date and the person who recorded the event.
For example:
Person A logs in and sees a calendar, click on a day/date and records an event for that day.
Person B logs in and sees a calendar, click on a day/date and records an event for that day.
Person C comes and does the same thing.
Note that either of these persons can record more than one event.
I want to be able record this data effectively in the database and search for these events based on a number of different criteria.
Please can someone help me with a data structure for this problem?
Person
ID
Name
PersonalEvent
ID
Person
Name
Date

Facebook API get events CREATED BY friends

I am developing facebook app which needs to retrieve events created by some of my friends.
Standard SQL query would look like this:
NSString *fql1 = #"SELECT "
#"eid, name, tagline, id, pic_small,host, description, start_time, creator "
#"FROM "
#"event "
#"WHERE "
#"creator = 1111111111 OR creator = 2222222222 OR creator = 333333333";
Facebook allows only to filter tables by indexed fields (which is eid in this table). I assume I could to construct multiquery. Anyone could help with it? I spent some time googling it with no look. I need only one query so learning whole fbl for this has no sense for me at the moment.
BTW: there is a function events.get - you can filter by uid (documentation says):
parameter: uid - Filters by events associated with a
user with this uid.
ASSOCIATED In what sense? are those creator's uids?, invited, attending or maybe? Why facebook documentation is so frustrating?
When I try events.get with uid parameter it returns result with different creators ids than uid parameter.
Graph API function: uid/events returns events user has been invited to, attended or other status but NOT necessarily created by him.
What am I missing here? I granted necessary permissions to my application, it connects, gets friend's event lists but not the events I want.
Seems so simple but I con not find straight-forward solution.
I'd appreciate any help.
You can do something like this:
SELECT
eid, name, tagline, pic_small,host, description, start_time, creator
FROM
event
WHERE
eid IN (
SELECT
eid
FROM
event_member
WHERE
uid=111 OR uid=222) AND
(creator=111 OR creator=222)
Basically this says get the events user 111 or 222 is a member of and of those, only return the ones they've created. Because eid is an indexable field, FQL is okay with this, and is happy to do the additional (creator=111) trimming for you.

Resources