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 'package:servicestack/servicestack.dart';

class Location implements IConvertible
{
    double? y;
    double? x;

    Location({this.y,this.x});
    Location.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        y = JsonConverters.toDouble(json['y']);
        x = JsonConverters.toDouble(json['x']);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'y': y,
        'x': x
    };

    getTypeName() => "Location";
    TypeContext? context = _ctx;
}

class Address implements IConvertible
{
    String? Street;
    String? Unit;
    String? City;
    String? State;
    String? Zip;
    String? ContactTitle;
    String? ContactName;
    String? ContactPhone;
    String? ContactEmail;
    Location? Location;
    String? SiteName;
    bool? GeocodeFailed;
    String? Country;

    Address({this.Street,this.Unit,this.City,this.State,this.Zip,this.ContactTitle,this.ContactName,this.ContactPhone,this.ContactEmail,this.Location,this.SiteName,this.GeocodeFailed,this.Country});
    Address.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Street = json['Street'];
        Unit = json['Unit'];
        City = json['City'];
        State = json['State'];
        Zip = json['Zip'];
        ContactTitle = json['ContactTitle'];
        ContactName = json['ContactName'];
        ContactPhone = json['ContactPhone'];
        ContactEmail = json['ContactEmail'];
        Location = JsonConverters.fromJson(json['Location'],'Location',context!);
        SiteName = json['SiteName'];
        GeocodeFailed = json['GeocodeFailed'];
        Country = json['Country'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Street': Street,
        'Unit': Unit,
        'City': City,
        'State': State,
        'Zip': Zip,
        'ContactTitle': ContactTitle,
        'ContactName': ContactName,
        'ContactPhone': ContactPhone,
        'ContactEmail': ContactEmail,
        'Location': JsonConverters.toJson(Location,'Location',context!),
        'SiteName': SiteName,
        'GeocodeFailed': GeocodeFailed,
        'Country': Country
    };

    getTypeName() => "Address";
    TypeContext? context = _ctx;
}

/**
* 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
*/
class Geocode implements IConvertible
{
    String? Workspace;
    List<Address>? Addresses;

    Geocode({this.Workspace,this.Addresses});
    Geocode.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Workspace = json['Workspace'];
        Addresses = JsonConverters.fromJson(json['Addresses'],'List<Address>',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Workspace': Workspace,
        'Addresses': JsonConverters.toJson(Addresses,'List<Address>',context!)
    };

    getTypeName() => "Geocode";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'dev.fieldsquared.com', types: <String, TypeInfo> {
    'Location': TypeInfo(TypeOf.Class, create:() => Location()),
    'Address': TypeInfo(TypeOf.Class, create:() => Address()),
    'Geocode': TypeInfo(TypeOf.Class, create:() => Geocode()),
    'List<Address>': TypeInfo(TypeOf.Class, create:() => <Address>[]),
});

Dart Geocode DTOs

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

HTTP + XML

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: application/xml