Facebook events ID's order. What rule is used to enumerate the id's of events? - facebook

I've created test event which has the address like this:
www dot facebook dot com/events/1485237735028137
What mean the digits at the end??
How are they generated when event is created?
For example in vk dot com social network events have order: 1,2,3,4,......
And what order in Facebook?

The number at the end is the Event ID, it uniquely identifies that event, but there's no other information you can infer from that ID directly - you need to retrieve the event details via the API to get more data

Related

Dialog Flow ( Api.ai ) Conversation in chatbot

I am having a welcome intent and it allows user to select three different actions. Ex: Welcome! you can print your firstname, you can print your lastname or you can print your zipcode. If User select or enter last name then it should call the last name intent. So we are providing multiple options at welcome intent itself and user can choose any one of them.
Based on the action selected by user, the conversation should occur.
Please help me how to achieve this.
You are giving the user the option of proceeding by providing their first name, their last name or their zip code.
To capture their response, you will need to create three intents:
Capture First Name
Capture Last Name
Capture Zip Code
For each intent, you would provide a series of example phrases showing how the user might express each thing. For example, "Capture First Name" might contain examples like:
"My first name is Dan"
"Dan"
"Dan is my first name"
I'd recommend providing around 10 examples for each intent.
Dialogflow provides a system entity for zip codes, so it will be able to automatically extract the zip code from the "Capture Zip Code" intent.
However, to make the first and last name intents work, you'll need to create entities to represent the first and last names of all your users. Assuming you know these values ahead of time, you should first create each entity and then write a script to populate it from your datastore using the Dialogflow API's /entities endpoint.
Once you've created and populated these entities, add some examples that make use of them to your intents. Ensure that you highlight and annotate any entity values that are not automatically identified.
When your intents are complete, you can use Dialogflow's fulfillment to send the information they capture to your back-end.
Normally when the welcome intent triggered it will send a request to your backend through webhook,from backend you can send responses as templates or buttons and user can choose one of them ,if you are using backend here
Else in welcome intent response,use a response like you can print firstname ,you can print second name and configure intents for those and use contexts for proper flow.
In the second intent,keep one entity containing some values for first name and use a output context like frstname_output_context
In the another intent,keep one entity containing some values for last name as entity and use a output context like lsttname_output_context
Hope it clarifies using webhook and without webhook.

where find clientid from console

I need to send some mails my users.
I will send it from console, so I have not any user's cookies.
And to track opening mails I insert img in letter body like this:
<img src="https://www.google-analytics.com/collect?v=1&tid={{UA}}&cid={{CID}}&uid={{UID}}..." alt="" />
How can I replace {{CID}} ?
Where should I find it?
Thanks
If you want this hit to be connected to an existing user from your website you would need to record the client id when a user signs up for your emails, maintain a database that maps the recorded id to the e-mail address and the actual substitution would depend on your mail script. Since in this case the clientid is created in your users browser the only possible source would be the cookie.
If you just want to record a hit (without connecting it to existing users) then, as DalmTo pointed out, just use a random unique id.
If you do not have a client id, but have a way to identify the user on your website then you could also try the UserId feature and session unification. In this case you would use a random client id and append your known user id as parameter.
You should refer to the measurement protocol documentation
Protocol Version v v=1 The protocol version. The value should be 1.
Tracking ID tid tid=UA-123456-1 The ID that distinguishes to which Google Analytics property to send data.
Client ID cid cid=xxxxx An ID unique to a particular user.
Hit Type t t=pageview The type of interaction collected for a particular user.
this may also help Email Tracking - Measurement Protocol
How can I replace {{CID}} ? Where should I find it?
It should be a unique number identifying this user, its basically used for session control. Random Guid works.

Facebook API – Graph Search - get number of event attendees

