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-12-16T10:01:28.630213",
"lastModified" : "2024-12-16T10:01:28.840383",
"contentType" : "application/json",
"content" : "{ \"testKey\": \"testValue\"}",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
}
}
}
Requests
- View a resource in a workspace
- View the content of a resource in a workspace
- View all resources in a workspace
- Publish multiple resources to a workspace
- Create or update a resource in a workspace
- Delete a resource in a workspace
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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json' -i -X GET \
-H 'Accept: application/hal+json' \
-H 'Content-Type: application/json'
Python (requests
)
import requests
url = "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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-12-16T10:01:28.630213",
"lastModified" : "2024-12-16T10:01:28.840383",
"contentType" : "application/json",
"content" : "{ \"testKey\": \"testValue\"}",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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-12-16T10:01:29.553324",
"lastModified" : "2024-12-16T10:01:29.553324",
"contentType" : "application/pdf",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.pdf"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.pdf"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.pdf"
}
}
}, {
"path" : "files/test.html",
"created" : "2024-12-16T10:01:29.551058",
"lastModified" : "2024-12-16T10:01:29.551058",
"contentType" : "text/html",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.html"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.html"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.html"
}
}
}, {
"path" : "files/test.json",
"created" : "2024-12-16T10:01:29.548503",
"lastModified" : "2024-12-16T10:01:29.548504",
"contentType" : "application/json",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.json"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.json"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.json"
}
}
}, {
"path" : "embedded/test.json",
"created" : "2024-12-16T10:01:28.630213",
"lastModified" : "2024-12-16T10:01:28.840383",
"contentType" : "application/json",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources' -i -X POST \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: multipart/form-data; boundary="hooIks_klUhPWuakSpYEjsveJy5ySCKp"' \
-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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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-12-16T10:01:29.553324",
"lastModified" : "2024-12-16T10:01:29.553324",
"contentType" : "application/pdf",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.pdf"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.pdf"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.pdf"
}
}
}, {
"path" : "files/test.html",
"created" : "2024-12-16T10:01:29.551058",
"lastModified" : "2024-12-16T10:01:29.551058",
"contentType" : "text/html",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.html"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.html"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.html"
}
}
}, {
"path" : "files/test.json",
"created" : "2024-12-16T10:01:29.548503",
"lastModified" : "2024-12-16T10:01:29.548504",
"contentType" : "application/json",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.json"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.json"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/files/test.json"
}
}
}, {
"path" : "embedded/test.json",
"created" : "2024-12-16T10:01:28.630213",
"lastModified" : "2024-12-16T10:01:28.840383",
"contentType" : "application/json",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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-12-16T10:01:28.630213",
"lastModified" : "2024-12-16T10:01:28.840382949",
"contentType" : "application/json",
"content" : "{ \"testKey\": \"testValue\"}",
"_links" : {
"self" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
},
"update resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/resources/embedded/test.json"
},
"delete resource" : {
"href" : "https://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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://app.matatika.com/api/workspaces/5e2b0c0a-1ef0-4193-9a79-5cb78ca82fc9/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.