Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identification examples #40

Open
zarathustra323 opened this issue Oct 26, 2016 · 0 comments
Open

Identification examples #40

zarathustra323 opened this issue Oct 26, 2016 · 0 comments

Comments

@zarathustra323
Copy link
Member

zarathustra323 commented Oct 26, 2016

/**
 * Identification using the `identify` command.
 * Can be one of identifier, pull, upsert, or a combo.
 */
Radix.identify({
    id     : '57d7f924d78c6af39f0041a8', // Signifies an internal identification request (needs to support accounts as well)
    pull   : 'omeda|6990A9405978C8Z', // Signifies an external, pull identification request, formatted as [pullKey]|[externalId]
    upsert : 'some-source-key|1234', // Signifies an external, upsert identification request, formatted as [sourceKey]|[externalId]
    props : { // Properties to upsert - only used during an upsert request.
        givenName  : 'Jane',
        familyName : 'Doe'
        // ... Any available identity properties.
    }
});

/**
 * Identification using an identify query string.
 * Can be one of identifier, pull, upsert, or a combo
 */
window.location.search = '?rdx.ident[id]=57d7f924d78c6af39f0041a8'; // Execute an internal identification
window.location.search = '?rdx.ident[pull]=omeda|6990A9405978C8Z'; // Execute an external, pull identification
window.location.search = '?rdx.ident[upsert]=some-source-key|1234&props[givenName]=Jane'; // Execute an external, upsert identification

/**
 * Identification can also be handled via a POST request.
 * Looks "identical" to an identify request, except that it is JSON encoded.
 * Can be one of identifier, pull, upsert, or a combo
 */
$.post('/app/identify', JSON.stringify({
    id     : '57d7f924d78c6af39f0041a8',
    pull   : 'omeda|6990A9405978C8Z',
    upsert : 'some-source-key|1234',
    props : {
        givenName  : 'Jane',
        familyName : 'Doe'
        // ... Any available identity properties.
    }
}));

// For identification combinations:
// Will always execute in this order: identifier, pull, upsert.
// If an identification type was found, it will not execute additional types.
// Example: if identifier present, will execute the internal identification and ignore pull and upsert, if present
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant