API Keys
API keys offer an alternate method of authentication to the Matatika API using a client ID and secret. Access using API key credentials is supported by the Matatika CLI and SDK, which allows a user to remain authenticated permanently.
Objects
API Key
Path | Type | Format | Description |
---|---|---|---|
id |
String |
Version 4 UUID | The API key ID |
created |
String |
ISO 8601 timestamp | The instant when the API key was created |
lastModified |
String |
ISO 8601 timestamp | The instant when the API key was last modified |
name |
String |
The API key name | |
clientId |
String |
The API key client ID | |
profileId |
String |
The API key owner profile ID |
{
"id" : "0c853241-ee34-4584-8c83-d9f26b7a2d57",
"created" : "2023-09-20T10:55:56.18672",
"lastModified" : "2023-09-20T10:55:56.186721",
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932)",
"clientId" : "4SgkmHB08wlzYTPngYU7AMoiUkt89EuN",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"update apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"delete apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"profile" : {
"href" : "https://catalog.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
}
Requests
- View all API keys
- View an API key
- Initialise an API key
- Create an API key
- Update an API key
- Delete an API key
View all API keys
GET
/api/apikeys
Returns all API keys owned by the authenticated user profile.
Prerequisites
- The authenticated user must own a Matatika account
- The API key
{apikey-id}
must exist
Request
Example Snippets
- cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/apikeys/' -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/apikeys/"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
API key collection with HAL links.
{
"_embedded" : {
"apikeys" : [ {
"id" : "0c853241-ee34-4584-8c83-d9f26b7a2d57",
"created" : "2023-09-20T10:55:56.18672",
"lastModified" : "2023-09-20T10:55:56.186721",
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932)",
"clientId" : "4SgkmHB08wlzYTPngYU7AMoiUkt89EuN",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"update apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"delete apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"profile" : {
"href" : "https://catalog.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
}, {
"id" : "141783f3-05fe-4a3d-ae7f-c2e0c254f563",
"created" : "2023-09-20T10:55:54.026839",
"lastModified" : "2023-09-20T10:55:54.026839",
"name" : "default",
"clientId" : "OKrCmMXYtUIap3Y9fMQuGWZJ6kW2hLoW",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"accessToken" : "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlJFRkNRamczTlRRMk16QTROalpHT0RjNFFUWkJOemMyTkRGR1FUSkVOVEEyUkRkR1JrSkRPQSJ9.eyJpc3MiOiJodHRwczovL2lkZW50aXR5Lm1hdGF0aWthLmNvbS8iLCJzdWIiOiJPS3JDbU1YWXRVSWFwM1k5Zk1RdUdXWko2a1cyaExvV0BjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9jYXRhbG9nLm1hdGF0aWthLmNvbS9hcGkiLCJpYXQiOjE2OTUyMDczNTUsImV4cCI6MTY5NTI5Mzc1NSwiYXpwIjoiT0tyQ21NWFl0VUlhcDNZOWZNUXVHV1pKNmtXMmhMb1ciLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.FxhS9JKRw-KtT5VfD-YYsKfxUhLqAlClV8jv1jxFRZUeZEyg3szfR6C2QwRrtjddsRwlbUyHAupz46yDz8FnMGcX-jzSUUNlRVMFK641NVf4clQG9Il6nMqdn2uan5rDpjC4jvA8Eiw-bLeMoQgGZmaQzvY746RyPVGLhPGsQ1YJl6r6YAmg516CVP86ONEujlgVBatmhctR5w8lsTeXKWEz6s-XoOpy_1FT0-HESCSKzkYeLr6qzbwj3hJjwjpZMLhS4gOgbgSWrLengZCRQfB5oD5ON4yME_iYcSOG62-99ERIVpPkiO5_jcU8YeqZv3m3uAPxqJHh92H6aPoP_g",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/apikeys/141783f3-05fe-4a3d-ae7f-c2e0c254f563"
},
"update apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/141783f3-05fe-4a3d-ae7f-c2e0c254f563"
},
"delete apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/141783f3-05fe-4a3d-ae7f-c2e0c254f563"
},
"profile" : {
"href" : "https://catalog.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/apikeys/?page=0&size=20"
}
},
"page" : {
"size" : 20,
"totalElements" : 2,
"totalPages" : 1,
"number" : 0
}
}
View an API key
GET
/api/apikeys/{apikey-id}
Returns the API key {apikey-id}
.
Prerequisites
- The authenticated user must own a Matatika account
- The API key
{apikey-id}
must exist
Request
Example Snippets
- cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57' -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/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("GET", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
API key with HAL links.
{
"id" : "0c853241-ee34-4584-8c83-d9f26b7a2d57",
"created" : "2023-09-20T10:55:56.18672",
"lastModified" : "2023-09-20T10:55:56.186721",
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932)",
"clientId" : "4SgkmHB08wlzYTPngYU7AMoiUkt89EuN",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"update apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"delete apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"profile" : {
"href" : "https://catalog.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
}
Initialise an API key
POST
/api/apikeys
Initialises a new API key.
Prerequisites
- The authenticated user must own a Matatika account
Request
Example Snippets
- cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/apikeys/' -i -X POST \
-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/apikeys/"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("POST", url, headers=headers)
print(response.text.encode('utf8'))
Response
200 OK
API key with HAL links.
{
"id" : "0c853241-ee34-4584-8c83-d9f26b7a2d57",
"created" : "2023-09-20T10:55:55.842962329",
"lastModified" : "2023-09-20T10:55:55.842962929",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"create apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
}
}
}
Create an API key
PUT
/api/apikeys/{apikey-id}
Creates the API key {apikey-id}
.
Prerequisites
- The authenticated user must own a Matatika account
Request
Body
API key resource.
{
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932)"
}
Example Snippets
- cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57' -i -X PUT \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json' \
-d '{
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932)"
}'
- Python (requests)
import requests
url = "https://catalog.matatika.com:443/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
data = {
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932)"
}
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("PUT", url, headers=headers, data=data)
print(response.text.encode('utf8'))
Response
201 Created
API key with HAL links.
{
"id" : "0c853241-ee34-4584-8c83-d9f26b7a2d57",
"created" : "2023-09-20T10:55:56.186719939",
"lastModified" : "2023-09-20T10:55:56.186720539",
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932)",
"clientId" : "4SgkmHB08wlzYTPngYU7AMoiUkt89EuN",
"clientSecret" : "y7CtV9HUsnfX84e7rMlh6_XzljJBybmBQyuQd1oZ0d1iLwY9ycLxdlv1aIrccnYQ",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"update apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"delete apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"profile" : {
"href" : "https://catalog.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
}
Update an API key
PUT
/api/apikeys/{apikey-id}
Updates the API key {apikey-id}
.
Prerequisites
- The authenticated user must own a Matatika account
Request
Body
API key resource.
{
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932) (updated)"
}
Example Snippets
- cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57' -i -X PUT \
-H 'Accept: application/json, application/javascript, text/javascript, text/json' \
-H 'Content-Type: application/json' \
-d '{
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932) (updated)"
}'
- Python (requests)
import requests
url = "https://catalog.matatika.com:443/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
data = {
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932) (updated)"
}
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("PUT", url, headers=headers, data=data)
print(response.text.encode('utf8'))
Response
200 OK
API key with HAL links.
{
"id" : "0c853241-ee34-4584-8c83-d9f26b7a2d57",
"created" : "2023-09-20T10:55:56.18672",
"lastModified" : "2023-09-20T10:55:57.571987709",
"name" : "SIT-generated api key (2023-09-20T11:55:55.903932) (updated)",
"clientId" : "4SgkmHB08wlzYTPngYU7AMoiUkt89EuN",
"profileId" : "auth0|5eb0327cbfd7490bff55feeb",
"_links" : {
"self" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"update apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"delete apikey" : {
"href" : "https://catalog.matatika.com/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
},
"profile" : {
"href" : "https://catalog.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
}
}
}
Delete an API key
DELETE
/api/apikeys/{apikey-id}
Deletes the API key {apikey-id}
.
Prerequisites
- The authenticated user must own a Matatika account
- The API key
{apikey-id}
must exist
Request
Example Snippets
- cURL
curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57' -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/apikeys/0c853241-ee34-4584-8c83-d9f26b7a2d57"
headers = {
'Authorization': ACCESS_TOKEN
}
response = requests.request("DELETE", url, headers=headers)
print(response.text.encode('utf8'))
Response
204 No Content
No response body provided.