Links

Search Loop Links

Search existing Loop Links.

Request

HTTP Request

GET https://api.predicthq.com/v1/loop/links

Query Parameters

Parameter
Description
q string
Full-text search. E.g. ?q=hotel+a
link_id string
Comma-separated list of link_id. E.g. ?link_id=m4Dk4g4DRA8Yqbp2PC54
user_id string
Comma-separated list of user_id. E.g. ?user_id=hw8Dsmv4Djg
sort string
Comma-separated list of sort options. Prefix the field name with - for reverse order. Possible values:
  • created
  • updated
  • expires
  • name
E.g. ?sort=name
limit number
The maximum number of results to return. The default limit is 10. E.g. ?limit=10
offset number
The number of results to skip. The default is 0. E.g. ?offset=20

Response

Response Fields

Field
Description
count number
Total number of results found.
next string or null
URL to the next page of results.
previous string or null
URL to the previous page of results.
links array
List of results where each item is a Loop Link.
Please refer to the response fields section in Get a Loop Link for the structure of each record.
Example response
Below is an example response:
{
"count": 1,
"next": null,
"previous": null,
"links": [
{
"link_id": "kt9fJZXpWFXSAdky9Bunb2",
"expire_dt": "2025-03-12T21:07:26.704000+00:00",
"name": "Hotel A",
"status": "active",
"create_dt": "2023-03-12T21:12:51+00:00",
"update_dt": "2023-03-12T21:12:51+00:00",
"metadata": {
"hotel_id": 123456789
},
"links": {
"event": "https://loop.phq.link/event/kt9fJZXpWFXSAdky9Bunb2",
"event_feedback": "https://loop.phq.link/event-feedback/kt9fJZXpWFXSAdky9Bunb2"
}
}
]
}

Examples

curl
python
curl -X GET https://api.predicthq.com/v1/loop/links?sort=name \
-H "Accept: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"
import requests
response = requests.get(
url="https://api.predicthq.com/v1/loop/links",
headers={
"Authorization": "Bearer $ACCESS_TOKEN",
"Accept": "application/json"
},
params={
"sort": "name"
}
)
print(response.json())

Guides

Below are some guides relevant to this API: