GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sdk-js/packages/epilot-sdk-v2/docs/address-suggestions.md at main · epilot-dev/sdk-js

Expand file tree

/

address-suggestions.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
243 lines (186 loc) · 4.04 KB
/

address-suggestions.md

Copy path

File metadata and controls

243 lines (186 loc) · 4.04 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Address Suggestions API

  • Base URL: https://address-suggestions-api.sls.epilot.io
  • Full API Docs: https://docs.epilot.io/api/address-suggestions

Usage

import { epilot } from '@epilot/sdk'

epilot.authorize(() => '<token>')
const { data } = await epilot.addressSuggestions.getAddresses(...)

Tree-shakeable import

import { getClient, authorize } from '@epilot/sdk/address-suggestions'

const addressSuggestionsClient = getClient()
authorize(addressSuggestionsClient, () => '<token>')
const { data } = await addressSuggestionsClient.getAddresses(...)

Operations

Addresses API

  • getAddresses
  • checkAvailability
  • validateAddressesFile

Schemas

  • AvailabilityResult
  • Error
  • AddressSuggestion
  • AddressSuggestions
  • ValidateAddressSuggestionsFileResult
  • ValidateAddressFileResult
  • AddressSuggestionError
  • ValidateAddressFileError

getAddresses

Get address suggestions for the given file id

GET /v1/public/suggestions

const { data } = await client.getAddresses({
  X-Epilot-Org-ID: 'example',
  s3FileUrl: 'example',
  fileId: 'example',
  countryCodeSearchTerm: 'example',
  postalCodeSearchTerm: 'example',
  streetSearchTerm: 'example',
})
Response
[
  {
    "country": "string",
    "postal_code": "string",
    "city": "string",
    "street": "string",
    "street_number": "string"
  }
]

checkAvailability

Check the availability of a given address within multiple files

GET /v1/public/availability:check

const { data } = await client.checkAvailability({
  X-Epilot-Org-ID: 'example',
  files: 'example',
  countryCode: 'example',
  postalCode: 'example',
  street: 'example',
  streetNumber: 'example',
})
Response
{
  "fileId": "4e7b7d95-ced6-4f5f-9326-0c61f30dcadb"
}

validateAddressesFile

Validates an addresses file, it returns an array of errors if the file is invalid

GET /v1/addresses-files:validate

const { data } = await client.validateAddressesFile({
  fileId: 'example',
})
Response
{
  "status": "success",
  "rules_parsed_count": 0,
  "errors": [
    {
      "line": 0,
      "msg": "string",
      "data": "string"
    }
  ]
}

Schemas

AvailabilityResult

type AvailabilityResult = {
  fileId?: string
}

Error

type Error = {
  message: string
  status?: number
  cause?: string
}

AddressSuggestion

The address suggestions entity

type AddressSuggestion = {
  country?: string
  postal_code?: string
  city?: string
  street?: string
  street_number?: string
}

AddressSuggestions

The address suggestions entity array

type AddressSuggestions = Array<{
  country?: string
  postal_code?: string
  city?: string
  street?: string
  street_number?: string
}>

ValidateAddressSuggestionsFileResult

The availability map file result payload

type ValidateAddressSuggestionsFileResult = {
  status?: "success" | "error"
  rules_parsed_count?: number
  errors?: Array<{
    line?: number
    msg: string
    data?: string
  }>
}

ValidateAddressFileResult

The address file validation result payload

type ValidateAddressFileResult = {
  status?: "success" | "error"
  rules_parsed_count?: number
  errors?: Array<{
    line?: number
    msg: string
    data?: string
  }>
}

AddressSuggestionError

The availability rule error

type AddressSuggestionError = {
  line?: number
  msg: string
  data?: string
}

ValidateAddressFileError

The address rule error

type ValidateAddressFileError = {
  line?: number
  msg: string
  data?: string
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.