- Docs
- Api%2Freference%2Ffaces%2FPreviewFace
Preview a face
See what a face looks like, drawn with a real object's details, before anybody else does. Name the object to draw and the variant to draw — `card`, `detail` or `share`, with `detail` as the default. What comes back is the finished picture or page, exactly as a visitor would see it. Previews are never cached, so a design change shows up on the next request. If the variant points at a page of your own instead of a design, the response redirects there. Requires the `faces.read` permission.
The access token returned after a successful sign-in, sent as
Authorization: Bearer <access_token>.
It identifies the person and the organization they are working in, and
it lasts about fifteen minutes. When it runs out, use their refresh
token at POST /auth/refresh-token instead of asking them to sign in
again.
In: header
Path Parameters
Identifier of the face.
Request Body
application/json
Object and display variant to render with this face.
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://api.dual.network/faces/665f1c2d4b1a2c3d4e5f6a50/preview" \ -H "Content-Type: application/json" \ -d '{ "object_id": "665f1c2d4b1a2c3d4e5f6a90", "variant": "detail" }'"<article><h1>Summer Festival Ticket</h1></article>"{
"code": 3,
"message": "Key: 'limit' Error:Field validation for 'limit' failed on the 'lte' tag"
}{
"code": 16,
"message": "no auth provided"
}{
"code": 5,
"message": "object not found"
}{
"code": 13,
"message": "internal error"
}