GitHub

Operations

Lookup Keys

You can use lookup keys to assign multiple references to instances. Most common use of a lookup key is to assign email and msisdn to a user's profile. Thus, you can reach the instance by calling it with email or msisdn.

  • You cannot get more than 100 keys in parallel.
  • You cannot set more than 25 keys in parallel.
  • You cannot delete more than 25 keys in parallel.
interface LookUpKey {
    key: {
        name: string
        value: string
    }
}


interface OperationResponse {
    success: boolean
    data?: any
    error?: string
}


async function getLookUpKey(input: LookUpKey): Promise<OperationResponse | undefined> {
    // ...
}


async function setLookUpKey(input: LookUpKey): Promise<OperationResponse | undefined> {
    // ...
}


async function deleteLookUpKey(input: LookUpKey): Promise<OperationResponse | undefined> {
    // ...
}

Usage

import RDK from '@retter/rdk'


const rdk = new RDK()


await rdk.getLookupKey({ key: { name: 'msisdn', value: '905987654321' } })
await rdk.setLookupKey({ key: { name: 'msisdn', value: '905987654321' } })
await rdk.deleteLookupKey({ key: { name: 'msisdn', value: '905987654321' } })


await rdk.pipeline()
    .setLookupKey({ key: { name: 'msisdn', value: '905987654321' } })
    .getLookupKey({ key: { name: 'msisdn', value: '905987654321' } })
    .deleteLookupKey({ key: { name: 'msisdn', value: '905987654321' } })
    .send()

API Reference

Lookup Key Input

ParameterTypeRequiredDescription
key{ name: string, value: string }trueLookup key's name and value

Operation Output

ParameterTypeRequiredDescription
successbooleantrueReturns true if operation is successful
dataanyfalseSuccessful response
errorstringfalseReason of failure
Previous
Authentication