Knowledgebase

EnterMediaDB JSON API

The REST JSON API is a comprehensive collection of programming API that can be used to remotely manage your media database. There are currently over 90 separate API used to create, search, update and delete from any database table within EnterMedia.

Authentication

To get started with calling the API you will need to have a valid login. Please use the MediaDB tool /mediadb/

The user and password that are used should have permissions enabled using the EMShare Permissions select the Users role and choose JSON API view. Turn on all the available permissions or just read only options.

The first API you will need to call will load up the entermedia.key Cookie into the clients HTTP session that does not expire. This will allow auto login for subsequent API requests so that you will not need to worry about being disconnected and having to login again. As long as the entermedia.key cookie is saved the client with log in automatically.

Calling The API

Assets and Asset Media are the main API that most users will need. When you search for assets or upload assets the results will be filtered by the permissions for that user.

The MediaDB tool has three parts:

1. Select the section you are interested in such as Asset Search
2. The URL should be of HTTP type POST, UPDATE, DELETE or GET
3. The request should be JSON syntax and the results will normally come back as JSON results or a JSON error message
4. Example curl command to search for assets:

Module API

Each time you create a new module the system will automatically define the end points and add that module CRUD operations to the MediaDB API. To reload existing modules you may need to click on the “Load Modules” link at the top left side of the MediaDB tool. This only has to be done once after upgrading EnterMedia.

Creating your custom API

A trained EnterMedia developer can create their own Custom API can be added to the list of API.

Creating your own configurations such as /mediadb/services/mystuff/hello.xconf file

Define the path-action that will be called. To define your own objects copy this file: /WEB-INF/base/mediadb/src/plugin.xml to /WEB-INF/base/mystuffapp/src/plugin.xml

Restart the tomcat web server since mediadb objects are cached.

Use the DataManager to add your API to the database tables called docsection and endpoint