Extension
Vrite Extensions have access to dedicated API endpoints, meant primarly for building backends for your custom extensions.
To use any of the following endpoints, make sure to provide a x-vrite-extension-id
header or extensionId
when creating an API client.
Vrite provides the extension ID to you via the x-vrite-extension-id
header in a webhook callback, and you can always access it in the extension’s frontend for use with custom requests.
Retrieve Extension Details
Retrieves details of the extension — including its current configuration and custom access token.
ID of the extension installation
Name of the extension
URL of the extension
Configuration of the extension
API Token of the extension
curl --request GET \
--url "https://api.vrite.io/extension" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Accept: application/json' \
--header 'x-vrite-extension-id: c7fa11eeee2a85f5c9293561'
const client = createClient({
token: "<API_TOKEN>",
extensionId: "c7fa11eeee2a85f5c9293561",
});
const result = await client.extension.get();
{
"id": "1bcb56b03f4d6f8371bf7712",
"name": "string",
"url": "string",
"config": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
},
"token": "string"
}
Update Extension-Related Content Piece Data
Utility endpoint for setting custom, extension-related JSON metadata of the content piece specified by ID. The data set will be available at [EXTENSION_NAME]
on customData.__extensions__
property.
ID of the content piece
ID of the extension
Custom data to set
curl --request PUT \
--url "https://api.vrite.io/extension/content-piece-data" \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'x-vrite-extension-id: c7fa11eeee2a85f5c9293561' \
--data '{
"contentPieceId": "{CONTENTPIECEID}"
}'
const client = createClient({
token: "<API_TOKEN>",
extensionId: "c7fa11eeee2a85f5c9293561",
});
const result = await client.extension.updateContentPieceData({
contentPieceId: "2bdf5a36ff1fa059cd732fb4",
data: {
/* ... */
},
});