Skip to content

Latest commit

 

History

History
85 lines (58 loc) · 7.08 KB

README.md

File metadata and controls

85 lines (58 loc) · 7.08 KB

Lookup

(lookup)

Overview

Retrieve up-to-date metadata about a specific phone number

Available Operations

  • lookup - Look up for phone number

lookup

Look up for phone number

Example Usage

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();

Standalone function

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();

Parameters

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.

Response

Promise<components.LookupResponse>

Errors

Error Type Status Code Content Type
errors.ErrorResponse 400 application/json
errors.SDKError 4XX, 5XX */*