Skip to content

Workshops API

Christopher Posada edited this page Apr 29, 2019 · 13 revisions

Create - List - Update - Cancel


Create

Endpoint

api/workshops/create

Payload

{
    "name": "Test Two",
    "locationId": 1,
    "description": "Blep.",
    "start": "2019-04-11T17:02:00.87",
    "end": "2019-10-11T17:02:07.716",
    "webex": "https://dogeplanet.com",
    "imageUrl": "/api/images/bleh.png",
    "categoryId": 1,
    "room": "White"
}

Response

workshop id (int)

Notes

Educator will be auto-populated as the logged-in user.
Locations
Categories


List

Endpoints

api/workshops
api/workshops/filter?categoryId=1
api/workshops/filter?locationId=1
api/workshops/filter?startDate=2018-04-11T00:00:00&endDate=2020-04-11T00:00:00

Response

[
    {
        "id": 1,
        "name": "So you wanna do a design sprint?",
        "educatorId": 1,
        "educator": {
            "id": 1,
            "firstName": "Chris",
            "lastName": "Posada",
            "username": "cposada",
            "password": null,
            "roleId": 1,
            "role": null,
            "locationId": 1,
            "location": {
                "name": "Brooklyn",
                "id": 1
            },
            "imageUrl": "/api/images/4/16/19/7dbaa88c-da3c-4e58-b8dd-7209645dbc70.png",
            "userInterests": []
        },
        "locationId": 1,
        "location": {
            "name": "Brooklyn",
            "id": 1
        },
        "description": "Cable Pieces of Eight snow come about wench transom sloop.",
        "start": "2019-04-11T17:02:00.87",
        "end": "2019-10-11T17:02:07.716",
        "webex": "https://dogeplanet.com",
        "imageUrl": null,
        "workshopUsers": null
    },
    {
        "id": 2,
        "name": "How to be a pirate",
        "educatorId": 1,
        "educator": {
            "id": 1,
            "firstName": "Chris",
            "lastName": "Posada",
            "username": "cposada",
            "password": null,
            "roleId": 1,
            "role": null,
            "locationId": 1,
            "location": {
                "name": "Brooklyn",
                "id": 1
            },
            "imageUrl": "/api/images/4/16/19/7dbaa88c-da3c-4e58-b8dd-7209645dbc70.png",
            "userInterests": []
        },
        "locationId": 1,
        "location": {
            "name": "Brooklyn",
            "id": 1
        },
        "description": "Haul wind flogging coxswain measured fer yer chains.",
        "start": "2019-04-11T17:02:00.87",
        "end": "2019-10-11T17:02:07.716",
        "webex": "https://dogeplanet.com",
        "imageUrl": null,
        "workshopUsers": null
    }
    ]

Notes

This endpoint will not return workshops with start dates prior to DateTime.Today, or workshops that have been cancelled.
Filters can be stacked (ie: api/workshops/filter?categoryId=1&startDate=2018-04-11T00:00:00&endDate=2020-04-11T00:00:00?locationId=1)
Categories
Locations


Update

Endpoint

PUT api/workshops/1

Payload

{
    "name": "Test Two",
    "locationId": 1,
    "description": "Blep.",
    "start": "2019-04-11T17:02:00.87",
    "end": "2019-10-11T17:02:07.716",
    "webex": "https://dogeplanet.com",
    "imageUrl": "/api/images/bleh.png",
    "categoryId": 1,
    "room": "White"
}

Response

200 OK

Notes

Updates can only be made by the user that created the workshop (ie: the existing educatorId must match the logged in userId)
Locations
Categories


Cancel

Endpoint

DELETE api/workshops/1

Response

200 OK

Notes

Cancelation can only be done by the user that created the workshop (ie: the existing educatorId must match the logged in userId)

Clone this wiki locally