Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Resources

Resources are files that are managed by a workspace. A resource is accessible from /api/workspaces/{workspace-id}/resources by its path.


Objects

Resource

Path Type Format Description
path String   The resource path
created String ISO 8601 timestamp The instant the resource was created at
lastModified String ISO 8601 timestamp The instant the resource was last modified at
contentType String MIME type The content type of the resource
content String   The content of the resource
{
  "path" : "embedded/test.json",
  "created" : "2024-04-10T14:19:08.337625",
  "lastModified" : "2024-04-10T14:19:08.532453",
  "contentType" : "application/json",
  "content" : "{ \"testKey\": \"testValue\"}",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
    },
    "update resource" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
    },
    "delete resource" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
    }
  }
}

Requests


View a resource in a workspace

GET

/api/workspaces/{workspace-id}/resources/{resource-path}

Returns the resource {resource-path} in the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist
  • Resource {resource-path} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json' -i -X GET \
    -H 'Accept: application/hal+json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

Resource with HAL links.

{
  "path" : "embedded/test.json",
  "created" : "2024-04-10T14:19:08.337625",
  "lastModified" : "2024-04-10T14:19:08.532453",
  "contentType" : "application/json",
  "content" : "{ \"testKey\": \"testValue\"}",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
    },
    "update resource" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
    },
    "delete resource" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
    }
  }
}

View the content of a resource in a workspace

GET

/api/workspaces/{workspace-id}/resources/{resource-path}

Returns the content of the resource {resource-path} in the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist
  • Resource {resource-path} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

The resource content.

{
  "testKey" : "testValue"
}

View all resources in a workspace

GET

/api/workspaces/{workspace-id}/resources

Returns all resources in the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist
  • Resource {resource-path} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources' -i -X GET \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

Resource collection with HAL links.

{
  "_embedded" : {
    "resources" : [ {
      "path" : "files/test.pdf",
      "created" : "2024-04-10T14:19:09.197992",
      "lastModified" : "2024-04-10T14:19:09.197992",
      "contentType" : "application/pdf",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.pdf"
        },
        "update resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.pdf"
        },
        "delete resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.pdf"
        }
      }
    }, {
      "path" : "files/test.html",
      "created" : "2024-04-10T14:19:09.195818",
      "lastModified" : "2024-04-10T14:19:09.195818",
      "contentType" : "text/html",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.html"
        },
        "update resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.html"
        },
        "delete resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.html"
        }
      }
    }, {
      "path" : "files/test.json",
      "created" : "2024-04-10T14:19:09.193249",
      "lastModified" : "2024-04-10T14:19:09.193249",
      "contentType" : "application/json",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.json"
        },
        "update resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.json"
        },
        "delete resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.json"
        }
      }
    }, {
      "path" : "embedded/test.json",
      "created" : "2024-04-10T14:19:08.337625",
      "lastModified" : "2024-04-10T14:19:08.532453",
      "contentType" : "application/json",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
        },
        "update resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
        },
        "delete resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources?page=0&size=20"
    }
  },
  "page" : {
    "size" : 20,
    "totalElements" : 4,
    "totalPages" : 1,
    "number" : 0
  }
}

Publish multiple resources to a workspace

POST

/api/workspaces/{workspace-id}/resources

Publishes multiple resources to the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources' -i -X POST \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: multipart/form-data; boundary="hnt3zsfLPoC3WficmByUjhjbdI6HHMo21LW"' \
    -F 'files/[email protected];type=application/json' \
    -F 'files/[email protected];type=text/html' \
    -F 'files/[email protected];type=application/pdf'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("POST", url, headers=headers)

print(response.text.encode('utf8'))

Response

200 OK

Resource collection with HAL links.

{
  "_embedded" : {
    "resources" : [ {
      "path" : "files/test.pdf",
      "created" : "2024-04-10T14:19:09.197992",
      "lastModified" : "2024-04-10T14:19:09.197992",
      "contentType" : "application/pdf",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.pdf"
        },
        "update resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.pdf"
        },
        "delete resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.pdf"
        }
      }
    }, {
      "path" : "files/test.html",
      "created" : "2024-04-10T14:19:09.195818",
      "lastModified" : "2024-04-10T14:19:09.195818",
      "contentType" : "text/html",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.html"
        },
        "update resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.html"
        },
        "delete resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.html"
        }
      }
    }, {
      "path" : "files/test.json",
      "created" : "2024-04-10T14:19:09.193249",
      "lastModified" : "2024-04-10T14:19:09.193249",
      "contentType" : "application/json",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.json"
        },
        "update resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.json"
        },
        "delete resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/files/test.json"
        }
      }
    }, {
      "path" : "embedded/test.json",
      "created" : "2024-04-10T14:19:08.337625",
      "lastModified" : "2024-04-10T14:19:08.532453",
      "contentType" : "application/json",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
        },
        "update resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
        },
        "delete resource" : {
          "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
        }
      }
    } ]
  },
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources"
    }
  },
  "page" : {
    "size" : 4,
    "totalElements" : 4,
    "totalPages" : 1,
    "number" : 0
  }
}

Create or update a resource in a workspace

PUT

/api/workspaces/{workspace-id}/resources/{resource-path}

Creates or updates the resource {resource-path} in the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Body

Resource resource.

{
  "contentType" : "application/json",
  "content" : "{ \"testKey\": \"testValue\"}"
}

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json' -i -X PUT \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/hal+json; charset=ISO-8859-1' \
    -d '{
  "contentType" : "application/json",
  "content" : "{ \"testKey\": \"testValue\"}"
}'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"

data = {
  "contentType" : "application/json",
  "content" : "{ \"testKey\": \"testValue\"}"
}
headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("PUT", url, headers=headers, data=data)

print(response.text.encode('utf8'))

Response

200 OK / 201 Created

Resource with HAL links.

{
  "path" : "embedded/test.json",
  "created" : "2024-04-10T14:19:08.337625",
  "lastModified" : "2024-04-10T14:19:08.532453208",
  "contentType" : "application/json",
  "content" : "{ \"testKey\": \"testValue\"}",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
    },
    "update resource" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
    },
    "delete resource" : {
      "href" : "https://catalog.matatika.com/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"
    }
  }
}

Delete a resource in a workspace

DELETE

/api/workspaces/{workspace-id}/resources/{resource-path}

Deletes the resource {resource-path} in the workspace {workspace-id}.

Prerequisites

  • Workspace {workspace-id} must exist

Request

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json' -i -X DELETE \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/workspaces/78b25e4f-4998-4bcd-a2ca-818491bd363f/resources/embedded/test.json"

headers = {
  'Authorization': ACCESS_TOKEN
}

response = requests.request("DELETE", url, headers=headers)

print(response.text.encode('utf8'))

Response

204 No Content

No response body provided.