Technical Documentation

Foreign Keys

14 views 0

In many cases, Zephr Customers use Foreign Keys for a variety of integrations with Zephr. These are stored differently to User Schema Attributes, using Foreign Systems.

This guide details how to set Foreign Keys in Zephr using the Public API and, once set, how to search for users using Foreign Key or email.

To set a Foreign Key in Zephr during registration, use the following request:

curl --location --request POST 'https://harminder.cdn.blaize.io/blaize/register' \
--header 'Content-Type: application/json' \
--data-raw '{
        "identifiers": {
            "email_address": "harmindervirdi12345@test.com"
        },
        "validators": {
            "password": "sup3rs3cr3t"
        },
        "foreign_keys": {
         "CRMID": "12345"
        }
    }'

To set a Foreign Key in Zephr during login, use the following request:

curl --location --request POST 'https://harminder.cdn.blaize.io/blaize/login' \
--header 'Content-Type: application/json' \
--data-raw '{
        "identifiers": {
            "email_address": "harmindervirdi1234@test.com"
        },
        "validators": {
            "password": "sup3rs3cr3t"
        },
        "foreign_keys": {
         "CRMID": "12345"
        }
    }'

To find users based upon Foreign Key, make the following call:

https://[tenant].admin.blaize.io/v3/users?foreign_keys.CRMID=[foreignkey]

E.G.

https://harminder.admin.blaize.io/v3/users?foreign_keys.CRMID=12345