Field Squared API Services

<back to all web services

Geocode

Represents a DTO for a geocode request/response in a workspace. Usage is as follows
/Geocode?street=1514 Blake St&city=Denver&state=CO&zip=80209

The following routes are available for this service:
GET/{Workspace}/Geocode
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Location:
    y: float = 0.0
    x: float = 0.0


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Address:
    street: Optional[str] = None
    unit: Optional[str] = None
    city: Optional[str] = None
    state: Optional[str] = None
    zip: Optional[str] = None
    contact_title: Optional[str] = None
    contact_name: Optional[str] = None
    contact_phone: Optional[str] = None
    contact_email: Optional[str] = None
    location: Optional[Location] = None
    site_name: Optional[str] = None
    geocode_failed: bool = False
    country: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Geocode:
    """
    Represents a DTO for a geocode request/response in a workspace.  Usage is as follows  /Geocode?street=1514 Blake St&city=Denver&state=CO&zip=80209
    """

    workspace: Optional[str] = None
    addresses: Optional[List[Address]] = None

Python Geocode DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /{Workspace}/Geocode HTTP/1.1 
Host: dev.fieldsquared.com 
Accept: text/jsv