Jama JSON-RPC service reference

Jama is accessible via a subset of the JSON-RPC 1.0 protocol over HTTP. You may use the reference client library implementation in Python.

activate_rpc_access

Parameters
  • user_name (string)
  • api_key (string)
Return type
boolean

Add access to the RPC API for the given user name with the given API key. A new user will be created if none is available with given user name.

Requires superuser.

↑ back to available methods

add_collection

Parameters
  • title (string)
  • parent_id (number)
Return type
object

Create a new collection based on 'title' and parent_id

Returns either the serialized new collection of null if parent does not exist.

Example output:

{ "id": 3, "title": "paintings", "resources_count": 0, "children_count": 0, "descendants_count": 0, "descendants_resources_count": 0, "parent": null, "project_id": 1, "children": null, "metas": [], "public_access": false, "tags": [], }

↑ back to available methods

add_collection_from_path

Parameters
  • path (string)
  • project_id (number)
Return type
array[object]

Will take a path such as '/photos/arts/paintings/' and build the corresponding hierarchy of collections. The hierarchy is returned as a list of serialized collections.

Beware: Because the collections are serialized before their children, all the children/descendants counts are set to 0.

Example output:

[ { "id": 1, "title": "photos", "resources_count": 0, "children_count": 0, "descendants_count": 0, "descendants_resources_count": 0, "parent": null, "project_id": 1, "children": null, "metas": [], "public_access": false, "tags": [], }, { "id": 2, "title": "arts", "resources_count": 0, "children_count": 0, "descendants_count": 0, "descendants_resources_count": 0, "parent": 1, "project_id": 1, "children": null, "metas": [], "public_access": false, "tags": [], }, { "id": 3, "title": "paintings", "resources_count": 0, "children_count": 0, "descendants_count": 0, "descendants_resources_count": 0, "parent": 2, "project_id": 1, "children": null, "metas": [], "public_access": false, "tags": [], }, ]

↑ back to available methods

add_meta_to_collection

Parameters
  • collection_id (number)
  • meta_id (number)
  • meta_value (string)
  • recursive (boolean defaults to false)
Return type
number

Add a meta value to a collection given their ids.

If recursive is True, the meta will be added to all descendants, collections and resources alike.

↑ back to available methods

add_meta_to_resource

Parameters
  • resource_id (number)
  • meta_id (number)
  • meta_value (string)
Return type
number

Add a meta value to a resource given their ids.

↑ back to available methods

add_meta_to_selection

Parameters
  • from_collection_id (number)
  • selection (object)
  • meta_id (number)
  • meta_value (string)
Return type
boolean

Use such a dict for selection: { "include": { "resources_ids": [3493, 159] "collections_ids:" [20, 31] }, "exclude": { "resources_ids": [12, 10, 15] "collections_ids:" [4, 254, 17] } }

↑ back to available methods

add_metadata

Parameters
  • title (string)
  • metas_set_id (number)
  • metadata_type_id (number defaults to null)
Return type
number

Add a new metadata to metadata set.

Set optional 'metadatatypeid'. Defaults to string type.

↑ back to available methods

add_metadataset

Parameters
  • title (string)
  • project_id (number)
Return type
number

Create new metadata set from title.

↑ back to available methods

add_resource_to_collection

Parameters
  • resource_id (number)
  • collection_id (number)
Return type
boolean

Add a resource to a collection given ids.

↑ back to available methods

add_tag_to_collection

Parameters
  • tag_uid (string)
  • collection_id (number)
Return type
boolean

Add tag to a collection based on tag uid and collection id.

↑ back to available methods

add_tag_to_resource

Parameters
  • tag_uid (string)
  • resource_id (number)
Return type
boolean

Add tag to a resource based on tag uid and resource id.

↑ back to available methods

ancestors_from_collection

Parameters
  • collection_id (number)
  • include_self (boolean defaults to false)
Return type
array[object]

Get ancestors from collection id as a list of serialized collections.

If 'include_self' is true, will add the current collection at the begining.

Example output:

