Skip to content

Search API

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

Endpoint

api/search?search=text
api/search?search=text&maxResults=5

Response

{
    "userResults": [
        {
            "id": 1,
            "firstName": "Fname",
            "lastName": "Lname",
            "username": "[email protected]",
            "password": null,
            "roleId": 1,
            "role": null,
            "locationId": 1,
            "location": null,
            "imageUrl": "/api/images/4/18/19/0c748611-2787-4a45-bfe1-f6204d511b73.png",
            "deactivated": false,
            "userInterests": [],
            "workshopsAttending": [],
            "workshopsTeaching": []
        }
    ],
    "workshopResults": [
        {
            "educatorId": 1,
            "educator": null,
            "locationId": 1,
            "categoryId": 2,
            "category": null,
            "location": null,
            "description": "Let's talk about emotions. ",
            "start": "2019-04-22T13:00:00",
            "end": "2019-04-22T14:00:00",
            "webex": "https://wiprocon.webex.com/meet/abc.123",
            "imageUrl": "/api/images/4/18/19/21704afa-541d-4812-b97a-4b5c783d9e90.jpeg",
            "room": "Black",
            "cancelled": false,
            "workshopAttendees": [],
            "name": "Emotions at Work",
            "id": 1
        }
    ],
    "categoryResults": [
        {
            "name": "Professional Development",
            "id": 1
        }
    ],
    "locationResults": [
        {
            "name": "Dallas",
            "id": 6
        }
    ]
}

Notes

Takes the search string provided and checks if it's contained in workshop titles, then user first and last names, then category names, and finally location names.
maxResults defaults to five if not provided- and determines the maximum total results you will receive back.

Clone this wiki locally