Skip to content

Subprofile API

The Subprofile API allows developers to manage subprofiles associated with user accounts. Subprofiles provide a way to differentiate between users sharing an account, allowing for personalized experiences based on individual preferences. The service identifies the user making the request through the bearer token provided in the Authorization header.

To create a new subprofile, send a POST request as shown in the example below:

curl -X POST \
https://{tenant}.subprofile.{domain}/api/v1/subprofiles \
-H 'Authorization: Bearer {jwt_token}' \
-H 'Content-Type: application/json' \
-d '{"subProfileName":"Thomas","subProfileId":"my-custom-id","birthDate":"1983-08-04","properties":{"gender":"M","ageLimit":"10+"}}'

Field explanations

  • subProfileName - The required display name of the profile. Max size is 30 characters.
  • subProfileId - The id of the profile. Will be auto generated as a UUID if not present. Max size is 64 characters.
  • birthDate - Format is “YYYY-MM-DD”. Not required
  • properties - A customizable map of properties. Not required. Max size is 2KB.
Response CodeDescription
201 CreatedSubprofile successfully created
401 Not AuthorizedUser must login
403 ForbiddenUser exceeded the maximum subprofiles limit for the tenant
409 ConflictA subprofile with the same subprofile ID already exists for the user
422 Unprocessable EntityCould not process the subprofile in the request body
{
"data": [
{
"subProfileName": "Thomas",
"subProfileId": "my-custom-id",
"birthDate": "1983-04-08",
"properties": {
"gender": "M",
"ageLimit": "10+"
}
}
]
}

To retrieve a subprofile token, specify the subprofile ID in the request as shown below. The service responds with the token in the X-Vimond-Subprofile response header, which can be used when calling other Vimond services to be subprofile aware.

curl -X GET \
https://{tenant}.subprofile.{domain}/api/v1/subprofiles/{sub-profile-id}/token \
-H 'Authorization: Bearer {jwt_token}'
Response CodeDescription
204 No ContentSuccess
401 Not AuthorizedUser must login
404 Not FoundSubprofile not found
X-Vimond-Subprofile: eyJraWQiOiJrZXktaWQtMSIsIm.eygsg...
X-Vimond-Token-Expires-At: 1619169993

To retrieve information about a specific subprofile, use the subprofile ID in the request as shown below:

curl -X GET \
https://{tenant}.subprofile.{domain}/api/v1/subprofiles/{sub-profile-id} \
-H 'Authorization: Bearer {jwt_token}'
Response CodeDescription
200 OKSuccess
401 Not AuthorizedUser must login
404 Not FoundSubprofile not found
{
"data": [
{
"subProfileName": "Thomas",
"subProfileId": "7c699b36-bda4-444c-8637-385025461a0a",
"birthDate": "1983-04-08",
"properties": {
"gender": "M",
"ageLimit": "10+"
}
}
]
}

Retrieve all Subprofiles for a User Account

Section titled “Retrieve all Subprofiles for a User Account”

To fetch all subprofiles linked to a user account, use the following request, which retrieves the user ID from the bearer token:

curl -X GET \
https://{tenant}.subprofile.{domain}/api/v1/subprofiles \
-H 'Authorization: Bearer {jwt_token}'
Response CodeDescription
200 OKSuccess
401 Not AuthorizedUser must login
{
"data": [
{
"subProfileName": "Thomas",
"subProfileId": "7c699b36-bda4-444c-8637-385025461a0a",
"birthDate": "1983-04-08",
"properties": {
"gender": "M",
"ageLimit": "10+"
}
},
{
"subProfileName": "Freddy",
"subProfileId": "8d569b36-bda4-444c-8637-385025461b3b",
"birthDate": "1980-05-04",
"properties": {
"gender": "M",
"ageLimit": "18+"
}
}
]
}

To update a property field in a subprofile, send the entire updated subprofile object with all the properties to the update endpoint. The subprofile will be overwritten with the new values.

In the example below we are sending a new age limit (16+).

curl -X PUT \
https://{tenant}.subprofile.{domain}/api/v1/subprofiles/{sub-profile-id} \
-H 'Authorization: Bearer {jwt_token}' \
-H 'Content-Type: application/json' \
-d '{"subProfileName":"Thomas","birthDate":"1983-08-04","properties":{"gender":"M","ageLimit":"16+"}}'
Response CodeDescription
200 OKSuccess
401 Not AuthorizedUser must login
404 Not FoundSubprofile not found
422 Unprocessable EntityCould not process the subprofile in the request body
{
"data": [
{
"subProfileName": "Thomas",
"subProfileId": "7c699b36-bda4-444c-8637-385025461a0a",
"birthDate": "1983-04-08",
"properties": {
"gender": "M",
"ageLimit": "16+"
}
}
]
}

To add custom properties to a subprofile, include them in the properties entity of the subprofile body when creating or updating the profile. Please note that there will be defined a size limit on this properties entity.

In the example below we are adding the property “favoriteColor” to a profile.