I use Facebook API Graph Search to explore queries such as:
https://graph.facebook.com/search?q=conference&fields=name,description&type=event
I need to get a list of events by a defined query (without code, SDKs, only url, it’s important for me) with number of attendees for all of events, but this information isn’t as fields, it’s the node of an event. A list of attendees of particular event can be returned with this url:
https://graph.facebook.com/331218348435/attending
Is there any solution to get number of attending. For all events with one url? I mean the same way like fields?
Can I create more specific, complex query within url? FQL is deprecated.
EDIT:
I need this statistics of all events in one call, not for single event.
Use this call: /331218348435?fields=attending.limit(1).summary(true)
With "summary(true)", you will get a "summary" in the result:
"summary": {
"count": 1458
}
If you want to get the attendees count of several Events at once, you can use Batch Requests with up to 50 API calls in one batch: https://developers.facebook.com/docs/graph-api/making-multiple-requests

What is the correct REST endpoint for adding an item to an array field?

Say I'm trying to model the action of adding a Student to a Group in a RESTful API written in Go with MongoDB.
A Group is modeled like this:
type Group struct {
Section mgo.DBRef
Instructor mgo.DBRef
Students []mgo.DBRef
}
An additional constraint is that the API is implementing HAL+JSON protocol, where resources are represented as links.
I've seen a couple of options (below):
POST /groups/{groupID}/students/{studentID} will add student with studentID to the group. The problem with this approach is that since I'm implementing the HAL+JSON protocol, I don't want the client to have manually pull out the ID and generate this link. All resources will be represented, i.e. /person/123 could be a Student.
PUT /groups/{groupID} while sending the complete array of Students that should belong to the group. This seems like it will introduce a lot of complicated parsing logic.
If there are other options I'd be open to it too.
EDIT: The approach that I'm going with is the following:
* POST /groupmembership/ by sending a JSON with the ID of the student and the ID of the group to add the student to. However, on the backend, I'm not generating a new model, but instead taking the object and programmatically adding the specified student to the specified group.
The question then is how would I remove the Student from the Group? Can I similar send a DELETE request to /groupmembership with
{
"student": 123,
"group": 456
}
to remove student 123 from group 456?
where resources are represented as links
This is not true. Links are possibly operations calls, so they are representing possible resource state transitions.
To add something to a collection, you need a collection resource and you have to decide what you want to store in that collection. In your case this can be 2 things: group-student memberships or students. If this is an 1:n relation, then you can store students and remove students. If this is an n:m relation then you have to store memberships and remove memberships, since you don't want to remove the students from your storage, just the memberships.
You can identify the memberships 2 ways:
you can use the ids of the participants: /groups/1/memberships/student:1 or /students/1/memberships/group:1
you can add a unique id to each membership: /memberships/1234
notes:
The URI structure matters only from a human perspective. The REST client will check the link relations and not the URI structure.
The resources are different from the entities in your database. Only by simple CRUD application represent them the same thing. So REST has nothing to do with your database structure.
First of all, there's no correct REST endpoint. URL semantics are irrelevant to REST. All that matters is that URLs are obtained from hypertext and not from out-of-band information, and seems like you got that part right, since you're using HAL. So, the correct REST endpoint is whatever link your server gives to the clients in order to add the item.
As long as an option isn't incorrect from an HTTP standpoint, I'd say to stick with whatever is more consistent with the REST of your API.
The option to POST /groups/{groupID}/students/{studentID} in order to create a new student in that location is incorrect, since a POST is submitting the payload to be processed by the targeted resource, and in this case it doesn't exist yet. A common pattern is to use POST /groups/{groupID}/students, where the collection acts as a facory for new elements, with the creation parameters in the payload, and returning the created student URL in the Location header, with 201 HTTP status code.

how to query a set of random entries tastypie

I have events module .my user favroite some of random events from listing . i will store them in favroite table of my database
id module
1 events
5 events
9 events
2 business
now , my question how can i make a query to fetch 1,5,9 at single request for event ? is there any way to request it
Yes, you can filter by id to get multiple events in one request, look at the selected answer to this question to learn how to do that. Should work out of the box.