User
The details of the current user that is authenticated in the application may be required throughout the application. A user also has a profile where extended information may be retrieved.
API
User (Retrieve)
The user endpoint retrieves the base information for the current user, such as their email address and provides endpoint links for their user profile and address.
Endpoints
Multiple endpoints serve the user information. If the user uuid is known this may be used too.
Request
curl -X 'GET' \
'https://st.igate-test.co.uk/api/v1/auth/user/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json'
curl -X 'GET' \
'https://st.igate-test.co.uk/api/v1/users/c0eb56f0-453a-4520-b392-75f38c6fe1d8/' \
-H 'accept: application/json'
Response
Type: 200 OK
{
"url": "https://st.igate-test.co.uk/api/v1/users/c0eb56f0-453a-4520-b392-75f38c6fe1d8/",
"uuid": "c0eb56f0-453a-4520-b392-75f38c6fe1d8",
"username": "sterling@sterling.com",
"email": "sterling@sterling.com",
"accepts_terms": true,
"accepts_marketing": true,
"profile": "https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/",
"address": "https://st.igate-test.co.uk/api/v1/user/address/898c6364-eaff-49bc-8ce6-7256029a81d1/",
"vehicles": [],
"occupations": []
}
User Profile (Retrieve)
The user profile stores extended information about a user.
Request
curl -X 'GET' \
'https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json'
Response
Type: 200 OK
{
"url": "https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/",
"uuid": "cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee",
"created_at": "2024-11-29T09:49:24.049001Z",
"updated_at": "2024-11-29T09:49:24.049093Z",
"first_name": "John",
"last_name": "Smith",
"preferred_name": "John Smith",
"phone_number": null,
"gender_id": null,
"gender_name": null,
"marital_status_id": null,
"marital_status_name": null,
"date_of_birth": null,
"driving_licence_number": null,
"licence_type_id": null,
"licence_type_name": null,
"date_licence_obtained": null,
"home_owner": null,
"uk_resident_since_birth": null,
"uk_resident_years": null,
"receive_notifications": null,
"email_subscriptions": null,
"sms_alerts": null
}