Skip to content

Identification examples #40

@zarathustra323

Description

@zarathustra323
/**
 * 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions