# Useful Links API Contract

All endpoints return JSON and require `qrID`.

## Shared Query Parameters

- `qrID` (required, integer): employee id
- `q` (optional, string): search term
- `sort` (optional): `name`, `updated`
- `dir` (optional): `ASC` or `DESC`
- `limit` (optional, integer): default `200`, max `500`
- `offset` (optional, integer): default `0`

## Endpoints

### `useful_links/get_useful_links.php`

Returns active useful links for end users.

```json
{
  "success": true,
  "meta": {
    "q": "",
    "sort": "name",
    "dir": "ASC",
    "limit": 200,
    "offset": 0,
    "qrID": 123
  },
  "links": [
    {
      "id": 1,
      "name": "HR Portal",
      "url": "https://example.com/hr",
      "logoUrl": "https://example.com/qr/img/links/hr.png",
      "fallbackIcon": "fa-link",
      "displayOrder": 10,
      "createdAt": "2026-01-10 10:20:00",
      "updatedAt": "2026-01-10 10:20:00"
    }
  ]
}
```

If no records are found, `links` returns as an empty array.