[ { "id": 1, "title": "photos", "resources_count": 0, "children_count": 0, "descendants_count": 0, "descendants_resources_count": 0, "parent": null, "children": null, "metas": [], "public_access": false, "tags": [], }, { "id": 2, "title": "arts", "resources_count": 0, "children_count": 0, "descendants_count": 0, "descendants_resources_count": 0, "parent": 1, "children": null, "metas": [], "public_access": false, "tags": [], }, { "id": 3, "title": "paintings", "resources_count": 0, "children_count": 0, "descendants_count": 0, "descendants_resources_count": 0, "parent": 2, "children": null, "metas": [], "public_access": false, "tags": [], }, ]

↑ back to available methods

ancestors_from_resource

Parameters
  • resource_id (number)
Return type
array[object]

Get ancestors from resource id as a list of serialized collections.

Example output:

[ { "id": 1, "title": "photos", "resources_count": 0, "children_count": 0, "descendants_count": 0, "descendants_resources_count": 0, "parent": null, "children": null, "metas": [], "public_access": false, "tags": [], }, { "id": 2, "title": "arts", "resources_count": 0, "children_count": 0, "descendants_count": 0, "descendants_resources_count": 0, "parent": 1, "children": null, "metas": [], "public_access": false, "tags": [], }, { "id": 3, "title": "paintings", "resources_count": 0, "children_count": 0, "descendants_count": 0, "descendants_resources_count": 0, "parent": 2, "children": null, "metas": [], "public_access": false, "tags": [], }, ]

↑ back to available methods

auto_find_rotate_angle

Parameters
  • resource_id (number)
Return type
number

Tries to determine skew angle of image with text.

↑ back to available methods

change_collection_meta_value

Parameters
  • meta_value_id (number)
  • meta_value (string)
Return type
boolean

Change the value of a meta for a collection.

↑ back to available methods

change_resource_meta_value

Parameters
  • meta_value_id (number)
  • meta_value (string)
Return type
boolean

Change the value of a meta for a resource

↑ back to available methods

collection

Parameters
  • collection_id (number)
Return type
object

Get a particular collection given its id.

Example output:

{ "id": 2, "title": "art works", "resources_count": 23, "children_count": 5, "parent": 1, "children": None, "metas": [], "public_access": False, "tags": [], }

↑ back to available methods

collection_stats

Parameters
  • collection_id (number)
Return type
object

Get infos from given collection:

↑ back to available methods

collections

Parameters
  • parent_id (number)
  • recursive (boolean defaults to false)
  • limit_from (number defaults to 0)
  • limit_to (number defaults to 2000)
  • flat_list (boolean defaults to false)
  • only_published (boolean defaults to false)
  • order_by (string defaults to 'title')
  • only_deleted_items (boolean defaults to false)
Return type
array[object]

Return the user's collections under the parent collection specified by 'parent_id'. If 'recursive' is true, will return all the descendants recursively in the 'children' key. If recursive is false, 'children' is null.

Special case:

If flatlist is True, collections are returned as a flat list and parentid is effectively IGNORED.

Example output:

[ { "id": 2, "title": "art works", "resources_count": 23, "children_count": 5, "descendants_count": 12, "descendants_resources_count": 58, "parent": 1, "children": None, "metas": [], "public_access": False, "tags": [], } ]

↑ back to available methods

create_project

Parameters
  • project_label (string)
  • project_description (string)
Return type
object

Create a new project.

Requires superuser.

↑ back to available methods

deactivate_rpc_access

Parameters
  • user_name (string)
  • api_key (string)
Return type
boolean

Deactivate access to the RPC API for the given user name and API key. Only the access (API key) is removed, not the user.

Requires superuser.

↑ back to available methods

delete_collection

Parameters
  • collection_id (number)
  • recursive (boolean defaults to false)
Return type
object

Delete collection given its id.

Collection MUST be empty of any content (no children collections and no resources), unless the 'recursive'parameter is set to True, in which case ALL descendants will be deleted.

↑ back to available methods

delete_metadata

Parameters
  • metadata_id (number)
Return type
boolean

Delete metadata based on its id.

↑ back to available methods

delete_metadataset

