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

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" : "c6794834-3dfd-48ac-a817-ea613e0ed724",
  "created" : "2024-04-10T14:07:10.014442",
  "lastModified" : "2024-04-10T14:07:10.014443",
  "name" : "SIT-generated api key (2024-04-10T15:07:09.920952)",
  "clientId" : "grjU5YxuhP7VAPEpyQHiOvU54KCsUZur",
  "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "update apikey" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "delete apikey" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "profile" : {
      "href" : "https://catalog.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
    }
  }
}

Requests


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" : "ba4b83c7-6780-4f13-b79a-3d2b90aa4e7e",
      "created" : "2024-04-10T14:07:08.085508",
      "lastModified" : "2024-04-10T14:07:08.085509",
      "name" : "default",
      "clientId" : "5JTLz3ptvF3fa2vjt7yv7K2p0PrcYLxz",
      "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
      "accessToken" : "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IlJFRkNRamczTlRRMk16QTROalpHT0RjNFFUWkJOemMyTkRGR1FUSkVOVEEyUkRkR1JrSkRPQSJ9.eyJpc3MiOiJodHRwczovL2lkZW50aXR5Lm1hdGF0aWthLmNvbS8iLCJzdWIiOiI1SlRMejNwdHZGM2ZhMnZqdDd5djdLMnAwUHJjWUx4ekBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9jYXRhbG9nLm1hdGF0aWthLmNvbS9hcGkiLCJpYXQiOjE3MTI3NTgwMjksImV4cCI6MTcxMjg0NDQyOSwiZ3R5IjoiY2xpZW50LWNyZWRlbnRpYWxzIiwiYXpwIjoiNUpUTHozcHR2RjNmYTJ2anQ3eXY3SzJwMFByY1lMeHoifQ.DyfZ0xnVouQObaWa34336g2soonxnrA01SSViMEnSID4QEjrzLPaYg9XJYHXB8pn_btak2T7MQacNoDQu8OI2tQtbXJ77T3iCB6l1_4qzvz_2HiFScyLlP64qnsErwuQhuuFaX3UyOO2Lt1kncu9kxL9Be5IK29CmMFKuYIZxgx-izM3g62aAn17j9O7P82LsBRJ61WeuxZpCjuMfiaCzHanZEG1jkrbBZpUhE-AM9pQoORZ11kY9xwtBcTabG2iBk2AZMLdTfdDVW3PP1OCCjcmuVLjWkqa4SZfzCM5XRQFZBZApeQnzIngCh2hgpv8pSZ6_4MZ7bb-xP5qDxWb1A",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/apikeys/ba4b83c7-6780-4f13-b79a-3d2b90aa4e7e"
        },
        "update apikey" : {
          "href" : "https://catalog.matatika.com/api/apikeys/ba4b83c7-6780-4f13-b79a-3d2b90aa4e7e"
        },
        "delete apikey" : {
          "href" : "https://catalog.matatika.com/api/apikeys/ba4b83c7-6780-4f13-b79a-3d2b90aa4e7e"
        },
        "profile" : {
          "href" : "https://catalog.matatika.com/api/profiles/auth0%7C5eb0327cbfd7490bff55feeb"
        }
      }
    }, {
      "id" : "c6794834-3dfd-48ac-a817-ea613e0ed724",
      "created" : "2024-04-10T14:07:10.014442",
      "lastModified" : "2024-04-10T14:07:10.014443",
      "name" : "SIT-generated api key (2024-04-10T15:07:09.920952)",
      "clientId" : "grjU5YxuhP7VAPEpyQHiOvU54KCsUZur",
      "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
      "_links" : {
        "self" : {
          "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
        },
        "update apikey" : {
          "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
        },
        "delete apikey" : {
          "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
        },
        "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/c6794834-3dfd-48ac-a817-ea613e0ed724' -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/c6794834-3dfd-48ac-a817-ea613e0ed724"

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" : "c6794834-3dfd-48ac-a817-ea613e0ed724",
  "created" : "2024-04-10T14:07:10.014442",
  "lastModified" : "2024-04-10T14:07:10.014443",
  "name" : "SIT-generated api key (2024-04-10T15:07:09.920952)",
  "clientId" : "grjU5YxuhP7VAPEpyQHiOvU54KCsUZur",
  "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "update apikey" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "delete apikey" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "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" : "c6794834-3dfd-48ac-a817-ea613e0ed724",
  "created" : "2024-04-10T14:07:09.840747368",
  "lastModified" : "2024-04-10T14:07:09.840747768",
  "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
  "_links" : {
    "create apikey" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    }
  }
}

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 (2024-04-10T15:07:09.920952)"
}

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724' -i -X PUT \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json' \
    -d '{
  "name" : "SIT-generated api key (2024-04-10T15:07:09.920952)"
}'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"

data = {
  "name" : "SIT-generated api key (2024-04-10T15:07:09.920952)"
}
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" : "c6794834-3dfd-48ac-a817-ea613e0ed724",
  "created" : "2024-04-10T14:07:10.014442141",
  "lastModified" : "2024-04-10T14:07:10.014442941",
  "name" : "SIT-generated api key (2024-04-10T15:07:09.920952)",
  "clientId" : "grjU5YxuhP7VAPEpyQHiOvU54KCsUZur",
  "clientSecret" : "3JOvVgG2DO2kzS05TP_DIcY2cA9rySJ9TCQ3pw-zESvnOIzyFPp83WwVFYZns9xJ",
  "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "update apikey" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "delete apikey" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "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 (2024-04-10T15:07:09.920952) (updated)"
}

Example Snippets

cURL

curl -H "Authorization: Bearer $ACCESS_TOKEN" 'https://catalog.matatika.com:443/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724' -i -X PUT \
    -H 'Accept: application/json, application/javascript, text/javascript, text/json' \
    -H 'Content-Type: application/json' \
    -d '{
  "name" : "SIT-generated api key (2024-04-10T15:07:09.920952) (updated)"
}'

Python (requests)

import requests

url = "https://catalog.matatika.com:443/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"

data = {
  "name" : "SIT-generated api key (2024-04-10T15:07:09.920952) (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" : "c6794834-3dfd-48ac-a817-ea613e0ed724",
  "created" : "2024-04-10T14:07:10.014442",
  "lastModified" : "2024-04-10T14:07:11.565602525",
  "name" : "SIT-generated api key (2024-04-10T15:07:09.920952) (updated)",
  "clientId" : "grjU5YxuhP7VAPEpyQHiOvU54KCsUZur",
  "profileId" : "auth0|5eb0327cbfd7490bff55feeb",
  "_links" : {
    "self" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "update apikey" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "delete apikey" : {
      "href" : "https://catalog.matatika.com/api/apikeys/c6794834-3dfd-48ac-a817-ea613e0ed724"
    },
    "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/c6794834-3dfd-48ac-a817-ea613e0ed724' -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/c6794834-3dfd-48ac-a817-ea613e0ed724"

headers = {
  'Authorization': ACCESS_TOKEN
}

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

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

Response

204 No Content

No response body provided.