mrx-register api v1.0.0-oas3.1
25 minute read
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
mrx-reg-svr
The OpenAPI Schema for the MetaRex register To find out more about MetaRex and our mission, visit the website .
This handles creating and getting of simple register entries, as well as admin areas and finding out whats currently in the register.
Developer Design Choices
Here is the list of choices we have made in the design of the register, that may not be noticeable from reading the specification.
1. Handling a Trailing /
The trailing / is not explicitly declared in the path OpenAPI specification, mainly to reduce bloating the schema with duplicated fields and to reduce errors for autogenerating server code based on the specification. For the ease of integration into different proxies such as NGINX then a design decision has been taken to allow the register to handle them.
For example /reg
and /reg/
are expected to give the same response, as are
/reg?limit=20
and /reg/?limit=20
. In the
demo server
, this is achieved by stripping the trailing / from
the URL of any requests.
Email: Support License: BSD 3 Clause
Authentication
oAuth2 authentication.
- Flow: authorizationCode
- Authorization URL = https://example.com/oauth/authorize
- Token URL = https://example.com/oauth/token
Scope | Scope Description |
---|---|
read | Grants read access |
write | Grants write access |
admin | Grants access to admin operations |
Default
get__test
Code samples
|
|
|
|
|
|
GET /test
Example responses
200 Response
"string"
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | self test pass | string |
400 | Bad Request | test failed | None |
public
Public access operations - unsecured
searchRegisterEntries
Code samples
|
|
|
|
|
|
GET /reg
search local register
Query the local MetaRex register
Defaults to returning the most recently added entries based on the configuration of limit
.
Query parameter summary (see definitions for defaults):
- ‘skip=N’ skips the first N entries of the returned results * ’limit=L’ return only
L
results. * ‘sort=ASC|DESC,CREATE|MODIFIED|ALPHABETICAL’ sorting. * ‘format=MrxIds|EntriesList’
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
skip | query | skipParamSchema | false | Number of records to skip before returning list. |
limit | query | limitValueSchema | false | Maxiumum number of records to return. |
sort | query | sortParamElementSchema | false | Sorting of returned records. |
Enumerated Values
Parameter | Value |
---|---|
sort | ASC |
sort | DESC |
sort | CREATE |
sort | MODIFIED |
sort | ALPHABETICAL |
Example responses
200 Response
|
|
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | search results matching criteria | Inline |
400 | Bad Request | bad input parameter | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [ EntriesResponseSchema ] | false | none | [A list of Entry objects for presentation on a UI] |
» apiVersion | semVerSchema | true | none | a valid semantic version as defined by semver.org |
» entries | any | true | none | none |
oneOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»» anonymous | [string] | false | none | none |
xor
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»» anonymous | [object] | false | none | none |
»»» mrxId | string | true | none | none |
»»» name | string | true | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» format | string | true | none | The format of the elements of the list |
» limit | integer | true | none | The value of the limit query param (if specified) or the default value of limit (if unspecified in the query) or the maximum value that can be used in this system if the specified value was too big. |
» queryId | string(uuid) | true | none | The id of the query that generated this list |
» start | integer | true | none | The number of records skipped before returning this list |
» serverInfo | serverInfoSchema | false | none | information about the server providing results |
»» name | string | false | none | name of the server software |
»» homePage | string(url) | false | none | none |
»» supportUrl | string(url) | true | none | none |
»» version | string | true | none | a valid semantic version for the running server as defined by semver.org |
Enumerated Values
Property | Value |
---|---|
format | MrxIds |
format | EntriesList |
owner
addRegisterEntryGenID
Code samples
|
|
|
|
|
|
|
|
POST /reg
adds an inventory item
gets a new entry to the MetaRex register
Body parameter
|
|
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | MRXDefinition | false | The Metarex register definition |
Example responses
201 Response
"string"
400 Response
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | item uploaded | string |
400 | Bad Request | error posting the entry | ErrorMessage |
401 | Unauthorized | No post permissions | ErrorMessage |
409 | Conflict | invalid id, register entry already exists | ErrorMessage |
getRegisterEntry
Code samples
|
|
|
|
|
|
GET /reg/{id}
gets an inventory item
gets a new entry to the MetaRex register
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | MrxIdSchema | true | none |
Example responses
200 Response
|
|
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | item found | MRXDefinition |
400 | Bad Request | invalid id, no register entry found | ErrorMessage |
addRegisterEntry
Code samples
|
|
|
|
|
|
|
|
POST /reg/{id}
adds an inventory item
gets a new entry to the MetaRex register
Body parameter
|
|
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | MrxIdPostSchema | true | none |
body | body | MRXDefinition | false | The Metarex register definition |
Example responses
201 Response
"string"
400 Response
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | item uploaded | string |
400 | Bad Request | error posting the entry | ErrorMessage |
401 | Unauthorized | No post permissions | ErrorMessage |
409 | Conflict | invalid id, register entry already exists | ErrorMessage |
getRegisterEntryAdmin
Code samples
|
|
|
|
|
|
GET /regadmin/reg/{id}
gets an inventory item
gets a new entry to the MetaRex register
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | MrxIdSchema | true | none |
Example responses
200 Response
|
|
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | item found | MRXDefinition |
400 | Bad Request | invalid id, no register entry found | ErrorMessage |
401 | Unauthorized | No admin permissions | ErrorMessage |
getHelpRegisterEntryAdmin
Code samples
|
|
|
|
|
|
GET /regadmin/reg/{id}/help
gets an inventory item
gets a new entry to the MetaRex register
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
id | path | MrxIdSchema | true | none |
Example responses
200 Response
400 Response
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | item found | Message |
400 | Bad Request | invalid id, no register entry found | ErrorMessage |
401 | Unauthorized | No admin permissions | ErrorMessage |
Schemas
ErrorMessage
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
ErrorMessage | string | false | none | none |
Message
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
Message | string | false | none | none |
MrxId | string | false | none | none |
MRXDefinition
|
|
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
metarexId | MrxIdSchema | true | none | an MRX generated ID matching the pattern or a uuid type 1 |
replacedBy | MrxIdSchema | false | none | a Metarex ID superseding this entry |
name | string | true | none | A short human readable UTF-8 name for the metadata payload in the language of its intended use. |
description | string | true | none | A short human readable UTF-8 description of the type of metadata with this is ID in the language of its intended use. |
mediaType | string | true | none | a valid media type for the unwrapped metadata payload when sent using a POST request to a web service ( https://www.iana.org/assignments/media-types/ ) |
timingIs | string | false | none | clocked when there is one document per frame (MXF frame wrapping). embedded when the timing is inside the metadata document |
treatAs | string | false | none | text when the metadata is treated like text (JSON, YAML, XML etc), binary when the document is treated as a blob by some application (machine data, word docs, pdf docs and the like) |
expires | string | false | none | The UTC date+time when this entry may be removed from the register. If the property is missing then the entry never expires. |
mrx | object | false | none | mrx controlled properties that enhance the metadata definition |
» specification | string | false | none | none |
» services | [object] | false | none | none |
»» API | string | false | none | none |
»» method | string | false | none | none |
»» metarexId | string | false | none | none |
»» APISchema | string | false | none | none |
»» output | string | false | none | none |
»» description | string | false | none | none |
»» serviceID | string | false | none | none |
» mapping | object | false | none | none |
»» convertTypes | boolean | false | none | none |
»» MissedFieldsKey | string | false | none | none |
»» mappingDefinitions | object | false | none | none |
»»» additionalProperties | [string] | false | none | none |
extra | object | false | none | registrant controlled properties that enhance the metadata definition |
EntriesArraySchema
Properties
oneOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | MrxIdsArraySchema | false | none | none |
xor
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | EntryArraySchema | false | none | none |
EntryArraySchema
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
mrxId | string | true | none | none |
name | string | true | none | none |
MrxIdsArraySchema
Properties
None
MrxIdSchema
|
|
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | none |
MrxIdPostSchema
|
|
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | none |
EntriesResponseSchema
|
|
A list of Entry objects for presentation on a UI
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
apiVersion | semVerSchema | true | none | a valid semantic version as defined by semver.org |
entries | EntriesArraySchema | true | none | none |
format | string | true | none | The format of the elements of the list |
limit | integer | true | none | The value of the limit query param (if specified) or the default value of limit (if unspecified in the query) or the maximum value that can be used in this system if the specified value was too big. |
queryId | string(uuid) | true | none | The id of the query that generated this list |
start | integer | true | none | The number of records skipped before returning this list |
serverInfo | serverInfoSchema | false | none | information about the server providing results |
Enumerated Values
Property | Value |
---|---|
format | MrxIds |
format | EntriesList |
MrxEntryPostSchema
|
|
this API is an implementation of the document specified at https://metarex.media/reg/MXF.123.456.769.abc
Properties
None
serverInfoSchema
information about the server providing results
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
name | string | false | none | name of the server software |
homePage | string(url) | false | none | none |
supportUrl | string(url) | true | none | none |
version | string | true | none | a valid semantic version for the running server as defined by semver.org |
limitAllSchema
|
|
A value of ALL for limit will result in the maximum number of entries allowed by the system (max limit)
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | A value of ALL for limit will result in the maximum number of entries allowed by the system (max limit) |
Enumerated Values
Property | Value |
---|---|
anonymous | ALL |
limitSchema
|
|
Properties
None
limitValueSchema
|
|
A limit can be an integer value indicating the maximum number of entries to return in a query. A limit value set greater than the system’s internal max limit value will be clamped to the max limit value number.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | integer | false | none | A limit can be an integer value indicating the maximum number of entries to return in a query. A limit value set greater than the system’s internal max limit value will be clamped to the max limit value number. |
skipParamSchema
|
|
an integer of the number of items to skip in responses
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | integer | false | none | an integer of the number of items to skip in responses |
semVerSchema
|
|
a valid semantic version as defined by semver.org
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | a valid semantic version as defined by semver.org |
sortParamSchema
|
|
A comma separated list of sortParamElementSchema
values presented as an array to the server.
Properties
None
sortParamElementSchema
|
|
Valid keywords are described here - how the logic is applied is application specific. Recommended behaviour is that precedence is highest at the start of the query string and lowest at the end.
sort=ASC,MODIFIED,DESC,ALPHABETICAL
would result in sorting by ASC
first, then MODIFIED
. DESC
and ALPHABETICAL
are ignored because of mutual exclusivity rules.
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | string | false | none | Valid keywords are described here - how the logic is applied is application specific. Recommended behaviour is that precedence is highest at the start of the query string and lowest at the end.sort=ASC,MODIFIED,DESC,ALPHABETICAL would result in sorting by ASC first, then MODIFIED . DESC and ALPHABETICAL are ignored because of mutual exclusivity rules. |
Enumerated Values
Property | Value |
---|---|
anonymous | ASC |
anonymous | DESC |
anonymous | CREATE |
anonymous | MODIFIED |
anonymous | ALPHABETICAL |