Credential interactions

Create a credential interaction

Creates a new credential interaction event.

Creates a new credential interaction event.

Important considerations

This feature uses the browser's LocalStorage to identify the actions made by the recipient of the credential. When the user accesses the page with ?recipient=true query parameter, the application saves that information in LocalStorage and removes the parameter from the URL. Actions taken afterwards in the same browser are recorded as the recipient's, until the LocalStorage data is cleared.

If you are distributing the credential links independently and wish to track events as originating from the recipient, be sure to include the ?recipient=true parameter. Without this parameter, we won't be able to mark this person as the recipient, and their actions will be marked under the guest actor category.

This approach may not capture every scenario. For example, if a recipient opens a link with ?recipient=true on one device, then shares the link without the parameter (or opens it on a different device without the stored flag), those subsequent views will be categorized as guest. Similarly, if the user clears their LocalStorage or uses an incognito session, the system can no longer confirm that they are the recipient.

POST
/v1/credential-interactions

Authorization

BearerAuth
AuthorizationBearer <token>

Provide your access token in the Authorization header with Bearer auth-scheme. You can view and manage your access tokens in the Certifier Dashboard.

In: header

Header Parameters

Certifier-Version*string

API version header. Required for all requests.

Request Body

application/json

credentialId*string

The unique credential's identifier, to which this credential interaction belongs

eventType*string

Specifies the type of user interaction event related to the credential

Value in"credential_viewed" | "credential_shared_to_linkedin" | "credential_added_to_linkedin_profile" | "credential_shared_to_facebook" | "credential_shared_to_twitter" | "credential_shared_to_messenger" | "credential_shared_to_whatsapp" | "credential_shared_to_pinterest" | "credential_shared_to_telegram" | "credential_shared_to_weibo" | "credential_downloaded" | "credential_link_copied" | "credential_verified"
triggeredBy*string

The actor that triggered this credential interaction. Currently one of two values: recipient or guest

Value in"recipient" | "guest"
triggeredAt*string

The date and time when this credential interaction happened. Formatted as an ISO 8601 date and time string

Formatdate-time

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://api.certifier.io/v1/credential-interactions" \  -H "Certifier-Version: 2022-10-26" \  -H "Content-Type: application/json" \  -d '{    "credentialId": "01hrsvjp560yksep2a3bek3z97",    "eventType": "credential_viewed",    "triggeredBy": "recipient",    "triggeredAt": "2024-03-12T17:33:05.784Z"  }'
{
  "id": "01hrsvk8xnj8vkt8p1e2tc1jt7",
  "credentialId": "01hrsvjp560yksep2a3bek3z97",
  "eventType": "credential_viewed",
  "triggeredBy": "recipient",
  "triggeredAt": "2024-03-12T17:33:05.784Z"
}

{
  "error": {
    "code": "missing_version",
    "message": "The request is missing the required Certifier-Version header"
  }
}

{
  "error": {
    "code": "unauthorized",
    "message": "A valid authentication token was not provided with the request"
  }
}
{
  "error": {
    "code": "rate_limited",
    "message": "You have exceeded the rate limit"
  }
}
{
  "error": {
    "code": "internal_server_error",
    "message": "There was a problem on Certifier's end"
  }
}