Settings

A user may edit settings for their account.

Screenshots

Settings form

Settings form

Notes

  • As receive_notifications, email_subscriptions, sms_alerts are all available in the user profile their values can all be retrieved in a single request.

  • accepts_marketing is on the user object rather than the user profile.

  • The radio I agree to receive marketing materials should be a toggle like the other settings.

API

Receive notifications (Retrieve)

The receive notifications attribute is part the user profile endpoint.

  • key: receive_notifications

Note: When a user registers for the service the value for receive_notifications is set to null.

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": null,
  "last_name": null,
  "preferred_name": null,
  "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
}

Receive notifications (Update)

To update receive notifications perform a PATCH request to the user profile.

Request

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 '{
  "receive_notifications": true
}'

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": true,
  "email_subscriptions": null,
  "sms_alerts": null
}

Email subscriptions (Retrieve)

The email subscriptions attribute is part the user profile endpoint.

  • key: email_subscriptions

Note: When a user registers for the service the value for email_subscriptions is set to null.

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": null,
  "last_name": null,
  "preferred_name": null,
  "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
}

Email subscriptions (Update)

To update email subscriptions perform a PATCH request to the user profile.

Request

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 '{
  "email_subscriptions": false
}'

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": true,
  "email_subscriptions": false,
  "sms_alerts": null
}

SMS alerts (Retrieve)

The sms alerts attribute is part the user profile endpoint.

  • key: sms_alerts

Note: When a user registers for the service the value for sms_alerts is set to null.

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": null,
  "last_name": null,
  "preferred_name": null,
  "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
}

SMS alerts (Update)

To update SMS alerts perform a PATCH request to the user profile.

Request

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 '{
  "sms_alerts": false
}'

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": true,
  "email_subscriptions": false,
  "sms_alerts": false
}

Accepts marketing (Retrieve)

This value corresponds to accepts_marketing on the user and can be retrieved on the user endpoint.

Response

  • Type: 200 OK

{
  "access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM3NTU0MTYyLCJpYXQiOjE3Mzc1NTA1NjIsImp0aSI6Ijk3YjQ4MzRiOGIwMzQxMWY5YzU4NmEwOTY2NWMyMWY1IiwidXNlcl9pZCI6NDF9.Zjb9A9VMJGJgYUoN7uQfyIjmkE6qaU7YtzcADjlm0jQ",
  "refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTczNzYzNjk2MiwiaWF0IjoxNzM3NTUwNTYyLCJqdGkiOiIwYmNhMmEwMmY3NDk0NGFlODdmNjJjMzcxNzcyMmVmMSIsInVzZXJfaWQiOjQxfQ.BsrPGsCm-qbuzwheTzfF_gF2DBvAo2OyLcWVWzVih1I",
  "user": {
    "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": []
  }
}

Accepts marketing (Update)

Endpoints

Request

curl -X 'PATCH' \
  'https://st.igate-test.co.uk/api/v1/auth/user/' \
  -H 'Authorization: Bearer abc123xyz...' \
  -H 'accept: application/json' \
  -d '{
  "accepts_marketing": false
}'
curl -X 'PATCH' \
  'https://st.igate-test.co.uk/api/v1/users/c0eb56f0-453a-4520-b392-75f38c6fe1d8/' \
  -H 'accept: application/json'\
  -d '{
  "accepts_marketing": false
}'

Response

  • Type: 200 OK

{
  "access": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM3NTU0MTYyLCJpYXQiOjE3Mzc1NTA1NjIsImp0aSI6Ijk3YjQ4MzRiOGIwMzQxMWY5YzU4NmEwOTY2NWMyMWY1IiwidXNlcl9pZCI6NDF9.Zjb9A9VMJGJgYUoN7uQfyIjmkE6qaU7YtzcADjlm0jQ",
  "refresh": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTczNzYzNjk2MiwiaWF0IjoxNzM3NTUwNTYyLCJqdGkiOiIwYmNhMmEwMmY3NDk0NGFlODdmNjJjMzcxNzcyMmVmMSIsInVzZXJfaWQiOjQxfQ.BsrPGsCm-qbuzwheTzfF_gF2DBvAo2OyLcWVWzVih1I",
  "user": {
    "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": false,
    "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": []
  }
}

Change password

Change password screen

Change password screen

Request

curl -X 'POST' \
  'https://st.igate-test.co.uk/api/v1/auth/password/change/' \
  -H 'Authorization: Bearer abc123xyz...' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "new_password1": "mynewpassword1234",
  "new_password2": "mynewpassword1234"
}'

Response

  • Type: 200 OK

{
  "detail": "New password has been saved."
}

Logout

There is no action server side to perform a user logout. It is the responsibility of the client to remove the access tokens and ensure a new user is able to login.

Logout screen

Logout screen

Delete account

A user may delete their account.

Delete account screen

Delete account screen

Request

curl -X 'DELETE' \
  'https://st.igate-test.co.uk/api/v1/users/c0eb56f0-453a-4520-b392-75f38c6fe1d8/' \
  -H 'Authorization: Bearer abc123xyz...' \
  -H 'accept: application/json'

Response

  • Type: 204 No Content