API

Common

Getting Started

User

Register New User
Login
Logout
Refresh Access Token
Get User Profile
Update Profile
Upload Avatar
Delete User
Reset Password
Reset Password by ID

User Token

List User Tokens
Add User Token
Update Default User Token
Delete User Token
Verify User Token
Reset Verification Code

User vAtom

Get vAtom
Get vAtoms by Ids
Get vAtom Inventory
Search vAtoms
Geo Discover Groups
Geo Discover vAtoms
Update vAtoms
Perform Action
Trash vAtom

User Activity

Get My Threads
Get My Thread Messages

Template

List Templates
Get Template
Create Template
Update Template
Delete Template

Template Variation

List Variations
Get Variation
Create Variation
Update Variation
Delete Variation

vAtom

Emit vAtom

Template Action

List Actions
Get Action
Register Action Handler
Register Action
Update Action
Delete Action

Template Face

List Faces
Register Face
Update Face
Delete Face

Asset

Upload Assets
Get Assets
Delete Assets

Register Face

POST
https://api.blockv.io/v1/publisher/face

Overview

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:

  1. Native faces to display the vAtom (for example as an icon in an inventory).
  2. Faces that reference external "face code" written as HTML web apps (with optional additional features provided by the BLOCKv Face SDK), which can use multiple resources and more complex logic to display a vAtom.

Register Face Request

HTTP Headers

Content-Type: application/json App-Id: {app_id}

Payload Details

NameTypeDescription
template * stringThe template for which the face is registered.
display_url * stringA URL which displays the face, for example a website.
package_url * stringLink to a package (for example a zip-file) that contains the assets to display the face.
constraints * stringConstraints that have to be satisfied for the face to work properly
[ resources ] * arrayReferences one or more resources from the templates resources array by its name, for example ActivatedImage .

Supported display URLs

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 ViewDisplay URLDescription
Imagenative://imageDisplays a simple image (or animated gif).
Image Progressnative://progress-image-overlayDisplays a vAtom's cloning score visually by using two overlapping images.
Image Policynative://image-policyDisplays a single, dynamically updatable, image to the user.
Image Layerednative://layered-imageDisplays multiple unordered images layered over a base image.
3Dnative://generic-3dDisplays a 3D model of the vAtom.
Webhttps://*Displays a remote URL.
  • The 3D Face View is supported by the BLOCKv, but is not embedded with the BLOCKv SDK. Rather, it must be registered by the viewer as a supported face view.

Constraints object

NameTypeDescription
bluetooth_le * booleanFlag to indicate if the face needs access to bluetooth.
contact_list * booleanFlag to indicate if the face needs access to the address book.
gps * booleanFlag to indicate if the face needs access to GPS.
three_d * booleanFlag to indicate if the face is rendered in 3D.
view_mode * stringThe view mode can be used by apps to determine what visual context the face wants to be displayed in.
platform * stringThe client platform for which the face is intended.
quality * stringThe quality of the face.
Supported view modes

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.

icon

The icon view_mode displays an image, video or 3D object that represents the vAtom in the user's inventory, among other places.

engaged

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.

card

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).

fullscreen

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.

Supported platforms
  • generic
  • ios
  • android
  • web

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.

Supported qualities

Can be used by apps, for example to avoid loading high quality faces on a slow connection.

  • low
  • medium
  • high

Asset quality levels are currently not supported. The quality of the returned asset will match the quality of the uploaded asset.

Sample Request: Video Face Config

{
  "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"
  ]
}

Sample Request: Progress Image Overlay Face Config

{
  "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"
  ]
}

Register Face Response

Return & Error Codes

ErrorTypeDescription
200httpEverything is OK
400httpBad Request
403httpNot Authorized

Sample Response

{
    "payload": {
        "success_message": "Registered face for template=publisher_fqdn::Template_Name, id=4c873f84-6fa5-4dc5-8367-8285f843b9b4"
    }
}
©2020 BLOCKv
Info