Skip to main content

UTIL API Reference

Module Information​

Service Files:

  • Public: service/util.js

Available Services: 4 Documented Services: 4


util.get_cities​

Get a paginated list of cities for a given country. Calls the yp_get_cities stored procedure on the YP database using the supplied country ID and page number.

PropertyValue
ScopeHub (requires hub context)
PermissionAnonymous (1)

Endpoint:

https://hostname/-/svc/util.get_cities

Parameters​

ParameterTypeRequiredDefaultDescription
idstringYes--
pageintegerNo1-

Returns​

FieldTypeDescription
typeany-
descriptionany-
propertiesany-

Possible Errors​

Error codes not documented


util.get_countries​

Get a paginated list of all countries. Calls the utils_get_countries stored procedure on the YP database. Supports pagination via page and length parameters.

PropertyValue
ScopeHub (requires hub context)
PermissionAnonymous (1)

Endpoint:

https://hostname/-/svc/util.get_countries

Parameters​

ParameterTypeRequiredDefaultDescription
pageintegerNo1-
lengthintegerNo10-

Returns​

FieldTypeDescription
typeany-
descriptionany-
propertiesany-

Possible Errors​

Error codes not documented


util.search_cities​

Search cities by name keyword. Calls the utils_search_cities stored procedure on the YP database. Accepts the search term via either the value or name parameter, falling back to an empty string when both are absent.

PropertyValue
ScopeHub (requires hub context)
PermissionAnonymous (1)

Endpoint:

https://hostname/-/svc/util.search_cities

Parameters​

ParameterTypeRequiredDefaultDescription
valuestringNo""-
namestringNo""-
pageintegerNo1-

Returns​

FieldTypeDescription
typeany-
descriptionany-
propertiesany-

Possible Errors​

Error codes not documented


util.search_countries​

Search countries by name keyword. Calls the utils_search_countries stored procedure on the YP database. Accepts the search term via either the value or name parameter, falling back to an empty string when both are absent.

PropertyValue
ScopeHub (requires hub context)
PermissionAnonymous (1)

Endpoint:

https://hostname/-/svc/util.search_countries

Parameters​

ParameterTypeRequiredDefaultDescription
valuestringNo""-
namestringNo""-
pageintegerNo1-

Returns​

FieldTypeDescription
typeany-
descriptionany-
propertiesany-

Possible Errors​

Error codes not documented