/
Address REST API
Address REST API
Working with a single address
Method | Result |
---|---|
URI | https://[CompanyID].crittah.com/ws/apiv2/[json or xml]/address/[idaddress] |
DELETE | Not supported |
GET | Returns data for one address |
POST | Create or modify only the supplied data for one address; returns address data after request |
PUT | Not supported |
Data fields
Field | Value type | Mandatory | Description | Example |
---|---|---|---|---|
IDAddress | string | Unique identifier of the address. | 7090fad1-c4da-4488-9ceb-55ee9847edcc | |
AddressLine1 | string | Line 1 of the address | Unit 21 | |
AddressLine2 | string | Line 2 of the address | 376 John Street | |
City | string | City | Sydney | |
State | string | State | NSW | |
Country | string | Country | Australia | |
PostCode | string | PostCode | 2000 | |
LocRef | LocRef Object | Location reference object containing the Longitude and Latitude | { "IDLocation": "e97c85a5-62c0-4e13-bb63-ed8a43050360", |
Examples
Get a address details
Sample cURL call:
curl -H "Content-Type: application/json" \ -H "API-AppID: ce207c9e-8508-4913-9589-2bd5077845fe" \ -H "Api-Username: jskurray3" \ -H "API-Password: abc123" \ http://YourCompanyID.crittah.com/ws/apiv2/xml/address/[Address ID]
JSON Rsponse:
{ "IDAddress": "04cec8bb-d612-4dff-b838-ae8ff2504383", "AddressLine1": "26 Wolongong ROad", "AddressLine2": null, "City": "ARNCLIFFE", "State": "NSW", "IDCountry": 1013, "Country": "Australia", "PostCode": "2225", "LocRef": { "IDLocation": "2fc43358-378c-438c-953e-f3e69cc5c97f", "LatLng": { "Lat": -33.22813, "Lng": 151.146104 } } }
XML Response:
<?xml version="1.0" encoding="UTF-8"?> <AddressObj xmlns="http://schemas.datacontract.org/2004/07/Spinifex.lib.objects" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <IDAddress>04cec8bb-d612-4dff-b838-ae8ff2504383</IDAddress> <AddressLine1>26 Wolongong ROad</AddressLine1> <AddressLine2 i:nil="true" /> <City>ARNCLDDDDE</City> <State>NSW</State> <IDCountry>1013</IDCountry> <Country>Australia</Country> <PostCode>2225</PostCode> <LocRef> <IDLocation>2fc43358-378c-438c-953e-f3e69cc5c97f</IDLocation> <LatLng> <Lat>-33.22813</Lat> <Lng>151.146104</Lng> </LatLng> </LocRef> </AddressObj>
Create Address
Add the follow contents to a file called "address.data"
{ "AddressLine1": "26 Wolongong ROad", "AddressLine2": null, "City": "ARNCLIFFE", "State": "NSW", "IDCountry": 1013, "Country": "Australia", "PostCode": "2225", "LocRef": { "IDLocation": "2fc43358-378c-438c-953e-f3e69cc5c97f", "LatLng": { "Lat": -33.22813, "Lng": 151.146104 } } }
Run the following command
curl -X POST -d address.data \ -H "Content-Type: application/json" \ -H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \ -H "Api-Username: jsmith" \ -H "API-Password: abc123" \ http://YourCompanyID.crittah.com/ws/apiv2/json/address
Update Address
Add the following contents to a file calles "update_address.data"
{ "AddressLine1": "26 Wolongong Street", "City": "EARLWOOD" }
Run the follow cURL command
curl -X POST -d update_address.data \ -H "Content-Type: application/json" \ -H "API-AppID: 7090fad1-c4da-4488-9ceb-55ee9847edcc" \ -H "Api-Username: jsmith" \ -H "API-Password: abc123" \ http://YourCompanyID.crittah.com/ws/apiv2/json/address/[idaddress to update]