Parameters
  • metadataset_id (number)
  • recursive (boolean defaults to false)
Return type
object

Delete metadata set based on its id. Optional recursive call.

↑ back to available methods

delete_project_property

Parameters
  • project_id (number)
  • property_key (string)
Return type
boolean

Delete a property from the project.

property_key is NOT case sensitive, ie. "ProPertY" is the same as "pRoperTy" or "property".

↑ back to available methods

delete_resource

Parameters
  • resource_id (number)
Return type
boolean

Permanently (soft) delete a resource given its id.

↑ back to available methods

delete_role

Parameters
  • project_id (number)
  • role_label (string)
Return type
boolean

Delete role within given project.

Requires superuser

↑ back to available methods

delete_tag

Parameters
  • uid (string)
Return type
boolean

Remove (delete) a tag based on its uid.

Beware: This will remove ALL associations with the tag.

↑ back to available methods

has_permission

Parameters
  • project_id (number)
  • permission (string)
Return type
boolean

Test current user for given permission.

↑ back to available methods

list_permissions

Parameters
no parameters
Return type
array[object]

Lists all available permissions in the application:

[ {'id': 1, 'label': 'collection.create'}, {'id': 2, 'label': 'collection.read'}, {'id': 3, 'label': 'collection.update'}, {'id': 4, 'label': 'collection.delete'}, {'id': 5, 'label': 'resource.create'}, {'id': 6, 'label': 'resource.read'}, {'id': 7, 'label': 'resource.update'}, {'id': 8, 'label': 'resource.delete'}, {'id': 9, 'label': 'metadata.create'}, {'id': 10, 'label': 'metadata.read'}, {'id': 11, 'label': 'metadata.update'}, {'id': 12, 'label': 'metadata.delete'}, {'id': 13, 'label': 'metadataset.create'}, {'id': 14, 'label': 'metadataset.read'}, {'id': 15, 'label': 'metadataset.update'}, {'id': 16, 'label': 'metadataset.delete'}, {'id': 17, 'label': 'file.create'}, {'id': 18, 'label': 'file.read'}, {'id': 19, 'label': 'file.update'}, {'id': 20, 'label': 'file.delete'}, {'id': 21, 'label': 'tag.create'}, {'id': 22, 'label': 'tag.read'}, {'id': 23, 'label': 'tag.update'}, {'id': 24, 'label': 'tag.delete'}, {'id': 25, 'label': 'file.download_source'} ]

↑ back to available methods

list_roles

Parameters
  • project_id (number)
Return type
array[object]

Fetch all roles defined in the project, no matter the user.

↑ back to available methods

meta_count

Parameters
  • metadata_id (number)
  • collection_id (number)
Return type
object

Count metadata usage.

↑ back to available methods

metadata

Parameters
  • metadata_id (number)
Return type
object

Get one particular metadata given its id.

Example output:

{ "id": 2, "title": "ICC_Profile:GrayTRC", "set_id": 1, "set_title": "exif metas", "rank": 1, "project_id": 1, }

↑ back to available methods

metadatas

Parameters
  • metadata_set_id (number)
Return type
array[object]

Get all metadatas given a metadata set id.

Metadatas MAY be ordered with the rank attribute.

Example output:

[ { "id": 1, "title": "PNG:ProfileName", "set_id": 1, "set_title": "exif metas", "rank": 0, "project_id": 1, }, { "id": 2, "title": "ICC_Profile:GrayTRC", "set_id": 1, "set_title": "exif metas", "rank": 1, "project_id": 1, } ]

↑ back to available methods

metadatasets

Parameters
  • project_id (number)
Return type
array[object]

Get the list of all the project's metadata sets. For each metadatas set, the number of metadatas is given in metas_count.

Example output:

[ {"id": 1, "title": "exif metas", "project_id": 1, "metas_count": 23}, {"id": 2, "title": "dublin core", "project_id": 1, "metas_count": 17} ]

↑ back to available methods

metadatatypes

Parameters
no parameters
Return type
array[object]

Get a list of available data types

Example output:

