Although templates are immutable once published (meaning they cannot be changed), faces for a given template can be added, modified, or removed even after the template is published.
This API will register a new face for a template. After a face is successfully registered, it can be used by front-end code to display a vAtom created from the specified template.
There are two types of faces on the BLOCKv platform:
Content-Type: application/json
App-Id: {app_id}
Name | Type | Description |
---|---|---|
template
*
| string | The template for which the face is registered. |
display_url
*
| string | A URL which displays the face, for example a website. |
package_url
*
| string | Link to a package (for example a zip-file) that contains the assets to display the face. |
constraints
*
| string | Constraints that have to be satisfied for the face to work properly |
[
resources
]
*
| array | References one or more resources from the templates resources array by its name, for example
ActivatedImage
. |
Native display URLs (i.e. matching the pattern 'native://*') are used by the viewer to uniquely identify the Native Face View used to visually render the vAtom. Remote display URLs (i.e. matching the pattern 'https://*') all identify the Web Face View as the renderer. It is up to each viewer to decide which Face Views to include.
BLOCKv supports the face views detailed in the table below. For more information on configuring faces, see configuring faces.
Face View | Display URL | Description |
---|---|---|
Image | native://image | Displays a simple image (or animated gif). |
Image Progress | native://progress-image-overlay | Displays a vAtom's cloning score visually by using two overlapping images. |
Image Policy | native://image-policy | Displays a single, dynamically updatable, image to the user. |
Image Layered | native://layered-image | Displays multiple unordered images layered over a base image. |
3D | native://generic-3d | Displays a 3D model of the vAtom. |
Web | https://* | Displays a remote URL. |
Name | Type | Description |
---|---|---|
bluetooth_le
*
| boolean | Flag to indicate if the face needs access to bluetooth. |
contact_list
*
| boolean | Flag to indicate if the face needs access to the address book. |
gps
*
| boolean | Flag to indicate if the face needs access to GPS. |
three_d
*
| boolean | Flag to indicate if the face is rendered in 3D. |
view_mode
*
| string | The view mode can be used by apps to determine what visual context the face wants to be displayed in. |
platform
*
| string | The client platform for which the face is intended. |
quality
*
| string | The quality of the face. |
A view mode defines a visual context within a Viewer where a face is able to be displayed. Generally speaking, the view mode relates to the size of the frame in which face should be displayed – but may also include other attributes such as view hierarchy etc.
The icon
view_mode
displays an image, video or 3D object that represents the vAtom in the user's inventory, among other places.
The engaged
view_mode
displays an enlarged version of the vAtom – typically shown after the user interacts with a vAtom in the icon
view mode, e.g. such as tapping the vAtom. Adding a face that supports the engaged
view mode is optional, and falling back on the icon
view mode is a recommended viewer pattern.
The card
view_mode
is typically used to display the vAtom as an interactive card. The aspect ratio of the card should be 10:16 (if possible).
The fullscreen
view_mode
is typically used to display the vAtom over the entire screen.
Since icon
is the most common view mode, we strongly recommend that all vAtoms have a face that supports the icon
view mode.
As a starting point, always set platform
as generic
, this will allow the face to be displayed by all viewer apps (independent of their platform). If you need to specialize the face per platform then consider using the platform specific constraints of ios
, android
, or web
.
Can be used by apps, for example to avoid loading high quality faces on a slow connection.
Asset quality levels are currently not supported. The quality of the returned asset will match the quality of the uploaded asset.
{
"template": "publisher_fqdn::Template_Name::v1",
"display_url": "native://video",
"package_url": "native://video",
"constraints": {
"bluetooth_le": false,
"contact_list": false,
"gps": false,
"three_d": false,
"view_mode": "icon",
"platform": "generic",
"quality": "high"
},
"resources": [
"ActivatedImage",
"Video"
]
}
{
"template": "publisher_fqdn::Template_Name::v1",
"display_url": "native://progress-image-overlay",
"package_url": "native://progress-image-overlay",
"constraints": {
"bluetooth_le": false,
"contact_list": false,
"gps": false,
"three_d": false,
"view_mode": "icon",
"platform": "generic",
"quality": "high"
},
"resources": [
"ActivatedImage",
"StartImage"
]
}
Error | Type | Description |
---|---|---|
200 | http | Everything is OK |
400 | http | Bad Request |
403 | http | Not Authorized |
{
"payload": {
"success_message": "Registered face for template=publisher_fqdn::Template_Name, id=4c873f84-6fa5-4dc5-8367-8285f843b9b4"
}
}