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.
| Property | Value |
|---|---|
| Scope | Hub (requires hub context) |
| Permission | Anonymous (0) |
Endpoint:
https://hostname/-/svc/util.get_cities
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
id | string | Yes | - | - |
page | integer | No | 1 | - |
Returns
| Field | Type | Description |
|---|---|---|
type | any | - |
description | any | - |
properties | any | - |
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.
| Property | Value |
|---|---|
| Scope | Hub (requires hub context) |
| Permission | Anonymous (0) |
Endpoint:
https://hostname/-/svc/util.get_countries
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | integer | No | 1 | - |
length | integer | No | 10 | - |
Returns
| Field | Type | Description |
|---|---|---|
type | any | - |
description | any | - |
properties | any | - |
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.
| Property | Value |
|---|---|
| Scope | Hub (requires hub context) |
| Permission | Anonymous (0) |
Endpoint:
https://hostname/-/svc/util.search_cities
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
value | string | No | "" | - |
name | string | No | "" | - |
page | integer | No | 1 | - |
Returns
| Field | Type | Description |
|---|---|---|
type | any | - |
description | any | - |
properties | any | - |
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.
| Property | Value |
|---|---|
| Scope | Hub (requires hub context) |
| Permission | Anonymous (0) |
Endpoint:
https://hostname/-/svc/util.search_countries
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
value | string | No | "" | - |
name | string | No | "" | - |
page | integer | No | 1 | - |
Returns
| Field | Type | Description |
|---|---|---|
type | any | - |
description | any | - |
properties | any | - |
Possible Errors
Error codes not documented
Related Documentation
- ACL System - Permission model
- Service Routing - URL patterns
- Error Handling - Error codes