# Perform action for a single business

Uses HTTP GET to accept one input record and returns the response in XML format.

Endpoint: GET /{action}/{geographicType}

## Path parameters:

  - `action` (string, required)
    There are two available actions:
- `get`
 - Get count of addresses that fit in the given criteria.
- `buy`
 - Buy a list of addresses' info that fit the given criteria.

  - `geographicType` (string, required)
    The included [Geographic Types](https://docs.melissa.com/reference-data/leadgen-business/leadgen-business-reference-guide.html#geographic-types) are zip, city, county, state, radius, circle, and polygon.

## Query parameters:

  - `id` (string, required)
    Requester's customer ID or email address

  - `zip` (string)
    Geographic Type
* Required: zip
* Optional: radius

Handling: Each five-digit ZIP is validated.

  - `zip+4` (string)
    Geographic Type
* Required: zip
* Optional: radius

Handling: Plus4 is a filter in data selection.

  - `city` (string)
    Geographic Type
* Required: city
* Optional: radius

Handling: Each city and state combination is valid

  - `county` (string)
    Geographic Type
* Required: county

Handling: Each county and state combination is validated. FIPS is retrieved if valid.

  - `state` (string)
    Geographic Type
* Required: state
* Optional: radius

Handling: Two-digit state code is validated.

  - `addr` (string)
    Geographic Type
* Required: radius

Handling: Exact street number and street name are used in data selection. No validation. Latitude and longitude are retrieved if the address exists.

  - `mile` (string)
    Geographic Type
* Required: circle
* Optional: radius

(Mile or record must be given.)

Handling: Mile is used to find out the latitude and longitude of a parameter for many miles away from the given address. For radius type, maximum is 50 miles. For circle type, the radius must be between .025 and 25 miles

  - `records` (string)
    Geographic Type
* Optional: radius

(Mile or record must be given.)

Handling: Number of records that are closest to the given address

  - `str` (string)
    Geographic Type
* Optional: radius

Handling: A street name within the given zip. (The street name needs to be exact.)

  - `strzip` (string)
    Geographic Type
* Optional: radius

Handling: Zip for a specific street that is within the given radius (combination with a given address.)

  - `pt` (string)
    Geographic Type
* Required: circle

Handling: A longitude;latitude point

  - `points` (string)
    Geographic Type
* Required: polygon

Handling: Each set of points for a polygon is validated and reoriented in the sequence of drawing.

  - `sic` (string)
    Meanings: Append 6- digit SIC code to file if exists
Default: sic=0
To Append: sic=1

  - `sic-d` (string)
    Meanings: Various SIC codes as selection/filter
Default: all inclusive
To Append: Otherwise specify the SIC's (2 to 6 digits), use '-'' dash to specify multiple SIC codes, i.e. sic-d=17-9999-729924

  - `staff` (string)
    Meanings: Append number of employees to file
Default: staff=0
To Append: staff=1

  - `staff-d` (string)
    Meanings: Various sizes of staff as selection/filter
1. 1 - 4
2. 5 - 9
3. 10 - 19
4. 20 - 49
5. 50 - 99
6. 100 - 249
7. 250 - 499
8. 500 - 999
9. 1,000 - 4,999
10. 5,000 - 9,999
11. 10,000

Default: all inclusive
To Append: Otherwise specify the index; use '-' dash to specify multiple staff codes, i.e. staff-d=6-8-10

  - `sale` (string)
    Meanings: Append annual sales volume to file
Default: sale=0
To Append: sale=1

  - `sale-d` (string)
    Meanings: Various ranges of annual sales volumes as selection/filter
1. $1,000-$499,999
2. $500,000-$999,999
3. $1,000,000-$2,499,999
4. $2,500,000-$4,999,999
5. $5,000,000-$9,999,999
6. $10,000,000-$19,999,999
7. $20,000,000-$49,999,999
8. $50,000,000-$99,999,999
9. $100,000,000-$499,999,999
10. $500,000,000-$999,999,999
11. Over $1 billion

Default: all inclusive
To Append: Otherwise specify the index; use '-' dash to specify multiple sales volume codes, i.e. sale-d=6-8-10

  - `contacttitle-d` (string)
    Meanings: Various ContactTitle as selection/filter
Default: all
To Append: use ‘,’ comma to specify multiple contacttitles
contacttitle-d=1,2,3

  - `title-d` (string)
    Meanings: Various Title as selection/filter
Default: all
To Append: use ‘,’ comma to specify multiple titles
title-d=DDS,DPT

  - `one` (string)
    One contact per business
Default Value: one=1
Optional Output Parameter: one=0 returns all contacts

  - `dbug` (string)
    Parameter check. If a parameter is spelt wrong or not suited for the given call, the request will be rejected.
Default Value: dbug=0
Optional Output Parameter: dbug=1 to check

  - `name` (string)
    Append contact name and gender to file if exists
Default Value: name=0
Optional Output Parameter: To append: name=1

  - `po` (string)
    Customer's purchase order number
Default Value: none
Optional Output Parameter: To specify: po=xxxx

  - `multi` (string)
    By default, purchased lists may be used once. With this parameter included in the Buy call, you can purchase the right to use a list for multiple mailings. Specify the number of uses like this: multi=4. The maximum number of uses allowed for any purchased list is 5.
Default Value: multi=1
Optional Output Parameter: multi=(1 through 5)

  - `file` (string)
    Defines the desired file format of a purchased list.
Default Value: file=8
Optional Output Parameter:
- `2`
 - File Format: Zipped .txt
- `3`
 - File Format: Zipped .csv
- `5`
 - File Format: Zipped .xls (Excel)
- `7`
 - File Format: .txt
- `8`
 - (Default) File Format: .csv
- `10`
 - File Format: .xls (Excel)

  - `fax` (string)
    Append fax number (if available)
Default Value: fax=0
Optional Output Parameter: fax=1

  - `phone` (string)
    Append phone number (if available)
Default Value: phone=0
Optional Output Parameter: phone=1

  - `naics` (string)
    Append 8-digit NAICS code to file if exists
Default Value: naics=0
Optional Output Parameter: naics=1

  - `numemp` (string)
    Appends the number of actual employees (as opposed to a range like staff)
Default Value: numemp=0
Optional Output Parameter: numemp=1

  - `keyexec` (string)
    Appends the Key Executive to file
Default Value: keyexec=0
Optional Output Parameter: keyexec=1

  - `numsales` (string)
    Appends the estimated sales volume in thousands (as opposed to a range like sale)
Default Value: numsales=0
Optional Output Parameter: numsales=1

## Header parameters:

  - `Accept` (string, required)
    Format of the response.

  - `Content-Type` (string, required)
    Format of the request.

## Response 200:

  - `200` (unknown)
    Successful response

## Response 200 fields (application/xml):

  - `TransmissionReference` (string)
    Serves as a unique request identifier.

  - `Version` (string)
    The current service version number.

  - `TransmissionResults` (string)
    Lists error codes from any errors caused by the most recent request as a whole.

  - `TotalRecords` (string)
    Total number of records.

  - `Geography` (object)
    Geo request.

  - `Geography.Address` (string)
    Requests within Geo Selects. Tags returned depend on Geo type.

  - `Geography.City` (string)

  - `Geography.County` (string)

  - `Geography.State` (string)

  - `Geography.Zip` (string)
    For radius type only.

  - `Geography.Records` (string)

  - `Geography.Circle` (string)

  - `Geography.Miles` (string)

  - `Geography.Polygons` (string)

  - `Options` (object)
    Requests within Geo Selects. Tags returned depend on Geo type.

  - `Options.ContactPersonInfo` (object)
    One per business / All contacts

  - `Options.ContactPersonInfo.ContactPersonInfo` (string)

  - `Options.NumberOfEmployees` (object)
    Number of employees of the business

  - `Options.NumberOfEmployees.Details` (string)

  - `Options.NumberOfEmployees.IncludeAll` (string)
    Default output is True, unless details options are specified in request. For example, 100 - 249;500 - 999;5,000 - 9,999 would be shown with all chosen options separated by semi colon

  - `Options.NumberOfEmployees.AppendToFile` (string)
    True or False

  - `Options.AnnualSalesVolume` (object)
    Various ranges of annual sales volumes

  - `Options.AnnualSalesVolume.Details` (string)

  - `Options.AnnualSalesVolume.IncludeAll` (string)

  - `Options.AnnualSalesVolume.AppendToFile` (string)

  - `Options.SIC` (object)
    6-digit SIC code

  - `Options.SIC.Details` (string)

  - `Options.SIC.IncludeAll` (string)

  - `Options.SIC.AppendToFile` (string)

  - `Options.Email` (object)

  - `Options.Email.Details` (string)

  - `Options.Email.AppendToFile` (string)

  - `CountDetails` (object)

  - `CountDetails.StreetRange` (array)
    Contains a breakdown of the street range.

  - `CountDetails.StreetRange.Street` (object)
    Individual streets.

  - `CountDetails.StreetRange.Street.StartNumber` (string)
    For Geo types radius. Shows the starting street number in the count.

  - `CountDetails.StreetRange.Street.EndNumber` (string)
    For Geo types radius. Shows the starting ending number in the count.

  - `CountDetails.StreetRange.Street.Geography` (string)

  - `CountDetails.StreetRange.Street.ZIP` (string)

  - `CountDetails.StreetRange.Street.Count` (string)

  - `TotalCount` (object)
    Total number of records returned with the selected options.

  - `TotalCount.Count` (string)
    Location of count detail. The location varies by the request type

  - `Result` (object)
    Indicates the status of a request. Returns Declined, Approved, or Err.

  - `Result.StatusCode` (string)
    Indicates the status

## Response 400:

  - `400` (unknown)
    Bad Request

## Response 400 fields (application/json):

  - `type` (string)
    The type of error that occurred.

  - `title` (string)
    A short summary of the error.

  - `status` (string)
    The HTTP status code for the error.

  - `errors` (object)

  - `errors.$.<PropertyName>` (array)
    A detailed message about the error.

  - `traceId` (string)
    A unique identifier for the request, useful for debugging.

