Reusable Q64 search
The Genesys Cloud search API responses include Q64 URIs, which allow you to repeat a query without rebuilding the request. Each response includes:
- previousPage- Retrieves the previous page of results.
- currentPage- Repeats the current query.
- nextPage- Retrieves the next page of results.
Q64 example
The following query returns users by name.
Copied
{
"pageSize": 25,
"pageNumber": 1,
"query": [{
"type": "TERM",
"fields": ["name"],
"value": "Tom"
}]
}
Copied
{
"total": 1,
"pageCount": 1,
"pageSize": 25,
"pageNumber": 1,
"previousPage": "/api/v2/users/search?q64=H4sIAAAAAAAAAD2OuwoCMRBF_2XqNAo26WxEGwsTsFhEIjuGwObhJCOsy_67SQTLueeeyyxQ5oQZ5ACckTLcBLwYaa7JAm8zcYc1bT2QoPT-otX9etJHEPB0OI3dDsZjk7tSezr6yi1FTs1fK0rGonKfSre733Vm_0ACuRFAWJjC4b9n2Y1tz1hLaE1xMfRH1i9UxiXesgAAAA%3D%3D",
"currentPage": "/api/v2/users/search?q64=H4sIAAAAAAAAAD2OuwoCMRBF_2XqNAo26WxEGwsTsFhEIjuGwObhJCOsy_67SQTLueeeyyxQ5oQZ5ACckTLcBLwYaa7JAm8zcYc1bT2QoPT-otX9etJHEPB0OI3dDsZjk7tSezr6yi1FTs1fK0rGonKfSre733Vm_0ACuRFAWJjC4b9n2Y1tz1hLaE1xMfRH1i9UxiXesgAAAA%3D%3D",
"nextPage": "/api/v2/users/search?q64=H4sIAAAAAAAAAD2OuwoCMRBF_2XqVILNdjaijYUJWIhIZMcQ2DycZIR12X93EsFy7rnnMgvUOWOB4QpckArcFLwYaZZkgbeduENJWw8G0GZ3Nvp-OZoDKHh6nMZuRxuwyV2RnklBuKPEufmroGwdav8Rutn-rhOHB5LcCggrU9z_9xz7se1Z5widrT7F_sj6BfKOXaCyAAAA",
"types": [
"users"
],
"results": [{
"id": "bf5a111e-6e10-433b-a7c2-5da8ade2337a",
"name": "Smith, Tom",
...
...
...
"version": "152",
"selfUri": "/api/v2/users/bf5a111e-6e10-433b-a7c2-5da8ade2337a"
}]
}
Once you receive the response, you can use the Q64 values in the response. In this example, we use the currentPage value to repeat the original search.
Request:
Copied
GET /api/v2/users/search?q64=H4sIAAAAAAAAAD2OuwoCMRBF_2XqNAo26WxEGwsTsFhEIjuGwObhJCOsy_67SQTLueeeyyxQ5oQZ5ACckTLcBLwYaa7JAm8zcYc1bT2QoPT-otX9etJHEPB0OI3dDsZjk7tSezr6yi1FTs1fK0rGonKfSre733Vm_0ACuRFAWJjC4b9n2Y1tz1hLaE1xMfRH1i9UxiXesgAAAA%3D%3D
Copied
{
"total": 1,
"pageCount": 1,
"pageSize": 25,
"pageNumber": 1,
"previousPage": "/api/v2/users/search?q64=H4sIAAAAAAAAAD2OuwoCMRBF_2XqNAo26WxEGwsTsFhEIjuGwObhJCOsy_67SQTLueeeyyxQ5oQZ5ACckTLcBLwYaa7JAm8zcYc1bT2QoPT-otX9etJHEPB0OI3dDsZjk7tSezr6yi1FTs1fK0rGonKfSre733Vm_0ACuRFAWJjC4b9n2Y1tz1hLaE1xMfRH1i9UxiXesgAAAA%3D%3D",
"currentPage": "/api/v2/users/search?q64=H4sIAAAAAAAAAD2OuwoCMRBF_2XqNAo26WxEGwsTsFhEIjuGwObhJCOsy_67SQTLueeeyyxQ5oQZ5ACckTLcBLwYaa7JAm8zcYc1bT2QoPT-otX9etJHEPB0OI3dDsZjk7tSezr6yi1FTs1fK0rGonKfSre733Vm_0ACuRFAWJjC4b9n2Y1tz1hLaE1xMfRH1i9UxiXesgAAAA%3D%3D",
"nextPage": "/api/v2/users/search?q64=H4sIAAAAAAAAAD2OuwoCMRBF_2XqVILNdjaijYUJWIhIZMcQ2DycZIR12X93EsFy7rnnMgvUOWOB4QpckArcFLwYaZZkgbeduENJWw8G0GZ3Nvp-OZoDKHh6nMZuRxuwyV2RnklBuKPEufmroGwdav8Rutn-rhOHB5LcCggrU9z_9xz7se1Z5widrT7F_sj6BfKOXaCyAAAA",
"types": [
"users"
],
"results": [{
"id": "bf5a111e-6e10-433b-a7c2-5da8ade2337a",
"name": "Smith, Tom",
...
...
...
"version": "152",
"selfUri": "/api/v2/users/bf5a111e-6e10-433b-a7c2-5da8ade2337a"
}]
}
Note: The search response for POST and GET values are the same for Q64 requests.