Authentication
Create an account at https://smart.caveon.com. You might have to contact support to request access to be able to make access tokens.
For trial purposes, support might simply provision an access token for you.
Use these tokens in your Authorization header:
Authorization: Bearer <token>Key Routes
While the API is more extensive than covered in this guide, you will only need the following routes to complete a full integration
POST /api/v1/items
Creates and returns an item object. Because the editor handles most of the other inputs, a full integration can be achieved simply by sending the item name in a json payload. Make sure to save the id of the returned item object
{
"name": "<item_name>"
}
POST /api/v1/editor/url
Returns a temporary URL to edit a smart item. This editor can be opened in a browser from your system to give authors a brandable interface to edit the smart item
Body Parameters (JSON)
- itemId: string - optional - edit an item with this id
- name: string - optional - populate the name field with this value
- templateIds: array - optional - launch with these templates selected - typically only contains one value, but combining templates is possible
- hideTemplateSelector: boolean - optional - defaults to false if missing - let your users select the template or select it for them with the templateIds value
- hideNameField: boolean - optional - defaults to false - pass in the name of the item in your system and restrict the editor from changing it
- templateTags: array - optional - templates with these tags will be available in the selector - currently supports "qti" and "sei" - custom tagged templates available upon request
- primaryColor: string - hex code
- secondaryColor: string - hex code
POST /api/v1/items/<item_id>/generate
Returns n instances of an item
Body Parameters (JSON)
- n: integer - number of instances - max 1000
- forget: boolean - defaults to false - set to true if you will be saving the generated instances in your own database
- unique: boolean - defaults to false - set to true to return only unique instances - only checks against those generated in this request.
Returned Fields
- value: string - The output of the template - xml in the case of qti templates
- context: object - the data passed into the template
POST /api/v1/items/<item_id>/generate_zip
Identical inputs to /generate but this route returns the output values of the instances in separate files in a zip archive
GET /api/v1/items/<item_id>/instances
Returns a paginated collection of instances if they were saved upon generation
GET /api/v1/items/<item_id>/instances/<instance_id>
Returns a single instance object
POST /api/v1/access_tokens
Creates a new access token with equal or lesser access than the token used to create it
Body Parameters (JSON)
- name: string
- isRead: boolean - grants read permissions
- isWrite: boolean - grants write permissions
- tags: array of strings - contains the tags of the creating access token as well as any included in this array - tokens can only be used to access items that contain ALL of their tags
Comments
0 comments
Please sign in to leave a comment.