[ {"id": 1, "title": "text"}, {"id": 2, "title": "numeric"}, ]

↑ back to available methods

move_collection

Parameters
  • child_collection_id (number)
  • parent_collection_id (number)
Return type
boolean

Move a collection from a parent to another.

Will raise ServiceException in the following cases:

↑ back to available methods

move_items

Parameters
  • from_collection_id (number)
  • to_collection_id (number)
  • collections_ids (List[int])
  • resources_ids (List[int])
Return type
Dict[str, Dict]

Move items (collections or resources) from one Collection to another

↑ back to available methods

move_selection

Parameters
  • from_collection_id (number)
  • selection (object)
  • to_collection_id (number)
Return type
Dict[str, Dict]

Will mass move items (resources AND collections) based on parent collection and destination collection

Use such an object for inclusion/exclusion:

{ "include": { "resources_ids": [3493, 159] "collections_ids:" [20, 31] }, "exclude": { "resources_ids": [12, 10, 15] "collections_ids:" [4, 254, 17] } }

↑ back to available methods

picture_rotate_crop

Parameters
  • resource_id (number)
  • rotation (number defaults to 0)
  • top_crop (number defaults to 0)
  • right_crop (number defaults to 0)
  • bottom_crop (number defaults to 0)
  • left_crop (number defaults to 0)
Return type
object

Rotate and crop an image. The resulting image then replaces the original in the current resource.

Will return the resource upon success. Throws a ServiceException otherwise.

↑ back to available methods

ping

Parameters
no parameters
Return type
string

This is a test method to ensure the server-client communication works. Will return "pong [name authenticated of user]"

Example output:

pong john

↑ back to available methods

project_properties

Parameters
  • project_id (number)
Return type
array[object]

Get ALL properties from a project.

↑ back to available methods

project_property

Parameters
  • project_id (number)
  • property_key (string)
Return type
object

Get a property value from the project.

property_key is NOT case sensitive, ie. "ProPertY" is the same as "pRoperTy" or "property".

Will raise an exception if property does not exist.

↑ back to available methods

project_stats

Parameters
  • project_id (number)
Return type
object

Get infos from given project:

↑ back to available methods

projects_user_permissions

Parameters
no parameters
Return type
array[object]

Get all rights for the current user.

Example output:

[ { 'project': {'id': 7, 'label': 'john doe main project'}, 'role': {'id': 7, 'label': 'admin', 'permissions': [{"id": 1, "label": "do_anything"}]}, 'user': 'john doe' } ]

↑ back to available methods

public_collections

Parameters
  • project_id (number)
Return type
array[object]

Get public collections

↑ back to available methods

publish_collection

Parameters
  • collection_id (number)
Return type
boolean

Mark a collection as public

↑ back to available methods

recycle_bin

Parameters
  • project_id (number)
Return type
array[object]

Gets deleted elements:

↑ back to available methods

remove_meta_value_from_collection

Parameters
  • collection_id (number)
  • meta_value_id (number)
  • recursive (boolean defaults to false)
Return type
boolean

Remove a meta value from a collection given their ids.

↑ back to available methods

remove_meta_value_from_resource

Parameters
  • resource_id (number)
  • meta_value_id (number)
Return type
boolean

Remove a meta_value from a resource given their ids.

↑ back to available methods

remove_meta_value_from_selection

Parameters
  • from_collection_id (number)
  • selection (object)
  • meta_value_id (number)
Return type
boolean

Use such a dict for selection: { "include": { "resources_ids": [3493, 159] "collections_ids:" [20, 31] }, "exclude": { "resources_ids": [12, 10, 15] "collections_ids:" [4, 254, 17] } }

↑ back to available methods

remove_resource_from_collection

Parameters
  • resource_id (number)
  • collection_id (number)
Return type
boolean

Remove a resource from a collection given ids.

↑ back to available methods

remove_selection

Parameters
  • parent_collection_id (number)
  • selection (object)
Return type
boolean

Will mass remove items (resources AND collections) based on parent collection

Use such an object for inclusion/exclusion:

