linkGuestActivity
Requires a customer (portal or buyer app) session.
Attaches the visits a guest made before signing in to the signed-in customer's company. Returns how many were linked.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation LinkGuestActivity($anonymousId: String!) {
linkGuestActivity(anonymousId: $anonymousId) {
linked
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation LinkGuestActivity($anonymousId: String!) {\n linkGuestActivity(anonymousId: $anonymousId) {\n linked\n }\n}",
"variables": {
"anonymousId": "string"
}
}
EOF
Variables:
{
"anonymousId": "string"
}
Response:
{
"data": {
"linkGuestActivity": {
"linked": 0
}
}
}
linkGuestActivity(
anonymousId: String!
): LinkGuestActivityResult!
Arguments
linkGuestActivity.anonymousId ● String! non-null scalar
The identifier the app gave the guest before sign-in.
Type
LinkGuestActivityResult object
The result of linking a guest's activity to a customer.