Table of Contents

Class AddressValidationRequest

Namespace
GoogleMapsApi.Entities.AddressValidation.Request
Assembly
GoogleMapsApi.dll

Request for the Google Address Validation API (POST https://addressvalidation.googleapis.com/v1:validateAddress). Validates a postal address, returning a strongly-typed verdict, the address as Google understands it, geocoding data, and (for US addresses with EnableUspsCass) USPS CASS-processed data.

public sealed class AddressValidationRequest : MapsBaseRequest
Inheritance
AddressValidationRequest
Inherited Members

Properties

Address

The postal address to validate. RegionCode is required; supply AddressLines plus locality/postal information for meaningful results.

public PostalAddress Address { get; set; }

Property Value

PostalAddress

EnableUspsCass

If true, enables USPS CASS processing for US/PR addresses. Adds uspsData to the response. US-only; ignored for other regions.

public bool EnableUspsCass { get; set; }

Property Value

bool

LanguageOptions

Optional language preferences applied to the validation response.

public LanguageOptions? LanguageOptions { get; set; }

Property Value

LanguageOptions

PreviousResponseId

The ResponseId returned by a prior call to this API. Set this when re-validating the same address after a user has edited it; Google will then group calls into a single validation session for billing and accuracy purposes.

public string? PreviousResponseId { get; set; }

Property Value

string

SessionToken

Session token used to group multiple Address Validation calls into a single validation session for billing. Generate one UUID per end-user session.

public string? SessionToken { get; set; }

Property Value

string

Methods

GetRequestBody()

Builds the body to send with this request, or null for endpoints that use GET with query-string parameters only. Derived requests that target POST-based endpoints (for example, Address Validation) override this to return a JSON HttpContent; when the engine sees a non-null body it issues a POST instead of a GET.

protected override HttpContent? GetRequestBody()

Returns

HttpContent

The HTTP content to send, or null for a GET request.

GetUri()

Builds the absolute request URI, including scheme, base URL, and serialized query-string parameters.

public override Uri GetUri()

Returns

Uri

The fully composed URI to send to the Google Maps API.