Skip to content

Profile Management API

Hao Nguyen edited this page Sep 4, 2018 · 4 revisions

Hiện tại, chúng ta đã có API cho Country, States và Profile

Country API

1. Get all countries

url: /api/country

method: GET

request: none

response:

[ { "id": 4, "capital": "Kabul", "citizenship": "Afghan", "country_code": "004", "currency": "afghani", "currency_code": "AFN", "currency_sub_unit": "pul", "currency_symbol": "؋", "currency_decimals": 2, "full_name": "Islamic Republic of Afghanistan", "iso_3166_2": "AF", "iso_3166_3": "AFG", "name": "Afghanistan", "region_code": "142", "sub_region_code": "034", "eea": 0, "calling_code": "93", "flag": "AF.png" } ]

States API

1. Get all States

url: /api/states

method: GET

request: none

response:

[ { "id": 1, "iso_3166_2": "AL", "name": "Alabama", "country_code": "US" } ]

Profile API

1. Get all User Profile

url: /api/profile

method: GET

request: none

response:

[ { "id": 1, "name": "Administrator", "email": "admin@greenx.network", "created_at": "2018-09-02 16:18:47", "updated_at": "2018-09-02 16:18:47", "confirmed": 1, "confirmation_code": null, "date_of_birth": null, "phone": null, "street_1": null, "street_2": null, "address": null, "city": null, "state": null, "zipcode": null, "country_id": null, "identity_type": null, "identity_number": null, "identity_image": null, "kyc_status": 1, "referred_by": null, "address_id": null, "status": 0, "last_login_on": null, "language": "en", "first_login": 1, "force_password_change": 1, "failed_login_count": 0, "last_failed_login_on": null } ]

2. Get User Profile by ID

url: /api/profile/{:id}

method: GET

request: none

response:

[ { "id": 1, "name": "Administrator", "email": "admin@greenx.network", "created_at": "2018-09-02 16:18:47", "updated_at": "2018-09-02 16:18:47", "confirmed": 1, "confirmation_code": null, "date_of_birth": null, "phone": null, "street_1": null, "street_2": null, "address": null, "city": null, "state": null, "zipcode": null, "country_id": null, "identity_type": null, "identity_number": null, "identity_image": null, "kyc_status": 1, "referred_by": null, "address_id": null, "status": 0, "last_login_on": null, "language": "en", "first_login": 1, "force_password_change": 1, "failed_login_count": 0, "last_failed_login_on": null } ]

3. Update User Profile by ID

url: /api/profile/{:id}

method: PUT

request:

{ "name": "asdfasdf", "email": "admin@greenx.network", "created_at": "2018-09-02 13:44:10", "updated_at": "2018-09-02 14:40:08", "confirmed": 1, "confirmation_code": null, "date_of_birth": null, "phone": "2018-08-27", "street_1": "Hao Nguyen Tetsdf", "street_2": null, "address": null, "city": null, "state": null, "zipcode": null, "country_id": null, "identity_type": null, "identity_number": null, "identity_image": null, "kyc_status": 1, "referred_by": null, "address_id": null, "status": 0, "last_login_on": null, "language": "VN", "first_login": 1, "force_password_change": 1, "failed_login_count": 0, "last_failed_login_on": null }

response:

{ "id": 1, "name": "asdfasdf", "email": "admin@greenx.network", "created_at": "2018-09-02 16:18:47", "updated_at": "2018-09-04 03:13:12", "confirmed": 1, "confirmation_code": null, "date_of_birth": null, "phone": "2018-08-27", "street_1": "Hao Nguyen Tetsdf", "street_2": null, "address": null, "city": null, "state": null, "zipcode": null, "country_id": null, "identity_type": null, "identity_number": null, "identity_image": null, "kyc_status": 1, "referred_by": null, "address_id": null, "status": 0, "last_login_on": null, "language": "VN", "first_login": 1, "force_password_change": 1, "failed_login_count": 0, "last_failed_login_on": null }