Profile
In the ‘My Details’ section of the app the user may update their profile.
API
User Profile (Retrieve)
The user profile is available from the user profile endpoint.
Response
Below is a response that would correspond to the screenshot above.
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": "Mike",
"last_name": "Smith",
"preferred_name": "Mike Smith",
"phone_number": "+81234567890",
"gender_id": "male",
"gender_name": "Male",
"marital_status_id": "2",
"marital_status_name": "Married",
"date_of_birth": "1982-11-08",
"driving_licence_number": "12345678",
"licence_type_id": "1",
"licence_type_name": "Full (UK)",
"date_licence_obtained": "1999-12-12",
"home_owner": false,
"uk_resident_since_birth": true,
"uk_resident_years": null,
"receive_notifications": true,
"email_subscriptions": false,
"sms_alerts": false
}
Preferred Name (Update)
Screenshots
Request
Key:
preferred_name
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"preferred_name": "Mike Smith"
}'
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": "Mike",
"last_name": "Smith",
"preferred_name": "Mike Smith",
"phone_number": "+81234567890",
"gender_id": "male",
"gender_name": "Male",
"marital_status_id": "2",
"marital_status_name": "Married",
"date_of_birth": "1982-11-08",
"driving_licence_number": "12345678",
"licence_type_id": "1",
"licence_type_name": "Full (UK)",
"date_licence_obtained": "1999-12-12",
"home_owner": false,
"uk_resident_since_birth": true,
"uk_resident_years": null,
"receive_notifications": true,
"email_subscriptions": false,
"sms_alerts": false
}
Email (Update)
A users account email is updated by performing a PATCH request to the user endpoint.
Screenshots
Endpoints
Multiple endpoints serve the user information. If the user uuid is known this may be used too.
Request
Key:
email
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/auth/user/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"email": "example@gmail.com"
}'
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/users/c0eb56f0-453a-4520-b392-75f38c6fe1d8/' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"email": "example@gmail.com"
}'
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": "example@gmail.com",
"email": "example@gmail.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/26fc4e79-6490-4728-9aa8-a6da4c51453a/",
"vehicles": [],
"occupations": []
}
Phone number (Update)
A user may update the phone number associated ith their account by performing a PATCH request to the user profile endpoint.
Screenshots
Request
Key:
phone_number
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"phone_number": "+12345678910"
}'
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": "Mike",
"last_name": "Smith",
"preferred_name": "Mike Smith",
"phone_number": "+12345678910",
"gender_id": "male",
"gender_name": "Male",
"marital_status_id": "2",
"marital_status_name": "Married",
"date_of_birth": "1982-11-08",
"driving_licence_number": "12345678",
"licence_type_id": "1",
"licence_type_name": "Full (UK)",
"date_licence_obtained": "1999-12-12",
"home_owner": false,
"uk_resident_since_birth": true,
"uk_resident_years": null,
"receive_notifications": true,
"email_subscriptions": false,
"sms_alerts": false
}
Address (Retrieve)
A url reference to the users address may be found from the user endpoint. The address details can be retrieved by the address endpoint.
Screenshots
Response
Type: 200 OK
{
"url": "https://st.igate-test.co.uk/api/v1/user/address/898c6364-eaff-49bc-8ce6-7256029a81d1/",
"uuid": "898c6364-eaff-49bc-8ce6-7256029a81d1",
"created_at": "2025-01-16T14:04:18.810168Z",
"updated_at": "2025-01-16T14:08:58.204937Z",
"postcode": "PE301JW",
"house": "18",
"street": "Tuesday Market Place",
"city": "King's Lynn",
"county": "Norfolk",
}
Address (Update)
A reference about how to update a users address can be seen on the address update endpoint. An example response in the context of the profile can be seen below.
Response
Type: 200 OK
{
"url": "https://st.igate-test.co.uk/api/v1/user/address/898c6364-eaff-49bc-8ce6-7256029a81d1/",
"uuid": "898c6364-eaff-49bc-8ce6-7256029a81d1",
"created_at": "2025-01-16T14:04:18.810168Z",
"updated_at": "2025-01-16T14:08:58.204937Z",
"postcode": "PE301JW",
"house": "19",
"street": "Tuesday Market Place",
"city": "King's Lynn",
"county": "Norfolk"
}
Note Here the “house” key went from 18 to 19.
Date of Birth (Update)
A user may update their date of birth by performing a patch request to the user profile endpoint.
Notes
Date must be in the format
YYYY-MM-DDwhen sent to the service.
Screenshots
Request
Key:
date_of_birth
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"date_of_birth": "1996-10-09"
}'
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": "Mike",
"last_name": "Smith",
"preferred_name": "Mike Smith",
"phone_number": "+81234567890",
"gender_id": "male",
"gender_name": "Male",
"marital_status_id": "2",
"marital_status_name": "Married",
"date_of_birth": "1996-10-09",
"driving_licence_number": "12345678",
"licence_type_id": "1",
"licence_type_name": "Full (UK)",
"date_licence_obtained": "1999-12-12",
"home_owner": false,
"uk_resident_since_birth": true,
"uk_resident_years": null,
"receive_notifications": true,
"email_subscriptions": false,
"sms_alerts": false
}
Name (Update)
A user may update their name by sending a PATCH request to the user profile endpoint.
Notes
- Middle name has been added to user profile and must added as a field in the screenshot below between first
and last name.
Screenshots
Request
keys:
first_name,last_name
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"first_name": "Mike",
"last_name": "Smith"
}'
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": "Mike",
"last_name": "Smith",
"preferred_name": "Mike Smith",
"phone_number": "+81234567890",
"gender_id": "male",
"gender_name": "Male",
"marital_status_id": "2",
"marital_status_name": "Married",
"date_of_birth": "1996-10-09",
"driving_licence_number": "12345678",
"licence_type_id": "1",
"licence_type_name": "Full (UK)",
"date_licence_obtained": "1999-12-12",
"home_owner": false,
"uk_resident_since_birth": true,
"uk_resident_years": null,
"receive_notifications": true,
"email_subscriptions": false,
"sms_alerts": false
}
Gender (Update)
The list of genders available can be retrieved using the gender metadata.
To update a users gender a PATCH request should be sent with the selected key and value from the metadata list
as gender_id, gender_name respectively.
Screenshots
Request
Keys:
gender_id,gender_name
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"gender_id": "male",
"gender_name": "Male"
}'
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": "Mike",
"last_name": "Smith",
"preferred_name": "Mike Smith",
"phone_number": "+81234567890",
"gender_id": "male",
"gender_name": "Male",
"marital_status_id": "2",
"marital_status_name": "Married",
"date_of_birth": "1996-10-09",
"driving_licence_number": "12345678",
"licence_type_id": "1",
"licence_type_name": "Full (UK)",
"date_licence_obtained": "1999-12-12",
"home_owner": false,
"uk_resident_since_birth": true,
"uk_resident_years": null,
"receive_notifications": true,
"email_subscriptions": false,
"sms_alerts": false
}
Driving Licence Number (Update)
A list of driving licence types may be found on the licence type metadata endpoint.
Notes
To update licence type both
licence_type_idandlicence_type_nameshould be updated with the correspondingkey,valuefrom the selected metadata.date_licence_obtainedmust be in the formatYYYY-MM-DDwhen sent to the service.
Screenshots
Request
Keys:
licence_type_id,licence_type_name,date_licence_obtained,driving_licence_number.
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"licence_type_id": "fulluk",
"licence_type_name": "Full UK Car Licence",
"date_licence_obtained": "2011-01-08",
"driving_licence_number": "X7X"
}'
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": "2025-01-23T09:17:13.731448Z",
"updated_at": "2025-01-23T15:50:17.676674Z",
"first_name": "Mike",
"last_name": "Smith",
"preferred_name": "Mike Smith",
"phone_number": "+81234567890",
"gender_id": "male",
"gender_name": "Male",
"marital_status_id": "2",
"marital_status_name": "Married",
"date_of_birth": "1996-10-09",
"driving_licence_number": "X7X",
"licence_type_id": "fulluk",
"licence_type_name": "Full UK Car Licence",
"date_licence_obtained": "2011-01-08",
"home_owner": false,
"uk_resident_since_birth": true,
"uk_resident_years": null,
"receive_notifications": true,
"email_subscriptions": false,
"sms_alerts": false
}
UK Residence (Update)
To update a users uk residence status a PATCH request should be sent to the user profile endpoint.
Screenshots
Request
Keys:
uk_resident_since_birth,uk_resident_years
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"uk_resident_since_birth": false,
"uk_resident_years": 2
}'
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": "2025-01-23T09:17:13.731448Z",
"updated_at": "2025-01-23T16:03:23.773442Z",
"first_name": "Mike",
"last_name": "Smith",
"preferred_name": "Mike Smith",
"phone_number": "+81234567890",
"gender_id": "male",
"gender_name": "Male",
"marital_status_id": "2",
"marital_status_name": "Married",
"date_of_birth": "1996-10-09",
"driving_licence_number": "X7X",
"licence_type_id": "fulluk",
"licence_type_name": "Full UK Car Licence",
"date_licence_obtained": "2011-01-08",
"home_owner": false,
"uk_resident_since_birth": false,
"uk_resident_years": 2,
"receive_notifications": true,
"email_subscriptions": false,
"sms_alerts": false
}
Marital status (Update)
A list of marital statuses may be found on the marital status metadata endpoint.
Notes
To update licence type both
marital_status_idandmarital_status_nameshould be updated with the correspondingkey,valuefrom the selected metadata.
Screenshots
Request
Keys:
marital_status_id,marital_status_name
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/user/profile/cb7d3f93-ccce-48d4-bf82-4c3dcb54d6ee/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"marital_status_id": "single",
"marital_status_name": "Single"
}'
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": "2025-01-23T09:17:13.731448Z",
"updated_at": "2025-01-23T16:09:02.539585Z",
"first_name": "Mike",
"last_name": "Smith",
"preferred_name": "Mike Smith",
"phone_number": "+81234567890",
"gender_id": "male",
"gender_name": "Male",
"marital_status_id": "single",
"marital_status_name": "Single",
"date_of_birth": "1996-10-09",
"driving_licence_number": "X7X",
"licence_type_id": "fulluk",
"licence_type_name": "Full UK Car Licence",
"date_licence_obtained": "2011-01-08",
"home_owner": false,
"uk_resident_since_birth": false,
"uk_resident_years": 2,
"receive_notifications": true,
"email_subscriptions": false,
"sms_alerts": false
}
Occupations (list)
Screenshots
Request
curl -X 'GET' \
'https://st.igate-test.co.uk/api/v1/user/occupations/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json'
Response
Type: 200 OK
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"url": "https://st.igate-test.co.uk/api/v1/user/occupations/70df4cea-42fe-42cf-a5fa-071af4cdab78/",
"uuid": "70df4cea-42fe-42cf-a5fa-071af4cdab78",
"created_at": "2025-01-23T16:22:44.550734Z",
"updated_at": "2025-01-23T16:22:44.550778Z",
"employers_business_id": "sports-professional",
"employers_business_name": "Sports - Professional",
"employment_status_id": "employed",
"employment_status_name": "Employed",
"occupation_id": "footballer",
"occupation_name": "Footballer",
"part_time": true,
"primary_occupation": true
},
{
"url": "https://st.igate-test.co.uk/api/v1/user/occupations/1873dbb4-ccd6-4d74-b64b-cbb0fc687b35/",
"uuid": "1873dbb4-ccd6-4d74-b64b-cbb0fc687b35",
"created_at": "2025-01-23T16:23:10.613419Z",
"updated_at": "2025-01-23T16:23:10.613456Z",
"employers_business_id": "sports-professional",
"employers_business_name": "Sports - Professional",
"employment_status_id": "employed",
"employment_status_name": "Employed",
"occupation_id": "coach",
"occupation_name": "Coach",
"part_time": true,
"primary_occupation": false
}
]
}
Notes
A list of urls for individual occupations can also be retrieved using the user endpoint. Using the above as an example the response would be:
{
"url": "https://st.igate-test.co.uk/api/v1/users/c0eb56f0-453a-4520-b392-75f38c6fe1d8/",
"uuid": "c0eb56f0-453a-4520-b392-75f38c6fe1d8",
"username": "example@gmail.com",
"email": "example@gmail.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": [
"https://st.igate-test.co.uk/api/v1/user/occupations/70df4cea-42fe-42cf-a5fa-071af4cdab78/",
"https://st.igate-test.co.uk/api/v1/user/occupations/1873dbb4-ccd6-4d74-b64b-cbb0fc687b35/"
]
}
Employment Statuses (List)
A list of active employment statuses from the employment metadata dataset. Dataset lists have query parameters for filtering.
Occupation Businesses (List)
A list of active occupation businesses from the occupation businesses metadata :ref:<occupation-business-list> dataset. Dataset lists have query parameters for filtering.
Occupation Choice (List)
A list of active occupations from the occupations metadata dataset. Dataset lists have query parameters for filtering.
Occupation (Create)
To create a new occupation send a POST request to the occupations endpoint.
Screenshots
Notes
To get employment status both
employment_status_idandemployment_status_nameshould be updated with the correspondingkey,valuefrom the selected metadata.To get occupation both
occupation_idandoccupation_nameshould be updated with the correspondingkey,valuefrom the selected metadata.To get industry both
employers_business_idandemployers_business_nameshould be updated with the correspondingkey,valuefrom the selected metadata.
Request
curl -X 'POST' \
'https://st.igate-test.co.uk/api/v1/user/occupations/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"employers_business_id": "sports-professional",
"employers_business_name": "Sports - Professional",
"employment_status_id": "employed",
"employment_status_name": "Employed",
"occupation_id": "footballer",
"occupation_name": "Footballer",
"part_time": true,
"primary_occupation": true
}'
Response
Type: 201 Created
{
"url": "https://st.igate-test.co.uk/api/v1/user/occupations/70df4cea-42fe-42cf-a5fa-071af4cdab78/",
"uuid": "70df4cea-42fe-42cf-a5fa-071af4cdab78",
"created_at": "2025-01-23T16:22:44.550734Z",
"updated_at": "2025-01-23T16:22:44.550778Z",
"employers_business_id": "sports-professional",
"employers_business_name": "Sports - Professional",
"employment_status_id": "employed",
"employment_status_name": "Employed",
"occupation_id": "footballer",
"occupation_name": "Footballer",
"part_time": true,
"primary_occupation": true
}
Occupation (Update)
Screenshots
Notes
To update employment status both
employment_status_idandemployment_status_nameshould be updated with the correspondingkey,valuefrom the selected metadata.To update occupation both
occupation_idandoccupation_nameshould be updated with the correspondingkey,valuefrom the selected metadata.To update industry both
employers_business_idandemployers_business_nameshould be updated with the correspondingkey,valuefrom the selected metadata.
Request
Keys:
employers_business_id,employers_business_id,employers_business_name,employment_status_id,employment_status_name,occupation_id,occupation_name,part_time,primary_occupation
curl -X 'PATCH' \
'https://st.igate-test.co.uk/api/v1/user/occupations/70df4cea-42fe-42cf-a5fa-071af4cdab78/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"employers_business_id": "sports-professional",
"employers_business_name": "Sports - Professional",
"employment_status_id": "employed",
"employment_status_name": "Employed",
"occupation_id": "footballer",
"occupation_name": "Footballer",
"part_time": true,
"primary_occupation": true
}'
Occupation (Delete)
An occupation is deleted by performing a DELETE request to the endpoint.
Request
curl -X 'DELETE' \
'https://st.igate-test.co.uk/api/v1/user/occupations/70df4cea-42fe-42cf-a5fa-071af4cdab78/' \
-H 'Authorization: Bearer abc123xyz...' \
-H 'accept: application/json'
Response
Type: 204 No Content