Version: 1.0.0

Events

An event is useful to group users around an activity of your choice (a rendez-vous, a show, a meeting). Users have the choice to join it and can also discuss between each others.


Core concept

An event is a bit similar to pages, users can post inside, decide to join it or not, but differs in the fact that it is temporary.

Users have the choice to join an event, in fact they have three kind of possibilities, yes, no and maybe. Joining an event will push the event's contents as activities in the user's followed Stream and also allow them be a part of it and talk with the others members inside it.

Like we've said before, an event is a temporary entity, when creating it, you will choose a start_date and an end_date. You can also choose to limit the available places inside of it and even add tickets with a defined price.

Create an event

To create an event you have to make a HTTP POST request with parameters in JSON form. There are some required parameters for this operation:

  • name string: The event name
  • user_id integer: Relate to the user unique id.
  • start_date datetime: The start date of an event.
  • end_date datetime: The end date of an event.

You can also pass more data, please refer to Event creationAPI to see all the available fields.

You also can pass those parameters as form-data instead of JSON.

Make sure to give your ApiTokenAPI and ApiSecretAPI as header in the HTTP request

curl -X POST \
https://YOUR_PROJECT_DOMAIN.potion.social/public-api/v1/events \
-H 'Api-Key: YOUR_API_KEY' \
-H 'Api-Secret: YOUR_API_SECRET' \
-H 'Content-Type: application/json' \
-d '{
"name": "My first event",
"user_id": "MY_USER_ID",
"start_date": "2020-01-01T11:00:00.000Z",
"end_date": "2020-01-31T11:00:00.000Z"
}'

List events

You may want to display all your events, for example, list them for your users in order for them to join those of their choice. You can gather them with an HTTP GET request. Lets request the current and incoming events with the event_date filter

Some filtering parameters are available, like pagination, by owner, by date... please refer to Event's listingAPI for more informations.

curl -X GET \
https://YOUR_PROJECT_DOMAIN.potion.social/public-api/v1/events?event_date=current_and_coming \
-H 'Api-Key: YOUR_API_KEY' \
-H 'Api-Secret: YOUR_API_SECRET' \
-H 'Content-Type: application/json' \

Event list response

Events listing are represented in a way to make your pagination easy. You will have a total_items key to help you for your pagination and also to give you the total events informations. All your events are inside a items key. A typical events listing response will look like this :

{
"items":[
{
"id":"b76947f6ef7e428ba3a3a04c28bb0776",
"name":"My amazing event",
"slug":"my-amazing-event",
...
},
{
"id":"05557c4a501d4bec81754979ea36995c",
"name":"My Second Event",
"slug":"my-amazing-event",
...
}
],
"total_items":2
}