{ "include": { "resources_ids": [3493, 159] "collections_ids:" [20, 31] }, "exclude": { "resources_ids": [12, 10, 15] "collections_ids:" [4, 254, 17] } }

deleteCollection (with recursion) and deleteResource are used under the hood.

The parent collection is left as-is.

↑ back to available methods

remove_tag_from_collection

Parameters
  • tag_uid (string)
  • collection_id (number)
Return type
boolean

Remove tag from a collection based on tag uid and collection id.

↑ back to available methods

remove_tag_from_resource

Parameters
  • tag_uid (string)
  • resource_id (number)
Return type
boolean

Remove tag from a resource based on tag uid and resource id.

↑ back to available methods

rename_collection

Parameters
  • collection_id (number)
  • title (string)
Return type
boolean

Rename a collection (ie. change its title).

↑ back to available methods

rename_meta

Parameters
  • meta_id (number)
  • title (string)
Return type
boolean

Rename a metadata (ie. change its title).

↑ back to available methods

rename_resource

Parameters
  • resource_id (number)
  • title (string)
Return type
boolean

Rename a resource (ie. change its title).

↑ back to available methods

replace_file

Parameters
  • from_resource_id (number)
  • to_resource_id (number)
Return type
boolean

Replace a file by another using two existing resources.

The two resources are expected to be of File type. Then the following operations are performed:

Such that all title/metas/tags/collections of the destination resource instance are untouched, excluding exif metas that are transfered from the source.

↑ back to available methods

resource

Parameters
  • resource_id (number)
  • include_metas (boolean defaults to true)
Return type
object

Get a resource given its id.

Example output (file resource):

{ "id": 1, "title": "letter", "original_name": "letter.txt", "type": "text/plain", "hash": "0dd93a59aeaccfb6d35b1ff5a49bde1196aa90dfef02892f9aa2ef4087d8738e", "metas": null, "urls": [], "tags": [], }

↑ back to available methods

resources

Parameters
  • collection_id (number)
  • include_metas (boolean defaults to false)
  • limit_from (number defaults to 0)
  • limit_to (number defaults to 2000)
  • order_by (string defaults to 'title')
  • only_deleted_items (boolean defaults to false)
  • only_tags (array[string] defaults to null)
Return type
array[object]

Get all resources from a collection.

If 'includemetas' is true, will return the resources metadatas. If 'includemetas' is false, 'metas' will be null.

Different resources types may have different object keys. The bare minimum is 'id', 'title' and 'tags'.

Example output (file resource):

[ { "id": 1, "title": "letter", "original_name": "letter.txt", "type": "text/plain", "hash": "0dd93a59aeaccfb6d35b1ff5a49bde1196aa90dfef02892f9aa2ef4087d8738e", "metas": null, "urls": [], "tags": [], } ]

↑ back to available methods

restore_collection

Parameters
  • collection_id (number)
  • destination_collection_id (number)
Return type
boolean

Restore a deleted collection from the recycle bin

↑ back to available methods

restore_resource

Parameters
  • resource_id (number)
  • destination_collection_id (number)
Return type
boolean

Restore a deleted resource from the recycle bin

↑ back to available methods

set_is_oai_record

Parameters
  • collection_id (number)
  • is_oai_record (boolean defaults to true)
Return type
boolean

Set/unset the collection as a OAI-PMH record. The creation date will be used in OAI-PMH requests.

↑ back to available methods

set_metas_to_collection

Parameters
  • collection_id (number)
  • metas (array[object])
  • recursive (boolean defaults to false)
  • async_mode (boolean defaults to true)
Return type
boolean

Sets all metas for a unique metadata set.

Metas is a list of metadata id => metadata value dictionaries.

All metas must share the same metadata set.

If recursive is True, the meta will be added to all descendants, collections and resources alike.

Recursive work is async when required (async_mode is ignored if recursive is set to False)

↑ back to available methods

set_metas_to_resource

Parameters
  • resource_id (number)
  • metas (array[object])
Return type
boolean

Sets all metas for a unique metadata set.

Metas is a list of metadata id => metadata value dictionaries.

All metas must share the same metadata set.

↑ back to available methods

