wikical REST API
event
create
Use this endpoint to create new events. Events are attributed to the user being logged-in. Only authenticated users may create events. The same validation rules apply as for the web-version. Validation errors result to `400 Bad Request` with the field errors in response body. Successful event creation results to `201 Created` with new event data in response body.
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
title required | The main title of the event |
startdate required | Use ISO format e.g. 2004-08-13 |
enddate | ISO format e.g. 2004-08-29 or leave blank |
starttime | e.g. 18:00 or leave blank |
endtime | e.g. 22:00 or leave blank |
tag_list | space or comma separate list of tags names |
description | A text field with an event description which is plain text by default or rst if the `.. rst` identifier is used (see event edit view) |
venue | Enter the name of the venue hosting the event. |
locality | Enter the geoname id of a city (e.g. `2950159` for Berlin), or a city name followed by country e.g. `Berlin,DE' |
coordinates | use `latitude longitude` e.g. `52.52 13.04`. Positive numbers for North latitudes / East longitudes |
urls_list | Specify event external urls as a JSON string. For each url specify values for `url_name` and `url`. Example of a single url: `{"url_name": "main", "url": "http://example.com"}` To specify many urls, use a list:`[{"url_name": "main", "url": "http://example.com"}, {"url_name": "linux", "url": "http://linux.com"}]` |
dates_list | Specify event special dates as a json string. For each special date specify values for `eventdate_name` and `eventdate_date`. Example of a single special date: `{"eventdate_name": "deadline", "eventdate_date": "2015-01-01"}` To specify many special dates, use a list: `[{"eventdate_name": "deadline", "eventdate_date": "2015-01-01"}, {"eventdate_name": "proceedings", "eventdate_date": "2015-05-01"}]` |
sessions_list | Specify event special dates as a JSON string. For each special session specify values for `session_name`, `session_date`, `session_starttime` and `session_endtime`. Same rules apply as in dates list. |
file | An image file containing an event cover picture. Optional. You may use it only if posting Multipart HTML form data (not available e.g. when posting json). |
crop_ratio | Use it in conjuction with "file" field. Default value is 0.5. Specifies the square crop to be applied in the initial image. 0 -> top-left, 0.5 -> center, 1.0 bottom-right. |
picture_license | Licensing conditions including copyright attribution to authors of the event cover picture |
recurrences_action | When updating events that are part of recurrences, you need to specify whenever changes are applied only to the current event, future, past, or all recurred events. You may leave this field empty for non-recurring events, for new events (create) has also no effect, for recurring events is should have one of these values: ['past', 'all', 'this', 'future'] |
key | Specify a `key` so emails are sent to you when you create new events, useful to get automated notifications with newly created events, or errors. `key` is used to group and summary messages in emails, and for example you may use a key for each of your scripts |
read
Get data for the event specified with its `id` number.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
update
Similar to create, used to update data of an existing event for a given `id` number. Uses `PUT` Http method, thus, all existing data of an event should be specified or else fields are reset. e.g. for an existing event having some description, if a PUT request with no description, then event description is reset. Other conditions of create (POST) apply, i.e. only authenticated users can update. To update specific fields use a `partial_update` /` PATCH` Http method. Only for authenticated users.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
title required | The main title of the event |
startdate required | Use ISO format e.g. 2004-08-13 |
enddate | ISO format e.g. 2004-08-29 or leave blank |
starttime | e.g. 18:00 or leave blank |
endtime | e.g. 22:00 or leave blank |
tag_list | space or comma separate list of tags names |
description | A text field with an event description which is plain text by default or rst if the `.. rst` identifier is used (see event edit view) |
venue | Enter the name of the venue hosting the event. |
locality | Enter the geoname id of a city (e.g. `2950159` for Berlin), or a city name followed by country e.g. `Berlin,DE' |
coordinates | use `latitude longitude` e.g. `52.52 13.04`. Positive numbers for North latitudes / East longitudes |
urls_list | Specify event external urls as a JSON string. For each url specify values for `url_name` and `url`. Example of a single url: `{"url_name": "main", "url": "http://example.com"}` To specify many urls, use a list:`[{"url_name": "main", "url": "http://example.com"}, {"url_name": "linux", "url": "http://linux.com"}]` |
dates_list | Specify event special dates as a json string. For each special date specify values for `eventdate_name` and `eventdate_date`. Example of a single special date: `{"eventdate_name": "deadline", "eventdate_date": "2015-01-01"}` To specify many special dates, use a list: `[{"eventdate_name": "deadline", "eventdate_date": "2015-01-01"}, {"eventdate_name": "proceedings", "eventdate_date": "2015-05-01"}]` |
sessions_list | Specify event special dates as a JSON string. For each special session specify values for `session_name`, `session_date`, `session_starttime` and `session_endtime`. Same rules apply as in dates list. |
file | An image file containing an event cover picture. Optional. You may use it only if posting Multipart HTML form data (not available e.g. when posting json). |
crop_ratio | Use it in conjuction with "file" field. Default value is 0.5. Specifies the square crop to be applied in the initial image. 0 -> top-left, 0.5 -> center, 1.0 bottom-right. |
picture_license | Licensing conditions including copyright attribution to authors of the event cover picture |
recurrences_action | When updating events that are part of recurrences, you need to specify whenever changes are applied only to the current event, future, past, or all recurred events. You may leave this field empty for non-recurring events, for new events (create) has also no effect, for recurring events is should have one of these values: ['past', 'all', 'this', 'future'] |
key | Specify a `key` so emails are sent to you when you create new events, useful to get automated notifications with newly created events, or errors. `key` is used to group and summary messages in emails, and for example you may use a key for each of your scripts |
partial_update
Similar to `update`, uses a `PATCH` Http method to partial update specific event fields. Notice that currently the only way to delete related models like event urls, event sessions or event dates is to use the `PUT` / `update` endpoint.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
title | The main title of the event |
startdate | Use ISO format e.g. 2004-08-13 |
enddate | ISO format e.g. 2004-08-29 or leave blank |
starttime | e.g. 18:00 or leave blank |
endtime | e.g. 22:00 or leave blank |
tag_list | space or comma separate list of tags names |
description | A text field with an event description which is plain text by default or rst if the `.. rst` identifier is used (see event edit view) |
venue | Enter the name of the venue hosting the event. |
locality | Enter the geoname id of a city (e.g. `2950159` for Berlin), or a city name followed by country e.g. `Berlin,DE' |
coordinates | use `latitude longitude` e.g. `52.52 13.04`. Positive numbers for North latitudes / East longitudes |
urls_list | Specify event external urls as a JSON string. For each url specify values for `url_name` and `url`. Example of a single url: `{"url_name": "main", "url": "http://example.com"}` To specify many urls, use a list:`[{"url_name": "main", "url": "http://example.com"}, {"url_name": "linux", "url": "http://linux.com"}]` |
dates_list | Specify event special dates as a json string. For each special date specify values for `eventdate_name` and `eventdate_date`. Example of a single special date: `{"eventdate_name": "deadline", "eventdate_date": "2015-01-01"}` To specify many special dates, use a list: `[{"eventdate_name": "deadline", "eventdate_date": "2015-01-01"}, {"eventdate_name": "proceedings", "eventdate_date": "2015-05-01"}]` |
sessions_list | Specify event special dates as a JSON string. For each special session specify values for `session_name`, `session_date`, `session_starttime` and `session_endtime`. Same rules apply as in dates list. |
file | An image file containing an event cover picture. Optional. You may use it only if posting Multipart HTML form data (not available e.g. when posting json). |
crop_ratio | Use it in conjuction with "file" field. Default value is 0.5. Specifies the square crop to be applied in the initial image. 0 -> top-left, 0.5 -> center, 1.0 bottom-right. |
picture_license | Licensing conditions including copyright attribution to authors of the event cover picture |
recurrences_action | When updating events that are part of recurrences, you need to specify whenever changes are applied only to the current event, future, past, or all recurred events. You may leave this field empty for non-recurring events, for new events (create) has also no effect, for recurring events is should have one of these values: ['past', 'all', 'this', 'future'] |
key | Specify a `key` so emails are sent to you when you create new events, useful to get automated notifications with newly created events, or errors. `key` is used to group and summary messages in emails, and for example you may use a key for each of your scripts |
delete
Deletes the event for a given `id` number. Uses `DELETE` Http method. On successful processing 200 OK is return with a status payload. Only users with authentication can delete events. **NOTE** There is some bug in automatic documentation generation which is under investigation but not yet solved. This bug may come from Django Rest Frameword library, in that case a future update of libraries should solve the problem. It prevents automatic documentation generation for some fields that you should include in request body for this endpoint, also the interactive tool for this endpoint is dysfunctional for the same reason. These fields are the following... * `reason` - This is a required field (string). It is a deletion argument. Share why you want the event deleted. * `redirect` - This is an optional field (integer). It represents an event id that users may be redirected if they try to reach the deleted event. * `recurrences_action` - If event is part of some recurrences, it should be specified. Refer to update documentation for more details on the usage.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
cover_pictures > list
Returns a list of cover pictures for a list of event ids. Returns a list cover pictures for a list of event ids, specified in the query param: `event_ids` e.g. `?event_ids=1,2,3`. You may optional specify the image size using the `size` query param and / or a `nocrop` param to get the original, not the trimmed version of the images. There is a list of predefined sizes for images, if the requested `size` is not from this list, then the nearest size is return. Available image sizes:: 80,140,160,180,280,350,360,560,640,700,1280
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
event_ids required | The ids for events queried for cover pictures |
size | The nominal size of images in pixels |
nocrop | If specified, it returns pictures in the original aspect ratio |
group > add_single
If used without `force_add` or `force_remove` options, it will add or remove the event with `event_id` to group with `group_id`, depending if the event is or is not already in that group. Successive calls to this API endpoint for the same event and group, will add and remove event to the group. This endpoint is useful for UI to for adding / removing single event to group operations, it is used in wikical.com in events cards views to add and remove event to groups using the little icons.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
group_id required | The group id to add or remove the event to |
force_add | With this option, the event will added to group, or if event already in group no action will be taken |
force_remove | With this option, the event will be removed from group, or if event not in group, then no action will be taken |
groups > read
Returns the list of groups, in which the signed-in user is a member. Returns the list of groups, in which the signed-in user is a member, and which have the event. Set the event id in `pk` url placeholder. Groups are ordered by priority set by user. Returns a list of all event groups if user is not signed in, or if query parameter `all_groups` is specified. List are under `items` key, pagination applies, a `pagination` key provides links to paginate to previous / next page.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
all_groups | Optional. For signed-in users, displays all groups event is added to. For non-signed-in users, this parameter has no effect. |
groups > add_many
Set groups that an event belongs to. User should be member of the groups added / removed. On successful processing, a resulting message is return with the actions taken. Also two objects: `groups_added`, and `groups_removed`, where keys are event ids and values lists of groups ids, of groups added or removed from the event(s) respectively. events are the event and possible recurrences. If event is part of recurred events, then you need to specify if add / remove actions will take place only to the specified event (`this`) or also to `all`, or `past`, or `future` events. If event is part of recurrences and `choice_for_recurrences` is not specified, then error is raised. Endpoint works like this: If specified group ids that event(s) already is added, then no new action is taken. If the list of specified group ids differs from the list of groups event already belongs, then some groups are removed and some are added to event(s) to match the list of specified group ids.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
group_ids | The group ids to set the event to. Only existing group ids and only when user is member of these groups will be added to the event. Endpoint will not raise error for non-existing group ids, or for groups user is not member to. When no group ids specified, event is removed from all groups and no groups added. In general if group is already added to some groups, and groups are not specified in `group_ids`, then event is removed from non-specified groups.Group ids should be integer numbers separated by comma character. |
choice_for_recurrences | When event has recurrences, this field should be specified, in order to apply changes only to `this` event, to `past`, `future` or to `all` recurrences |
picture > create_picture
Use this endpoint to add pictures to events. Picture are attributed to the logged-in user. Only authenticated users may add pictures. The same validation rules apply as for the web-version. Validation errors result to `400 Bad Request` with the field errors in response body. Successful event creation results to `201 Created` with new picture data in response body.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
title | Image title, optional, if not specified event title is used |
as_cover | Image for event cover, default is True |
file | An image file containing an event cover picture. Optional. You may use it only if posting Multipart HTML form data (not available e.g. when posting json). |
license | Licensing conditions including copyright attribution to authors of the event picture |
crop_ratio | Use it in conjuction with "file" field. Default value is 0.5. Specifies the squar crop to be applied in the initial image. 0 -> top-left, 0.5 -> center, 1.0 bottom-right. |
recurrences > read
Get the list of recurred events of the event with `id`. List is ordered by date, first event in the list is the master event of the recurrences. For each item the event id is return as `event_id` and the start date as `evetdate_date`.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
recurrences > update
Set recurrences for an event. Same rules apply as by using the set recurrences forms in web. Provide a dates list, and automatically events are created and/or deleted if needed so recurrences start date match the date list. CAUTION should be exercised, since method can destructively delete events. Returns the list of recurrences with dates (as `eventdate_date` attribute) and event ids respectively (as `event_id`). Only for authenticated users.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
dates_list required | A comma separated list of dates as ISO date string e.g. "2018-05-01,2018-06-01" |
clone_groups | Recurrences are added to the same groups as the base event. |
events
list_user
Lists events user with `username` has created. Data is paginated, links are provided to get next and / or previous page, using `cursor` get param. Actual groups are under `items` key.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
username required |
authenticated > user > list
Lists events autenticated user has created. Data is paginated, links are provided to get next and / or previous page, using `cursor` get param. Actual groups are under `items` key.
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
cursor | The pagination cursor value. |
groups > list
List from user groups where events for a list of event ids belong to. List from user groups where events for a list of event ids belong to, specified in the query param: `event_ids` e.g. `?event_ids=1,2,3`. Response contains two lists. First list "events_groups", contains as keys each of the event id and as values a list of group ids, event belongs to. Second list "user_groups", is a list of user groups, ordered by priority, in order to be able to lookup event groups from the fist list. This endpoint is useful to allow to display groups for each event, like in wikical search views.
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
event_ids required | The ids for events queried for groups |
user_feed > list
User feed is the list of events that appears on authenticated user home page. Only authenticated users can call this endpoint. Events list is contained in `items` key and it is ordered the same way as in user home page.
groups
list_user
Displays memberships to groups of user with `username`.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
username required |
membership > list
Displays logged-in user memberships to groups. Priority of membership is an integer number used to (custom) sort group memberships. Memberships with lower priority numbers are displayed first in lists, icons collection etc. Wikical users have two default memberships to groups, the group called "attending" and group called "starred". Those two groups have priorities of -2, -1 and cannot be altered. For other non-default groups, lowest value of priority (higher priority) is literal one (1). Data is paginated, links are provided to get next and / or previous page, using `cursor` get param. Actual groups are under `items` key.
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
cursor | The pagination cursor value. |
membership > change > priority > update
Changes the priority of logged-in user membership to the group with `pk` id. use `raise_lower` parameter to control the priority of the given group. On successful processing, group modified data is return.
Path Parameters
The following parameters should be included in the URL path.
Parameter | Description |
---|---|
id required |
Request Body
The request body should be a "application/json"
encoded object, containing the following items.
Parameter | Description |
---|---|
raise_lower required | The number of positions membership priority israised (positive number) or lower (negative number). Example: A membership of priority=4 when raise_lower=2, it will get a new priority of 2. if raise_lower=-2, it will get a new priority of 6. New priority cannot be less than one, or greater than the maximum priority or existing memberships. Other memberships are rearranged. Using values of raise_lower that may bring new priority out of limits, it will not produce error, just new priority will have a limiting value. |
location
query > coordinates > list
Lookups in cities and in venues (to be implemented). Pass the query string in `query` get param. Examples: "Berlin", "Berlin, Germany". TODO Add possibly some parameter to lookup only in venues / cities Response schema: parsed_latitude: type: float description: the latitude value of the API request. Either the latitude GET param, or the parsed value of latitude from the query GET param. Useful also just to parse latitude value from query string. parsed_longitude: type: float description: the longitude value of the API request. Either the longitude GET param, or the parsed value of latitude from the query GET param. Useful also just to parse longitude value from query string. id: type: integer description: city id name: type: string description: Original city name translated_name: type: string description: Translated city name in current user language translated_name_country: type: string description: Like `translated_name`, preceded with the translated country name, joined with comma, to be used in forms where city is asked country: type: string description: The two letters ISO code of city country countryname: type: string description: The name of city country translated in user s language is_venue: type: boolean description: Currently always off, to be implemented latitude: type: float description: the y-ordinate of the city longitude: type: float description: the x-ordinate of the city
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
query | The query string. There are many formats that can be parsed, example latitude, longitude. query is examined in priority, alternatively you may input latitude, longitude parameters |
latitude | Use instead of query, floating point number, degrees, positive values for north. |
longitude | Use instead of query, floating point number, degrees, positive values for east. |
query > geo_ip > list
Returns the city instance details (id, name etc) from client IP address by performing a GeoIP lookup. Response schema: id: type: integer description: city id name: type: string description: Original city name translated_name: type: string description: Translated city name in current user language translated_name_country: type: string description: Like `translated_name`, preceded with the translated country name, joined with comma, to be used in forms where city is asked country: type: string description: The two letters ISO code of the country countryname: type: string description: The name of the country translated in user's language is_venue: type: boolean description: Currently always off, to be implemented latitude: type: float description: the y-ordinate of the city longitude: type: float description: the x-ordinate of the city
query > name > list
Lookups in cities and in venues. Pass the query string in `query` get param. Examples: "Berlin", "Berlin, Germany". Results are sorted by query word similarity objects in lookup, by population (for cities) and by user location. User location can be either specified passing `longitude` and `latitude` GET params. If not specified then a GeoIP lookup is performed. When `include_venues` parameter is set, lookup is performed to both cities and venues. Response schema: id: type: integer description: city id, only when is_venue is false city: type: integer description: Venue city id, only when is_venue is true venue: type: string description: Venue name to display, exists only when is_venue is true name: type: string description: Original city name translated_name: type: string description: Translated city name in current user language translated_name_country: type: string description: Like `translated_name`, preceded with the translated country name, joined with comma, to be used in forms where city is asked country: type: string description: The two letters ISO code of city country countryname: type: string description: The name of city country translated in user's language best_altname: type: string description: An internal name of city. Candidate for deletion if not in use. is_venue: type: boolean description: False if item is a city, True if item is a venue latitude: type: float description: the y-ordinate of the city, or of the venue if item is a venue longitude: type: float description: the x-ordinate of the city, or of the venue if item is a venue distance: type: float description: the distance from user location if specified or was possible to find with GeoIP. Units in km, calculation with great circle on spherical earth, with a accuracy of 0.5% city_latitude: type: float description: the y-ordinate of venue city in the case item is venue, if looking up only cities this field is omitted city_longitude: type: float description: the x-ordinate of venue city in the case item is venue if looking up only cities this field is omitted
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
query | The query string. For looking up either cities or venues |
latitude | When specified both with longitude, the query takes into account the location specified, sorting results by distance. |
longitude | When specified both with latitude, the query takes into account the location specified, sorting results by distance. |
include_venues | When set, e.g. with include_venues=y, the query returns a unified list of venues, cities. If also only_venues is set, then this parameter does not have any effect. |
only_venues | When set, e.g. with only_venues=y, the query returns venues only. If this parameter is set then include_venues does not have any effect. |
notifications
mark_read > create
Mark user notifications as read. This is a POST only response to mark authenticated user notifications as read. On `Accept: text/html` requests redirects to referrer address, else it returns a JSON response. Response schema: success: type: boolean description: True on successful operation message: type: string description: Carries an error message on failure
unread_number > list
Returns an object with `count` attribute, the number of unread notifications of the authenticated user.
tag
query > name > list
Performs a fuzzy string lookup trying to match name input with event tags name attribute. In the ordering of results several factors are taken into account, namely the string similarity, tags popularity as well if tags is some preferred synonym. Returns up to ten (10) items ordered as above. Response schema: name: type: string description: name of tags matching the query
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
name required | The tag name to lookup for |
user
credential > availability > list
Checks if a username is in use. This endpoint does not need authentication, e.g. to check usernames while registering a new account. Pass the username in a ``username`` GET parameter. Result is an empty json object {} if ``username`` parameter is empty or less than some minimum of 4 characters, or else a json object: ``{"in_use": true}`` or ``{"in_use": false}`` according to the case. Note that if user is authenticated, then their username is excluded from lookup.
Query Parameters
The following parameters should be included as part of a URL query string.
Parameter | Description |
---|---|
username | The username to check for |