Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

This functionality can help family members (household) to share the same account. The more members are sharing the same account, the more profiles become more necessary. 

Overview of endpoints

We track user profiles using the following entity. Our API endpoints expose the entity.

EntityPurpose
UserProfileThis stores information about profiles of an account.

Table of Contents

Use cases

Each account can have multiple profiles

It is possible that each account have multiple profiles but they should have different profile names. 

GET api/users/v1/users/{user_id}/user_profiles

By calling the above API, it will returns list of profiles of that user

Code Block
languagephp
themeDJango
titleUser Profiles
linenumberstrue
{
  "data": [
    {
      "type": "UserProfile",
      "id": "84eb61a9-75d4-42c7-8c15-84c3d7776227",
      "attributes": {
        "name": "Dad",
        "user_id": 42,
        "is_child_profile": false,
        "age_limit": 16,
        "is_default": false
      },
      "links": {
        "self": "https://demo.aminocom.com/api/users/v1/5b56765e-fa7b-45d2-8dee-2869ec736cc9/user_profiles/84eb61a9-75d4-42c7-8c15-84c3d7776227"
      }
    }
  ]
}


User can create multiple profiles

An Authorised user can create multiple accounts as long as they have different names.

POST api/users/v1/users/{user_id}/user_profiles

By calling the above API, a profile belongs to that user will be created. Here is an example of a request body to create a profile.

Code Block
languagephp
themeDJango
titleUser Profiles
linenumberstrue
{
  "name": "Dad",
  "user_id": 42,
  "is_child_profile": false,
  "age_limit": 16,
  "is_default": false
}

And response body after the successful call.

Code Block
languagephp
themeDJango
titleUser Profiles
linenumberstrue
{
  "data": [
    {
      "type": "UserProfile",
      "id": "dc11a654-882d-47cb-a971-bb1fc6f0ffd8",
      "attributes": {
        "name": "Dad",
        "user_id": 42,
        "is_child_profile": false,
        "age_limit": 16,
        "is_default": false
      },
      "links": {
        "self": "https://demo.aminocom.com/api/users/v1/5b56765e-fa7b-45d2-8dee-2869ec736cc9/user_profiles/dc11a654-882d-47cb-a971-bb1fc6f0ffd8"
      }
    }
  ]
}


Profile can be set as Child profile

When the profile is created, user can set it as Child profile which contains specific things for children or limit them from sensitive channels or adult contents.

We can set it by set the property  "is_child_profile": true in the request body of the following API

POST api/users/v1/users/{user_id}/user_profiles


By default there is one default profile created per account.

When an account is created, the default profile is created correspondingly. The default name of that profile is the account's first name or "Default" if the first name is empty.


User can update information of profiles belong to the account

It is possible to an authorised user can update information of profiles such as name, age limit for the profile, is a child profile or not, is a default profile or not by calling the following API

PATCH api/users/v1/users/{user_id}/user_profiles/{user_profile_id}

Here is an example of request body.

Code Block
languagephp
themeDJango
titleUser Profiles
linenumberstrue
{
  "name": "Dad",
  "is_child_profile": false,
  "age_limit": 16,
  "is_default": true
}

Not all fields are required, just necessary fields are patched. For example, if user wants to update name of the profile, the request body requites field "name".


User can remove profiles which belong to the account

It is possible to an authorised user can remove profiles by calling the following API

DELETE api/users/v1/users/{user_id}/user_profiles/{user_profile_id}


At the initial user login, the default profile is returned automatically without asking the user to select

When user login, the response body includes "accessToken", "refreshToken" which can be decoded. Field "profile" in the decoded result will be the default profile and is used for actions of user.