curl -X PUT \
https://{tenant}.subprofile.{domain}/api/v1/subprofiles/{sub-profile-id} \
-H 'Authorization: Bearer {jwt_token}' \
-H 'Content-Type: application/json' \
-d '{"subProfileName":"Thomas","birthDate":"1983-08-04","properties":{"gender":"M","ageLimit":"16+","favoriteColor":"yellow"}}'
Response CodeDescription
200 OKSuccess
401 Not AuthorizedUser must login
404 Not FoundSubprofile not found
422 Unprocessable EntityCould not process the subprofile in the request body
{
"data": [
{
"subProfileName": "Thomas",
"subProfileId": "7c699b36-bda4-444c-8637-385025461a0a",
"birthDate": "1983-04-08",
"properties": {
"gender": "M",
"ageLimit": "16+",
"favoriteColor": "yellow"
}
}
]
}

To delete a specific subprofile, use the DELETE request with the subprofile ID:

curl -X DELETE \
https://{tenant}.subprofile.{domain}/api/v1/subprofiles/{sub-profile-id} \
-H 'Authorization: Bearer {jwt_token}'
Response CodeDescription
204 No ContentSuccess
401 Not AuthorizedUser must login
404 Not FoundSubprofile not found

To delete all subprofiles linked to a user account, use the following DELETE request

curl -X DELETE \
https://{tenant}.subprofile.{domain}/api/v1/subprofiles/ \
-H 'Authorization: Bearer {jwt_token}'
Response CodeDescription
204 No ContentSuccess
401 Not AuthorizedUser must login

Example Using Subprofile in Playlist Service

Section titled “Example Using Subprofile in Playlist Service”

To demonstrate the API, we will follow the scenario below:

  1. Retrieve all subprofiles for the user account.
  2. Get a token for the chosen profile.
  3. Use the token against the playlist service to fetch all playlists for the profile.

Please note that the authentication step is not included in the example.

curl -X GET \
https://{tenant}.subprofile.{domain}/api/v1/subprofiles \
-H 'Authorization: Bearer {jwt_token}'
{
"data": [
{
"subProfileName": "Thomas",
"subProfileId": "7c699b36-bda4-444c-8637-385025461a0a",
"birthDate": "1983-04-08",
"properties": {
"gender": "M",
"ageLimit": "10+"
}
},
{
"subProfileName": "Freddy",
"subProfileId": "8d569b36-bda4-444c-8637-385025461b3b",
"birthDate": "1980-05-04",
"properties": {
"gender": "M",
"ageLimit": "18+"
}
}
]
}
curl -X GET \
https://{tenant}.subprofile.{domain}/api/v1/subprofiles/7c699b36-bda4-444c-8637-385025461a0a/token \
-H 'Authorization: Bearer {jwt_token}'
X-Vimond-Subprofile: eyJraWQiOiJrZXktaWQtMSIsImFsZyI6IkhTMjU2In0.eyJhdWQiOiJ2aW1vbmQtc3VicHJvZmlsZS1hdWRpZW5jZSIsInN1YiI6IjgwMGQ2NDZkLTExMzktNGQyYi05YmUwLTQ0N2I3MTYyMTEzZSIsImFnZUxpbWl0IjoiMTArIiwiZ2VuZGVyIjoiTSIsImh0dHBzOlwvXC92aW1vbmRcL3N1YnByb2ZpbGUiOiI3YzY5OWIzNi1iZGE0LTQ0NGMtODYzNy0zODUwMjU0NjFhMGEiLCJpc3MiOiJodHRwczpcL1wvdmltb25kLnN1YnByb2ZpbGUtc2VydmljZS5oYS5rOHMubmNhYi1maXJzdC52aW1vbmR0di5jb20iLCJleHAiOjE1MzE3OTExODMsImlhdCI6MTUzMTc0Nzk4MywianRpIjoiMjM0ZmVhODEtMzhkNy00ODc0LWExOTYtMTNlMWY0OGI4MDMxIn0.sAQFd5R-seHqAZ-s8txw01krpWcQ2mc9H57atg2z7b4
curl -X GET \
https://{tenant}.playlist.{domain}\api/v1/users/playlists \
-H 'Authorization: Bearer {jwt_token}' \
-H 'X-Vimond-Subprofile: eyJraWQiOiJrZXktaWQtMSIsImFsZyI6IkhTMjU2In0.eyJ...'
{
"data": [
{
"id": "c1a5051d-81f4-4932-80f0-bcac81bbaf9d",
"name": "playlist-1531600610",
"status": "PRIVATE",
"assetIds": [
"12345"
]
},
{
"id": "d4f5051d-81f4-4932-80f0-bcac81bbag3r",
"name": "playlist-1532400240",
"status": "PRIVATE",
"assetIds": [
"12345",
"54321"
]
}
]
}

We hope this guide has provided you with a comprehensive understanding of the Subprofile API and its capabilities. By incorporating subprofiles into your application or service, you can deliver a truly personalized and enjoyable video streaming experience for your users.

If you have any questions or need further assistance, please don’t hesitate to reach out to our support team. Happy coding and happy subprofile management!