set_project_property

Parameters
  • project_id (number)
  • property_key (string)
  • property_value (object)
Return type
object

Set a property value to the project.

property_key is NOT case sensitive, ie. "ProPertY" is the same as "pRoperTy" or "property".

↑ back to available methods

set_representative_resource

Parameters
  • collection_id (number)
  • resource_id (number defaults to null)
Return type
boolean

Choose a Resource that is the best representation of a collection. Typical use case: set a miniature for a collection.

The Resource does not have to be contained in the collection.

Resource id may be set set to None/Null.

↑ back to available methods

set_role

Parameters
  • project_id (number)
  • role_label (string)
  • permissions (List[int])
Return type
object

Create or update a role on a project, with the given permissions.

Requires superuser.

↑ back to available methods

set_tag

Parameters
  • uid (string)
  • project_id (number)
  • label (string defaults to null)
  • ark (string defaults to null)
Return type
object

Get or create a Tag by uid (unique identifier). 'label' is an optional human-readable name.

Example output:

{ "id": 1, "uid": "PAINTINGS", "label": "peintures", "ark": null, }

↑ back to available methods

supported_file_types

Parameters
no parameters
Return type
array[object]

Get a list of all supported file type, complete with their mimes.

Example output:

[ { "mime": "image/jpeg", "extensions": [".jpg", ".jpeg"], "iiif_support": true, } ]

↑ back to available methods

tags

Parameters
  • project_id (number)
Return type
array[object]

Returns all tags available in the project.

Example output:

[ { "id": 1, "uid": "PAINTINGS", "label": "peintures", "ark": null, }, { "id": 2, "uid": "PHOTOS", "label": "photos", "ark": null, } ]

↑ back to available methods

unpublish_collection

Parameters
  • collection_id (number)
Return type
boolean

Mark a collection as private

↑ back to available methods

update_resource_from_xlsx_row

Parameters
  • resource_data (object)
Return type
boolean

Compound method to update resource and resources metadata from a xlsx file row.

↑ back to available methods

upload_infos

Parameters
  • sha256_hash (string)
  • project_id (number)
Return type
object

Get information for an upload based on the file hash.

Example output:

{ "status": "not available", "id": null, "available_chunks":[] }

"status" being one of "not available", "available" or "incomplete"

↑ back to available methods

user_tasks_status

Parameters
  • project_id (number defaults to null)
Return type
array[object]

Returns list of user tasks. Each task being serialized like so:

{ "object_type": "task", "id": user_task_instance.id, "description": user_task_instance.description, "created_at": user_task_instance.created_at.isoformat(), "started_at": user_task_instance.started_at.isoformat(), "finished_at": user_task_instance.finished_at.isoformat(), "failed_at": user_task_instance.failed_at.isoformat(), "project_id": user_task_instance.project_id }

↑ back to available methods

bibnum_remove_meta_value_by_key

Parameters
  • value_item (string)
  • key (string)
Return type
boolean

'key' metas on resources & collections with 'valueitem' as value will be removed. Exemple : valueitem = 'Bibliothéque Pierre Sineux', key = 'library'

↑ back to available methods

bibnum_set_resources_work_status

Parameters
  • from_collection_id (number)
  • selection (object)
  • status (string)
Return type
boolean

Status should be one of: todo, wip, done.

Use such a dict for selection: { "include": { "resources_ids": [3493, 159] "collections_ids:" [20, 31] }, "exclude": { "resources_ids": [12, 10, 15] "collections_ids:" [4, 254, 17] } }

↑ back to available methods

bibnum_update_meta_value_by_key

Parameters
  • old_value_item (string)
  • new_value_item (string)
  • key (string)
Return type
boolean

Sets meta value given its key

↑ back to available methods

normanum_collection_by_topic

Parameters
  • topic_title (string)
Return type
array[object]

Get the list of collections given a topic. Topic ('collection' in french scd language) is an scd metadata

↑ back to available methods

normanum_collections_by_types

Parameters
  • dc_types (array[string])
Return type
array[object]

Get the list of collections given a list of dc types

↑ back to available methods