mrx-register api v1.0.0-oas3.1 2025-02-19
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 Scope Scope Description read Grants read access write Grants write access admin Grants access to admin operations
Default get__test Code samples
1
2
3
# You can also use wget
curl -X GET /test \
-H 'Accept: text/plain'
1
2
3
GET /test HTTP /1.1
Accept: text/plain
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const headers = {
'Accept' :'text/plain'
};
fetch('/test' ,
{
method: 'GET' ,
headers: headers
})
.then(function (res) {
return res.json();
}).then(function (body) {
console.log(body);
});
1
2
3
4
5
6
7
8
9
10
11
12
require 'rest-client'
require 'json'
headers = {
'Accept' => 'text/plain'
}
result = RestClient.get '/test' ,
params : {
}, headers : headers
p JSON.parse(result)
1
2
3
4
5
6
7
8
import requests
headers = {
'Accept' : 'text/plain'
}
r = requests.get('/test' , headers = headers)
print(r.json())
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
require 'vendor/autoload.php' ;
$headers = array (
'Accept' => 'text/plain' ,
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array ();
try {
$response = $client->request('GET' ,'/test' , array (
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
1
2
3
4
5
6
7
8
9
10
11
12
13
URL obj = new URL("/test" );
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET" );
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null ) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map [string ][]string {
"Accept" : []string {"text/plain" },
}
data := bytes.NewBuffer([]byte {jsonReq})
req, err := http.NewRequest("GET" , "/test" , data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /test
Example responses
200 Response
"string"
Responses Status Meaning Description Schema 200 OK self test pass string 400 Bad Request test failed None
This operation does not require authentication public Public access operations - unsecured
searchRegisterEntries
Code samples
1
2
3
# You can also use wget
curl -X GET /reg \
-H 'Accept: application/json'
1
2
3
GET /reg HTTP /1.1
Accept: application/json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const headers = {
'Accept' :'application/json'
};
fetch('/reg' ,
{
method: 'GET' ,
headers: headers
})
.then(function (res) {
return res.json();
}).then(function (body) {
console.log(body);
});
1
2
3
4
5
6
7
8
9
10
11
12
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/reg' ,
params : {
}, headers : headers
p JSON.parse(result)
1
2
3
4
5
6
7
8
import requests
headers = {
'Accept' : 'application/json'
}
r = requests.get('/reg' , headers = headers)
print(r.json())
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
require 'vendor/autoload.php' ;
$headers = array (
'Accept' => 'application/json' ,
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array ();
try {
$response = $client->request('GET' ,'/reg' , array (
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
1
2
3
4
5
6
7
8
9
10
11
12
13
URL obj = new URL("/reg" );
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET" );
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null ) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map [string ][]string {
"Accept" : []string {"application/json" },
}
data := bytes.NewBuffer([]byte {jsonReq})
req, err := http.NewRequest("GET" , "/reg" , data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /reg
search local 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 Enumerated Values Parameter Value sort ASC sort DESC sort CREATE sort MODIFIED sort ALPHABETICAL
Example responses
200 Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
[
{
"apiVersion": "v0.5.1" ,
"entries": [
"string"
],
"format": "MrxIds" ,
"limit": 20,
"queryId": "d290f1ee-6c54-4b01-90e6-d701748f0851" ,
"start": 7321,
"serverInfo": {
"name": "mrx-reg-server" ,
"homePage": "https://metarex.media" ,
"supportUrl": "https://github.com/metarex-media/mrx-reg-server/issues" ,
"version": "v0.5.1"
}
}
]
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
This operation does not require authentication owner addRegisterEntryGenID
Code samples
1
2
3
4
5
# You can also use wget
curl -X POST /reg \
-H 'Content-Type: application/json' \
-H 'Accept: text/plain' \
-H 'Authorization: Bearer {access-token}'
1
2
3
4
POST /reg HTTP /1.1
Content-Type: application/json
Accept: text/plain
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const inputBody = '{
"metarexId": "string",
"replacedBy": "string",
"name": "string",
"description": "string",
"mediaType": "string",
"timingIs": "string",
"treatAs": "string",
"expires": "string",
"mrx": {
"specification": "string",
"services": [
{
"API": "string",
"method": "string",
"metarexId": "string",
"APISchema": "string",
"output": "string",
"description": "string",
"serviceID": "string"
}
],
"mapping": {
"convertTypes": true,
"MissedFieldsKey": "string",
"mappingDefinitions": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
},
"extra": {}
}' ;
const headers = {
'Content-Type' :'application/json' ,
'Accept' :'text/plain' ,
'Authorization' :'Bearer {access-token}'
};
fetch('/reg' ,
{
method: 'POST' ,
body: inputBody,
headers: headers
})
.then(function (res) {
return res.json();
}).then(function (body) {
console.log(body);
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json' ,
'Accept' => 'text/plain' ,
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post '/reg' ,
params : {
}, headers : headers
p JSON.parse(result)
1
2
3
4
5
6
7
8
9
10
import requests
headers = {
'Content-Type' : 'application/json' ,
'Accept' : 'text/plain' ,
'Authorization' : 'Bearer {access-token}'
}
r = requests.post('/reg' , headers = headers)
print(r.json())
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require 'vendor/autoload.php' ;
$headers = array (
'Content-Type' => 'application/json' ,
'Accept' => 'text/plain' ,
'Authorization' => 'Bearer {access-token}' ,
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array ();
try {
$response = $client->request('POST' ,'/reg' , array (
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
1
2
3
4
5
6
7
8
9
10
11
12
13
URL obj = new URL("/reg" );
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST" );
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null ) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map [string ][]string {
"Content-Type" : []string {"application/json" },
"Accept" : []string {"text/plain" },
"Authorization" : []string {"Bearer {access-token}" },
}
data := bytes.NewBuffer([]byte {jsonReq})
req, err := http.NewRequest("POST" , "/reg" , data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /reg
adds an inventory item
gets a new entry to the MetaRex register
Body parameter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"metarexId": "string" ,
"replacedBy": "string" ,
"name": "string" ,
"description": "string" ,
"mediaType": "string" ,
"timingIs": "string" ,
"treatAs": "string" ,
"expires": "string" ,
"mrx": {
"specification": "string" ,
"services": [
{
"API": "string" ,
"method": "string" ,
"metarexId": "string" ,
"APISchema": "string" ,
"output": "string" ,
"description": "string" ,
"serviceID": "string"
}
],
"mapping": {
"convertTypes": true ,
"MissedFieldsKey": "string" ,
"mappingDefinitions": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
},
"extra": {}
}
Parameters Name In Type Required Description body body MRXDefinition false The Metarex register definition
Example responses
201 Response
"string"
400 Response
1
2
3
{
"ErrorMessage": "string"
}
Responses To perform this operation, you must be authenticated by means of one of the following methods:
OAuth2 ( Scopes: write admin ) getRegisterEntry
Code samples
1
2
3
# You can also use wget
curl -X GET /reg/{id} \
-H 'Accept: application/json'
1
2
3
GET /reg/{id} HTTP /1.1
Accept: application/json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
const headers = {
'Accept' :'application/json'
};
fetch('/reg/{id}' ,
{
method: 'GET' ,
headers: headers
})
.then(function (res) {
return res.json();
}).then(function (body) {
console.log(body);
});
1
2
3
4
5
6
7
8
9
10
11
12
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get '/reg/{id}' ,
params : {
}, headers : headers
p JSON.parse(result)
1
2
3
4
5
6
7
8
import requests
headers = {
'Accept' : 'application/json'
}
r = requests.get('/reg/ {id} ' , headers = headers)
print(r.json())
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
require 'vendor/autoload.php' ;
$headers = array (
'Accept' => 'application/json' ,
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array ();
try {
$response = $client->request('GET' ,'/reg/{id}' , array (
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
1
2
3
4
5
6
7
8
9
10
11
12
13
URL obj = new URL("/reg/{id}" );
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET" );
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null ) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map [string ][]string {
"Accept" : []string {"application/json" },
}
data := bytes.NewBuffer([]byte {jsonReq})
req, err := http.NewRequest("GET" , "/reg/{id}" , data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /reg/{id}
gets an inventory item
gets a new entry to the MetaRex register
Parameters Example responses
200 Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"metarexId": "string" ,
"replacedBy": "string" ,
"name": "string" ,
"description": "string" ,
"mediaType": "string" ,
"timingIs": "string" ,
"treatAs": "string" ,
"expires": "string" ,
"mrx": {
"specification": "string" ,
"services": [
{
"API": "string" ,
"method": "string" ,
"metarexId": "string" ,
"APISchema": "string" ,
"output": "string" ,
"description": "string" ,
"serviceID": "string"
}
],
"mapping": {
"convertTypes": true ,
"MissedFieldsKey": "string" ,
"mappingDefinitions": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
},
"extra": {}
}
Responses This operation does not require authentication addRegisterEntry
Code samples
1
2
3
4
5
# You can also use wget
curl -X POST /reg/{id} \
-H 'Content-Type: application/json' \
-H 'Accept: text/plain' \
-H 'Authorization: Bearer {access-token}'
1
2
3
4
POST /reg/{id} HTTP /1.1
Content-Type: application/json
Accept: text/plain
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
const inputBody = '{
"metarexId": "string",
"replacedBy": "string",
"name": "string",
"description": "string",
"mediaType": "string",
"timingIs": "string",
"treatAs": "string",
"expires": "string",
"mrx": {
"specification": "string",
"services": [
{
"API": "string",
"method": "string",
"metarexId": "string",
"APISchema": "string",
"output": "string",
"description": "string",
"serviceID": "string"
}
],
"mapping": {
"convertTypes": true,
"MissedFieldsKey": "string",
"mappingDefinitions": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
},
"extra": {}
}' ;
const headers = {
'Content-Type' :'application/json' ,
'Accept' :'text/plain' ,
'Authorization' :'Bearer {access-token}'
};
fetch('/reg/{id}' ,
{
method: 'POST' ,
body: inputBody,
headers: headers
})
.then(function (res) {
return res.json();
}).then(function (body) {
console.log(body);
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json' ,
'Accept' => 'text/plain' ,
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post '/reg/{id}' ,
params : {
}, headers : headers
p JSON.parse(result)
1
2
3
4
5
6
7
8
9
10
import requests
headers = {
'Content-Type' : 'application/json' ,
'Accept' : 'text/plain' ,
'Authorization' : 'Bearer {access-token}'
}
r = requests.post('/reg/ {id} ' , headers = headers)
print(r.json())
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
require 'vendor/autoload.php' ;
$headers = array (
'Content-Type' => 'application/json' ,
'Accept' => 'text/plain' ,
'Authorization' => 'Bearer {access-token}' ,
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array ();
try {
$response = $client->request('POST' ,'/reg/{id}' , array (
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
1
2
3
4
5
6
7
8
9
10
11
12
13
URL obj = new URL("/reg/{id}" );
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST" );
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null ) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map [string ][]string {
"Content-Type" : []string {"application/json" },
"Accept" : []string {"text/plain" },
"Authorization" : []string {"Bearer {access-token}" },
}
data := bytes.NewBuffer([]byte {jsonReq})
req, err := http.NewRequest("POST" , "/reg/{id}" , data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /reg/{id}
adds an inventory item
gets a new entry to the MetaRex register
Body parameter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"metarexId": "string" ,
"replacedBy": "string" ,
"name": "string" ,
"description": "string" ,
"mediaType": "string" ,
"timingIs": "string" ,
"treatAs": "string" ,
"expires": "string" ,
"mrx": {
"specification": "string" ,
"services": [
{
"API": "string" ,
"method": "string" ,
"metarexId": "string" ,
"APISchema": "string" ,
"output": "string" ,
"description": "string" ,
"serviceID": "string"
}
],
"mapping": {
"convertTypes": true ,
"MissedFieldsKey": "string" ,
"mappingDefinitions": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
},
"extra": {}
}
Parameters Example responses
201 Response
"string"
400 Response
1
2
3
{
"ErrorMessage": "string"
}
Responses To perform this operation, you must be authenticated by means of one of the following methods:
OAuth2 ( Scopes: write admin ) getRegisterEntryAdmin
Code samples
1
2
3
4
# You can also use wget
curl -X GET /regadmin/reg/{id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
1
2
3
GET /regadmin/reg/{id} HTTP /1.1
Accept: application/json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const headers = {
'Accept' :'application/json' ,
'Authorization' :'Bearer {access-token}'
};
fetch('/regadmin/reg/{id}' ,
{
method: 'GET' ,
headers: headers
})
.then(function (res) {
return res.json();
}).then(function (body) {
console.log(body);
});
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json' ,
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get '/regadmin/reg/{id}' ,
params : {
}, headers : headers
p JSON.parse(result)
1
2
3
4
5
6
7
8
9
import requests
headers = {
'Accept' : 'application/json' ,
'Authorization' : 'Bearer {access-token}'
}
r = requests.get('/regadmin/reg/ {id} ' , headers = headers)
print(r.json())
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require 'vendor/autoload.php' ;
$headers = array (
'Accept' => 'application/json' ,
'Authorization' => 'Bearer {access-token}' ,
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array ();
try {
$response = $client->request('GET' ,'/regadmin/reg/{id}' , array (
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
1
2
3
4
5
6
7
8
9
10
11
12
13
URL obj = new URL("/regadmin/reg/{id}" );
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET" );
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null ) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map [string ][]string {
"Accept" : []string {"application/json" },
"Authorization" : []string {"Bearer {access-token}" },
}
data := bytes.NewBuffer([]byte {jsonReq})
req, err := http.NewRequest("GET" , "/regadmin/reg/{id}" , data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /regadmin/reg/{id}
gets an inventory item
gets a new entry to the MetaRex register
Parameters Example responses
200 Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"metarexId": "string" ,
"replacedBy": "string" ,
"name": "string" ,
"description": "string" ,
"mediaType": "string" ,
"timingIs": "string" ,
"treatAs": "string" ,
"expires": "string" ,
"mrx": {
"specification": "string" ,
"services": [
{
"API": "string" ,
"method": "string" ,
"metarexId": "string" ,
"APISchema": "string" ,
"output": "string" ,
"description": "string" ,
"serviceID": "string"
}
],
"mapping": {
"convertTypes": true ,
"MissedFieldsKey": "string" ,
"mappingDefinitions": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
},
"extra": {}
}
Responses To perform this operation, you must be authenticated by means of one of the following methods:
OAuth2 ( Scopes: admin ) getHelpRegisterEntryAdmin
Code samples
1
2
3
4
# You can also use wget
curl -X GET /regadmin/reg/{id}/help \
-H 'Accept: text/markdown' \
-H 'Authorization: Bearer {access-token}'
1
2
3
GET /regadmin/reg/{id}/help HTTP /1.1
Accept: text/markdown
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const headers = {
'Accept' :'text/markdown' ,
'Authorization' :'Bearer {access-token}'
};
fetch('/regadmin/reg/{id}/help' ,
{
method: 'GET' ,
headers: headers
})
.then(function (res) {
return res.json();
}).then(function (body) {
console.log(body);
});
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'rest-client'
require 'json'
headers = {
'Accept' => 'text/markdown' ,
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get '/regadmin/reg/{id}/help' ,
params : {
}, headers : headers
p JSON.parse(result)
1
2
3
4
5
6
7
8
9
import requests
headers = {
'Accept' : 'text/markdown' ,
'Authorization' : 'Bearer {access-token}'
}
r = requests.get('/regadmin/reg/ {id} /help' , headers = headers)
print(r.json())
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require 'vendor/autoload.php' ;
$headers = array (
'Accept' => 'text/markdown' ,
'Authorization' => 'Bearer {access-token}' ,
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array ();
try {
$response = $client->request('GET' ,'/regadmin/reg/{id}/help' , array (
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
1
2
3
4
5
6
7
8
9
10
11
12
13
URL obj = new URL("/regadmin/reg/{id}/help" );
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET" );
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null ) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map [string ][]string {
"Accept" : []string {"text/markdown" },
"Authorization" : []string {"Bearer {access-token}" },
}
data := bytes.NewBuffer([]byte {jsonReq})
req, err := http.NewRequest("GET" , "/regadmin/reg/{id}/help" , data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /regadmin/reg/{id}/help
gets an inventory item
gets a new entry to the MetaRex register
Parameters Example responses
200 Response
400 Response
1
2
3
{
"ErrorMessage": "string"
}
Responses To perform this operation, you must be authenticated by means of one of the following methods:
OAuth2 ( Scopes: admin ) Schemas ErrorMessage 1
2
3
{
"ErrorMessage": "string"
}
Properties Name Type Required Restrictions Description ErrorMessage string false none none
Message 1
2
3
4
{
"Message": "string" ,
"MrxId": "string"
}
Properties Name Type Required Restrictions Description Message string false none none MrxId string false none none
MRXDefinition 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{
"metarexId": "string" ,
"replacedBy": "string" ,
"name": "string" ,
"description": "string" ,
"mediaType": "string" ,
"timingIs": "string" ,
"treatAs": "string" ,
"expires": "string" ,
"mrx": {
"specification": "string" ,
"services": [
{
"API": "string" ,
"method": "string" ,
"metarexId": "string" ,
"APISchema": "string" ,
"output": "string" ,
"description": "string" ,
"serviceID": "string"
}
],
"mapping": {
"convertTypes": true ,
"MissedFieldsKey": "string" ,
"mappingDefinitions": {
"property1": [
"string"
],
"property2": [
"string"
]
}
}
},
"extra": {}
}
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
xor
EntryArraySchema 1
2
3
4
5
6
[
{
"mrxId": "string" ,
"name": "string"
}
]
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 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"apiVersion": "v0.5.1" ,
"entries": [
"string"
],
"format": "MrxIds" ,
"limit": 20,
"queryId": "d290f1ee-6c54-4b01-90e6-d701748f0851" ,
"start": 7321,
"serverInfo": {
"name": "mrx-reg-server" ,
"homePage": "https://metarex.media" ,
"supportUrl": "https://github.com/metarex-media/mrx-reg-server/issues" ,
"version": "v0.5.1"
}
}
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 1
2
3
4
5
6
{
"name": "mrx-reg-server" ,
"homePage": "https://metarex.media" ,
"supportUrl": "https://github.com/metarex-media/mrx-reg-server/issues" ,
"version": "v0.5.1"
}
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