Create a Loop Link

Create a new Loop Link to begin submitting events and feedback.

Request

HTTP Request

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

Request Headers

HeaderValue

Content-Type

application/json

Request Body

FieldDescription

name string

Name of the Loop Link. This is for your own use as a way to differentiate your Loop Links. E.g. Hotel ABC

expire_dt datetime

optional

Date/time the Loop Link is set to expire in ISO 8601 format. All dates are in UTC. This is an optional field - omit if not needed. E.g. 2023-05-08T00:29:45.859Z

metadata object

optional

Metadata can be used to further identify Loop Links in a way that makes sense for your system. The field is a key/value field that accepts string-based keys and string or numeric values. This can be useful for storing additional data such as a end-user identifier or store ID etc. This is an optional field - omit if not needed.

E.g.

{
  "hotel_id": "123456789"
}

Response

Response Fields

Please refer to the response fields section in Get a Loop Link.

Example response

Below is an example response:

{
  "link_id": "ber7ntO0ZHuFVCfrSNsN",
  "create_dt": "2021-11-01T11:12:34",
  "update_dt": "2021-11-01T11:12:34",
  "expire_dt": "2021-11-01T11:12:34",
  "name": "Hotel A",
  "links": {
    "event": "https://loop.phq.link/event/ber7ntO0ZHuFVCfrSNsN",
    "event_feedback": "https://loop.phq.link/event-feedback/ber7ntO0ZHuFVCfrSNsN"
  },
  "metadata": {
    "hotel_id": "123456789"
  },
  "status": "active"
}

Examples

curl -X POST https://api.predicthq.com/v1/loop/links \
     -H "Accept: application/json" \
     -H "Authorization: Bearer $ACCESS_TOKEN" \
     --data @<(cat <<EOF
    {
        "name": "Hotel A",
        "expire_dt": "2021-11-01T11:12:34",
        "metadata": {
            "hotel_id": "123456789"
        }
    }
    EOF
    )

Guides

Below are some guides relevant to this API:

Last updated

© 2024 PredictHQ Ltd