Import Images
Required scope:
public-api:write
Description
The image import creates image entries in the Media Library and upload the image asset to the configured blob storage. The image import in Livingdocs is asynchronous. You post a batch of images that you want to import and get back a jobId that you can use to retrieve the import job state.
You can patch existing media library entries with the patch endpoint.
Use Cases
- Initial import from a legacy system - When doing an initial import one usually first imports all images and then imports documents referencing the images.
Related
Endpoint
POST api/v1/import/images
Parameters
Name | Type | Required | Notes |
---|---|---|---|
systemName | string | x | Identifier for the system you are importing from, e.g. an archive. |
webhook | uri | Endpoint at the importing system that gets notified by POST when import job is done. Notification contains the id of the import job, the state and an overview. | |
context | object | An object that is passed as context in the body of the request to the webhook. Limited to 8192 Bytes. | |
images | array | x | An array of images to import. Each entry is an object with the following keys, all of which are required: url: a URL to an image file, no data urls allowed, allowed types: png, jpg, gif, svg id: a unique id (stored as externalId in Livingdocs) that identifies the image on your end, must be unique within your project fileName: the title that the image should get in livingdocs metadata: An object of metadata according to your project config mediaType the handle of one of the mediaTypes from your project configuration |
Example Request
{
"systemName": "identifier-for-your-system",
"webhook": "https://my-domain.com/webhooks/image-import",
"context": {
"myIdentifier": "some-identifier-sent-to-the-webhook"
},
"images": [
{
"url": "https://placekitten.com/800/600",
"id": "123abc",
"fileName": "cat",
"metadata": {
"caption": "foo"
}
}
]
}
Response
Check Import Status for Images
Required scope:
public-api:write
Description
You can use this endpoint to check for the status and/or result of an image import.Endpoint
GET api/v1/import/images/status
Parameters
Name | Type | Required | Notes |
---|---|---|---|
?id | string | x | The id that Livingdocs provided you for your prior call to “/import/images” |