Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 2 Current »

Retrieve Available Search Filters

This endpoint allows you to retrieve a list of available search filters for public programs.

Endpoint

GET /public-programs/api/search/filters

Request Parameters

None.

Request Headers

None.

Response

Returns a JSON object containing an array of available search filters:

{
"filters": {
  "type": "object",
  "properties": {
    "filter": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string"
        },
        "default": {
          "type": "null"
        },
        "required": {
          "type": "boolean"
        },
        "help": {
          "type": "string"
        },
        "field": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string"
            }
          }
        },
        "selected": {
          "type": "null"
        }
      }
    }
}

Filters

The filters object contains a list of filters that can be used to search for programs. Each filter is described by the following attributes:

  • title (string, required): The title of the filter.

  • default (string, optional): The default value for the filter.

  • required (boolean, required): Indicates if the filter is required.

  • help (string, required): A description of the filter.

  • field (object, required): A description of the type of field used for the filter.

    • type (string, required): The type of field. Possible values are text, choice, and datetime.

    • options (object, optional): An object containing the options for the filter (only used for the choice type).

  • selected (string, optional): The currently selected value for the filter.

Possible Filters

Any of these filters can be sent as part of the response.

Filter

Type

Default

Required

Help

searchText

text

null

false

Search by program name, description or code

postcode

text

null

false

Search by a specific postcode

latitude

text

null

false

Search by a specific geo-coordinate

longitude

text

null

false

Search by a specific geo-coordinate

distance

text

null

false

Restrict programs to a specific radius

programTypeId

choice

""

false

The Reclink Program Type.

programAgeType

choice

""

false

Filter by program ages.

owner

choice

""

false

Filter by program owner.

startDateTime

datetime

""

false

The date this program starts.

endDateTime

datetime

""

false

The date this program terminates.

dateBetween

datetime

""

false

A date that lies within the range of the program

Response Codes

Status Code

Description

200

The list of available filters was found.

500

An unexpected error occurred.

Example Request

GET /public-programs/api/search/filters HTTP/1.1
Host: api.beta.club.reclink.org

Example Response

// 20230501162434
// https://api.beta.club.reclink.org/public-programs/api/search/filters

{
  "filters": {
    "searchText": {
      "title": "Search",
      "default": null,
      "required": false,
      "help": "Search by program name, description or code",
      "field": {
        "type": "text"
      },
      "selected": null
    },
    "postcode": {
      "title": "Postcode",
      "default": null,
      "required": false,
      "help": "Search by a specific postcode",
      "field": {
        "type": "text"
      },
      "selected": null
    },
    "latitude": {
      "title": "Latitude",
      "default": null,
      "required": false,
      "help": "Search by a specific geo-coordinate",
      "field": {
        "type": "text"
      },
      "selected": null
    },
    "longitude": {
      "title": "Longitude",
      "default": null,
      "required": false,
      "help": "Search by a specific geo-coordinate",
      "field": {
        "type": "text"
      },
      "selected": null
    },
    "distance": {
      "title": "Distance (km)",
      "default": null,
      "required": false,
      "help": "Restrict programs to a specific radius",
      "field": {
        "type": "text"
      },
      "selected": null
    },
    "programTypeId": {
      "title": "Program Type",
      "default": "",
      "required": false,
      "help": "The Reclink Program Type.",
      "field": {
        "type": "choice",
        "options": {
          "6041b978-c313-49cd-ac29-ce48b180f30d": "Test"
        }
      },
      "selected": null
    },
    "programAgeType": {
      "title": "Age Range",
      "default": "",
      "required": false,
      "help": "Filter by program ages.",
      "field": {
        "type": "choice",
        "options": {
          "0-12": "CHILD",
          "13-17": "YOUTH",
          "18+": "ADULT",
          "All": "ALL"
        }
      },
      "selected": null
    },
    "owner": {
      "title": "Program Owner",
      "default": "",
      "required": true,
      "help": "Filter by program owner.",
      "field": {
        "type": "choice",
        "options": {
          "Victoria Group": "mp-clubgroups::group::VIC_GROUP"
        }
      },
      "selected": null
    },
    "startDateTime": {
      "title": "Start Date",
      "default": "",
      "required": false,
      "help": "The date this program starts.",
      "field": {
        "type": "datetime"
      },
      "selected": null
    },
    "endDateTime": {
      "title": "End Date",
      "default": "",
      "required": false,
      "help": "The date this program terminates.",
      "field": {
        "type": "datetime"
      },
      "selected": null
    },
    "dateBetween": {
      "title": "Program Date",
      "default": "",
      "required": false,
      "help": "A date that lies within the range of the program.",
      "field": {
        "type": "datetime"
      },
      "selected": null
    }
  }
}

Perform Search

Endpoint

POST /public-programs/api/search/search

Request Parameters

A URL encoded list of filters.

filters[filterKey]=filterValue

Request Headers

None.

Response

Returns a JSON object containing an array of available search results:

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "API Response",
  "type": "object",
  "properties": {
    "programs": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "prc": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "startDate": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date-time"
              },
              "timezone_type": {
                "type": "integer"
              },
              "timezone": {
                "type": "string"
              }
            },
            "required": ["date", "timezone_type", "timezone"]
          },
          "endDate": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date-time"
              },
              "timezone_type": {
                "type": "integer"
              },
              "timezone": {
                "type": "string"
              }
            },
            "required": ["date", "timezone_type", "timezone"]
          },
          "ageRangeType": {
            "type": "string"
          },
          "location": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "sessionCount": {
            "type": "integer"
          },
          "banner": {
            "type": "string"
          }
        },
        "required": ["title", "id", "prc", "description", "startDate", "endDate", "ageRangeType", "location", "postcode", "sessionCount", "banner"]
      }
    }
  },
  "required": ["programs"]
}

  • No labels