Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

Profiles: Get item template

Natasa Bulatovic edited this page Feb 3, 2016 · 2 revisions

##GET /profiles/:id/template *Retrieves a template item for a metadata profile with this id - this item template can be used to create items in all collections where this metadata profile has been used, upon provision of proper collectionId (see example response below).

####Response status codes #####200 OK Successful retrieval of the template item

#####404 Not found The profile with provided :id is not found (does not exist)

#####401 Unauthorized Authentication is necessary to retrieve the template item for this metadata profile (depends on authorization for the metadata profile)

#####403 Forbidden Wrong credentials provided to retrieve the template item for this profile (depends on authorization for the metadata profile)

####Example request curl http://<base-url>/profiles/FKMxUpYdV9N2J4XG/template

#####Example response body (for a metadata profile with 3 metadata fields: Title (text type), License(license type), Comment (text type))

{
 "id": "newid",
 "version": 0,
 "collectionId": "provide-your-collection-id-here",
 "filename": "<change-the-file-name-here-or-provide-separate-field-for-fetch-or-reference-url-see-API-Documentation>",
 "fileSize": 0,
 "metadata": {
   "Title": "Textual value",
   "License": {
     "license": "License name",
     "url": "http://example.license.com"
   },
   "Comment": "Textual value"
  }

}

Clone this wiki locally