The address check API allows customers to query the validity of addresses.

Query

There are several ways of specifying the address or addresses. Every address must have between 3 and 6 components (lines).

URL: https://easymail.com/publicinterface/jsonrpc
HTTP verb: POST

Single address as array of strings:

{
	"jsonrpc" : "2.0", 
	"method" : "addr_check", 
	"id" : 1,
	"params" : {
		"address": [
			"Joe Blogs",
			"10 Jones St",
			"Smithville NSW 2987"
		]
	}
}

Single address as single string with embedded newlines:

{
	"jsonrpc" : "2.0", 
	"method" : "addr_check", 
	"id" : 1,
	"params" : {
		"address": "Joe Blogs\n10 Jones St\nSmithville NSW 2987"
	}
}

Single address as single string with comma separation:
(not recommended, commas in the data will be misinterpreted)

{
	"jsonrpc" : "2.0", 
	"method" : "addr_check", 
	"id" : 1,
	"params" : {
		"address": "Joe Blogs, 10 Jones St, Smithville NSW 2987"
	}
}

Multiple address (Note the address parameter changes to "addresses"):

{
	"jsonrpc" : "2.0", 
	"method" : "addr_check", 
	"id" : 1,
	"params" : {
		"addresses" : [
		[
			"Joe Blogs",
			"10 Jones St",
			"Smithville NSW 2987"
		],
		[
			"Jane Blogs",
			"20 Jones St",
			"Jonesville NSW 2987"
		],

		"Steve Blogs, 30 Jones St, Jonesville NSW 2987",

		"Bob Blogs\n40 Jones Street\nJonesville NSW 2987"

		]
	}
}

Reponse

The responses are always returned in the same order as the requests.

The response (which includes the request address) looks like:

{
	"jsonrpc": "2.0",
	"id": 1,
	"result": {
		"status": "unmatched",
		"nation": "AUS",
		"address": [
			"Joe Blogs",
			"10 Jones St",
			"Smithville NSW 2987"
		]
	}
}

or

{
    "jsonrpc":  "2.0",
    "result":  [
                   {
                       "status":  "matched",
                       "nation":  "AUS",
                       "address":  [
                                       "Joe Blogs",
                                       "10 Jones St",
                                       "Smithville NSW 2987"
                                   ]
                   },
                   {
                       "status":  "matched",
                       "nation":  "AUS",
                       "address":  [
                                       "Jane Blogs",
                                       "20 Jones St",
                                       "Jonesville NSW 2987"
                                   ]
                   },
                   {
                       "status":  "matched",
                       "nation":  "AUS",
                       "address":  "Steve Blogs, 30 Jones St, Jonesville NSW 2987"
                   },
                   {
                       "status":  "matched",
                       "nation":  "AUS",
                       "address":  "Bob Blogs\n40 Jones Street\nJonesville NSW 2987"
                   }
               ],
    "id":  1
}

 

Status

"status" can be "invalid", "unmatched", "matched" or "international".

An invalid response will include a "message" suggesting what is wrong.

Using cURL

Example using "cURL" (http://curl.haxx.se), with the json RPC query.

          stored in a file named "query.json":

curl -d @query.json -H "Content-Type:text/json" "https://easymail.com/publicinterface/jsonrpc"