Hi Nikhil, Is the country id the ISO-3166-1 country numeric identifier?
Greets, Myrle *Myrle Krantz* Solutions Architect RɅĐɅЯ, The Mifos Initiative mkra...@mifos.org | Skype: mkrantz.mifos.org | http://mifos.org <http://facebook.com/mifos> <http://www.twitter.com/mifos> On Mon, Jul 4, 2016 at 2:55 PM, Nikhil Pawar <nickr...@gmail.com> wrote: > Hello Markus,Myrle,Adi,Nazeer > > > As we have agreed in previous mail chain regarding adding of Address API > as part of core product, I thought of completing its development prior to > other dependent modules. > > I have come up with REST API docs for this module and wanted your > feedback.Kindly provide your feedback as soon as possible, since this is a > pre-requisite for other modules. Please note that I have added an > additional field 'is_active' to support address change of same type of > address( and also to keep track of past address for audit purpose). > > > > 1. Create new address for client: > > > POST https://DomainName/api/v1/clients/{clientid}/address/ > > *Sample request:* > > > POST address > > Content-Type: application/json Request Body: > > { > > "address_type": 1, > > "street": "507 west street", > > "address_line_1": "apt no 5", > > "address_line_2": "opposite to college park", > > "city":"Dallas", > > "state_province_id":1, > > "country_id":2, > > "postal_code":"40041", > > } > > > > 2. Retrieve all addresses of all types for particular client: > > > GET https://DomainName/api/v1/clients/{clientid}/address/ > > > *Sample response:* > > > [ > > { > > "clientId":1, > > "addressId":2, > > "address_type": 1, > > "street": "507 west street", > > "address_line_1": "apt no 5", > > "address_line_2": "opposite to college park", > > "city":"Dallas", > > "state_province_id":1, > > "country_id":2, > > "postal_code":"40041", > > "is_active":1 > > }, > > { > > "clientId":2, > > "addressId":3, > > "address_type": 1, > > "street": "100 west street", > > "address_line_1": "apt no 7", > > "address_line_2": "opposite to college park", > > "city":"Dallas", > > "state_province_id":1, > > "country_id":2, > > "postal_code":"40041", > > "is_active":0 > > } > > ] > > > > 3. Retreive all addresses of particular type for specified client > > > GET https://DomainName/api/v1/clients/{clientid}/address/{addtypId} > > *Sample response:* > > > [ > > { > > "clientId":2, > > "addressId":2, > > "address_type": 1, > > "street": "507 west street", > > "address_line_1": "apt no 5", > > "address_line_2": "opposite to college park", > > "city":"Dallas", > > "state_province_id":1, > > "country_id":2, > > "postal_code":"40041", > > "is_active":0 > > }, > > { > > "clientId":2, > > "addressId":2, > > "address_type": 1, > > "street": "100 west street", > > "address_line_1": "apt no 7", > > "address_line_2": "opposite to college park", > > "city":"Dallas", > > "state_province_id":1, > > "country_id":2, > > "postal_code":"40041", > > "is_active":1 > > } > > ] > > > > > > > 4. Retrieve active address of particular type for specified clientid > > > GET > https://DomainName/api/v1/clients/{clientid}/address/{addtypId}?command=active > > > Sample response: > > { > > "clientId":1, > > "addressId":2, > > "address_type": 1, > > "street": "507 west street", > > "address_line_1": "apt no 5", > > "address_line_2": "opposite to college park", > > "city":"Dallas", > > "state_province_id":1, > > "country_id":2, > > "postal_code":"40041", > > "40041", > > "is_active":1 > > } > > > > 5. update: > > > update particular "active" address of client > > PUT https://DomainName/api/v1/clients/{clientid}/address/{addtypId} > > sample request > > { > > is_active:false > > } > > > supported fields: > > address line fields,addresstypeid,is_active > > > > Regards, > > Nikhil > >