-
Notifications
You must be signed in to change notification settings - Fork 1
Events
Endpoint for handling events.
| Command | Method | Route | Description |
|---|---|---|---|
| List | GET | /{culture}/api/Events | Fetches lists of events with selected pagination filter. |
Call to this API method will retrive a list of events. Response is paginated:
- its default page size is 10 and cannot be higher than 25
- default page number is 1 and cannot be lower than 1 These can be changed in request.
User can parametrize request:
- PageNumber (default: 1) - will returns chosen page number, i.e.
en-US/api/Events?PageNumber=2 - PageSize (default: 10) - will set size of page of response, i.e.
en-US/api/Events?PageSize=4
Response data will be in the following format:
{
"data": [
{
"id": <guid>,
"title": <string>,
"description": <string>,
"category": <string>,
"date": "2021-01-11T13:30:18.242Z",
"city": <string>,
"venue": <string>,
"attendees": [
{
"username": <string>,
"image": <string>,
"isHost": <bool>
}
]
}
],
"succeeded": <bool>,
"errors": [
<string>
],
"message": <string>,
"pageNumber": <int>,
"pageSize": <int>,
"firstPage": <string>,
"lastPage": <string>,
"totalPages": <int>,
"totalRecords": <int>,
"nextPage": <string>,
"previousPage": <string>
}
Example response for en-US/api/Events?PageNumber=2&PageSize=3:
{
"pageNumber": 2,
"pageSize": 3,
"firstPage": "https://localhost:44324/en-US/api/Events?pageNumber=1&pageSize=3",
"lastPage": "https://localhost:44324/en-US/api/Events?pageNumber=2&pageSize=3",
"totalPages": 2,
"totalRecords": 5,
"nextPage": null,
"previousPage": "https://localhost:44324/en-US/api/Events?pageNumber=1&pageSize=3",
"data": [
{
"id": "1ab6877d-5b2c-4e65-944d-4782a3093638",
"title": "Future Event 3",
"description": "Event 3 months in future",
"category": "drinks",
"date": "2021-03-17T10:11:46.274448",
"city": "Warsaw",
"venue": "Pub",
"attendees": [
{
"username": "bob",
"image": null,
"isHost": true
},
{
"username": "tom",
"image": null,
"isHost": false
}
]
},
{
"id": "f2de53a9-0815-41fc-81ce-02acc7e909ac",
"title": "Future Event 2",
"description": "Event 2 months in future",
"category": "meeting",
"date": "2021-02-17T10:11:46.274447",
"city": "Danzig",
"venue": "Italian Restaurant",
"attendees": [
{
"username": "tom",
"image": null,
"isHost": true
},
{
"username": "jane",
"image": null,
"isHost": false
}
]
}
],
"succeeded": true,
"errors": null,
"message": null
}| Command | Method | Route | Description |
|---|---|---|---|
| Details | GET | /{culture}/api/Events/{id} | Fetches a single event by id. |
Call to this API method will retrive a single event with selected id. Response data will be in the following format:
{
"id": <guid>,
"title": <string>,
"description": <string>,
"category": <string>,
"date": "2021-01-11T13:30:18.242Z",
"city": <string>,
"venue": <string>,
"attendees": [
{
"username": <string>,
"image": <string>,
"isHost": <bool>
}
]
}
Example response for en-US/api/Events/1ab6877d-5b2c-4e65-944d-4782a3093638:
{
"id": "1ab6877d-5b2c-4e65-944d-4782a3093638",
"title": "Future Event 3",
"description": "Event 3 months in future",
"category": "drinks",
"date": "2021-03-17T10:11:46.274448",
"city": "Warsaw",
"venue": "Pub",
"attendees": [
{
"username": "bob",
"image": null,
"isHost": true
},
{
"username": "tom",
"image": null,
"isHost": false
}
]
}| Command | Method | Route | Description |
|---|---|---|---|
| Create | POST | /{culture}/api/Events | Adds a new event. |
Call to this API method will result in the creation of a new event according to the arguments passed in the request body. The format of the arguments in the request body is JSON.
Request body will be in the following format:
{
"id": <guid>,
"title": <string>,
"description": <string>,
"category": <string>,
"date": "2021-01-11T13:30:18.242Z",
"city": <string>,
"venue": <string>
}
The response to this call will return id of newly created event:
{
<guid>
}
| Update | Method | Route | Description |
|---|---|---|---|
| Details | PUT | /{culture}/api/Events/{id} | Updates an existing event selected by id. |
Call to this API method will result in the updating an event with selected id. Arguments are passed in the request body. The format of the arguments in the request body is JSON.
Request body will be in the following format:
{
"id": <guid>,
"title": <string>,
"description": <string>,
"category": <string>,
"date": "2021-01-11T13:30:18.242Z",
"city": <string>,
"venue": <string>
}
The response to this call will return status code 204 if an event was edited correctly.
| Command | Method | Route | Description |
|---|---|---|---|
| Delete | DELETE | /{culture}/api/Events/{id} | Deletes an event with selected id. |
Call to this API method will result in deleting an event with selected id. The response to this call will return status code 204 if an event was deleted correctly.
| Command | Method | Route | Description |
|---|---|---|---|
| Subscribe | POST | /{culture}/api/Events/{id}/subscribe | Subscribes user to event with selected id. |
Call to this API method will result in subscribing current logged user to event with selected id. The response to this call will return status code 204 if user was subscribed correctly to the event.
| Command | Method | Route | Description |
|---|---|---|---|
| Unsubscribe | DELETE | /{culture}/api/Events/{id}/subscribe | Unsubscribes user from event with selected id. |
Call to this API method will result in unsubscribing current logged user from event with selected id. The response to this call will return status code 204 if user was unsubscribed correctly from the event.