(lookup)
Retrieve up-to-date metadata about a specific phone number
- lookup - Look up for phone number
Look up for phone number
import { Ding } from "@ding-live/ding";
const ding = new Ding({
apiKey: "YOUR_API_KEY",
});
async function run() {
const result = await ding.lookup.lookup("6e93aa15-9177-4d09-8395-b69ce50db1c8", "<value>");
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DingCore } from "@ding-live/ding/core.js";
import { lookupLookup } from "@ding-live/ding/funcs/lookupLookup.js";
// Use `DingCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const ding = new DingCore({
apiKey: "YOUR_API_KEY",
});
async function run() {
const res = await lookupLookup(ding, "6e93aa15-9177-4d09-8395-b69ce50db1c8", "<value>");
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
customerUuid |
string | ✔️ | N/A |
phoneNumber |
string | ✔️ | N/A |
type |
operations.Type[] | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.LookupResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.ErrorResponse | 400 | application/json |
errors.SDKError | 4XX, 5XX | */* |