Request
To create a new user profile, send a POST request to:
https://<host>:<port>/ups/v2/user/userprofiles/actions/create
By default the platform checks the parental PIN on this request. See Server-side PIN checks in PIN and parental control management.
The earlier version of this request, POST /ups/v1/user/userprofiles, is deprecated. It takes the profile fields directly in the request body (not inside userProfile) and doesn't check the PIN.
Headers
-
Authorization– the client's access token, as a bearer token (Bearer <access token>). This is theaccess_tokenthat the client gets when it signs in – see Authentication token. This header is mandatory. -
Content-Type: application/json -
x-correlation-id– identifier for logging, to correlate messages across a call flow
Mandatory arguments
The following argument is in the request body:
-
userProfile– the new profile, with the fields described in User profile fields below. Itsnamefield is mandatory.
Other arguments
The following argument is in the request body:
-
pin– the PIN that the user entered. Required when the platform checks the PIN (the default). Otherwise it is ignored.
Example
A request with this payload creates a child profile:
{
"pin": "1234",
"userProfile": {
"name": "Kids",
"childProfile": true,
"pinPromptRequired": true,
"preferredAudioLanguage": "eng",
"preferredSubtitleLanguage": "eng",
"ratingsThresholds": [
{
"ratingsBody": "FSK",
"ratingsThreshold": "fsk12"
}
]
}
}
Response
A successful request returns an HTTP 201 status with the ID of the new profile, for example:
{
"_id": "507f191e810c19729de860ea"
}
A bad request returns an HTTP 400 status – for example:
-
"errorCode": 4106– a PIN is required but the request has nopin. -
"errorCode": 4105– the profile has noname. -
"errorCode": 8133– the request body has nouserProfile. -
"errorCode": 8124– the profile is a child profile but has noratingsThresholds. -
"errorCode": 8121– a ratings body or threshold inratingsThresholdsis not one that is already set up in the deployment.
An unauthorised request returns an HTTP 401 status ("errorCode": 1001) if the account has no PIN of the type that is checked.
A forbidden request returns an HTTP 403 status – for example, if the PIN is wrong ("errorCode": 4566), if the PIN is locked or only a limited number of attempts are left ("errorCode": 7123), or if the access token is missing, invalid, or has expired.
User profile fields
A user profile can have the following fields. They are the same when you create a profile and when you modify one (see Modifying an existing profile).
-
name– the profile name. Mandatory when you create a profile. -
childProfile– whether this is a child profile (true) or not (false) -
pinPromptRequired– whether the client application should prompt for the parental PIN before allowing access to content/resources (trueorfalse). That is, if this is true and a ratings threshold is set, if the user attempts to access content with a rating equal to or greater than the threshold, they must be prompted for the parental PIN.(Note that it is the client that interprets whether the threshold is a “greater than” or a “greater than or equal to” value, as the client is responsible for deciding when to prompt for the parental PIN.)
-
preferredAudioLanguage– the preferred audio language for this user profile -
preferredSubtitleLanguage– the preferred subtitle language for this user profile -
ratingsThresholds– the ratings threshold(s) for the user profile. Mandatory for a child profile. Each ratings body and threshold must be one that is already set up in the deployment. This is an array, each member of which consists of the following parameters:-
ratingsBody– the abbreviated name of the ratings body -
ratingsThreshold– the ratings threshold for this ratings body. When this profile is in use, content with an age rating greater than or equal to the specified threshold will be filtered out on the platform side and not sent to the client (except for EPG events, which will be displayed in the EPG but which cannot be viewed).(Note that it is the client that interprets whether the threshold is a “greater than” or a “greater than or equal to” value, as the client is responsible for deciding when to prompt for the parental PIN.)
-
-
iconName– the name of the icon (from Image Metadata Service) to be displayed for this profile (see Getting all the available user profile icons) -
additionalProperties– additional properties. This is an array of key-value pairs, each consisting of two parameters:-
name– the property’s name -
value– the property’s value
-
See also
For full details of this API, see the User Profiles Service (UPS) API documentation.