Making Your First API Call
Time required: 5 minutes
You are now ready to make your first call the Matatika API! The tool you use to accomplish this is up to you, but we recommend cURL or Postman.
In this example, we will be querying the Matatika API workspaces
endpoint to list the workspaces our profile is a member of. In the response of this request, details of the workspace created earlier in this guide should be found.
cURL
cURL is installed by default on Windows 10, macOS and some Linux distributions (your milage may vary). Open command-prompt or terminal and run the following command, making sure to substitute $ACCESS_TOKEN
or %ACCESS_TOKEN%
with the Bearer token obtained earlier:
macOS/Linux
curl -i \
-H "Authorization: Bearer $ACCESS_TOKEN" \
https://app.matatika.com/api/workspaces
Windows
curl -i ^
-H "Authorization: Bearer %ACCESS_TOKEN%" ^
https://app.matatika.com/api/workspaces
If you plan to explore the Matatika API further, it may make sense to resolve the Bearer token to a temporary environment variable.
macOS/Linux
ACCESS_TOKEN="..."
curl -i \
-H "Authorization: Bearer $ACCESS_TOKEN" \
https://app.matatika.com/api/workspaces
Windows
set ACCESS_TOKEN="..."
curl -i ^
-H "Authorization: Bearer %ACCESS_TOKEN%" ^
https://app.matatika.com/api/workspaces
Postman
The Postman app is available for download here. Once installed, follow these steps to import and set up authorisation for our maintained Postman collection.
Once completed, open the Workspaces folder, select the request titled View all workspaces and click Send.
If everything was configured correctly, the API should respond with a status of 200 OK
and a JSON-formatted Workspace body:
{
"_embedded": {
"workspaces": [
{
"id": "{workspace-id}",
"name": "{workspace-name}",
"domains": "{workspace-domains}",
"repositoryUrl" : "{repository-url}",
"defaultWorkspace" : false,
"_links": {
"self": {
"href": "https://app.matatika.com/api/workspaces/{workspace-id}"
},
"update delete workspace": {
"href": "https://app.matatika.com/api/workspaces/{workspace-id}"
},
"make-default": {
"href": "https://app.matatika.com/api/workspaces/{workspace-id}/default"
},
"members": {
"href": "https://app.matatika.com/api/workspaces/{workspace-id}/members"
},
"invitations": {
"href": "https://app.matatika.com/api/workspaces/{workspace-id}/invitations"
},
"create invitation": {
"href": "https://app.matatika.com/api/workspaces/{workspace-id}/invitations",
},
"datasets": {
"href": "https://app.matatika.com/api/workspaces/{workspace-id}/datasets",
},
"publish dataset": {
"href": "https://app.matatika.com/api/workspaces/{workspace-id}/datasets",
},
"channels": {
"href": "https://app.matatika.com/api/workspaces/{workspace-id}/channels",
},
"tags" : {
"href" : "http://app.matatika.com/api/workspaces/{workspace-id}/tags"
},
"search" : {
"href" : "http://app.matatika.com/api/workspaces/{workspace-id}/search"
},
"feed" : {
"href" : "http://app.matatika.com/api/workspaces/{workspace-id}/feed"
},
"dataplugins" : {
"href" : "http://app.matatika.com/api/workspaces/{workspace-id}/dataplugins"
},
"pipelines" : {
"href" : "http://app.matatika.com/api/workspaces/{workspace-id}/pipelines"
}
}
}
]
},
"_links": {
"self": {
"href": "https://app.matatika.com/api/workspaces?page=0&size=20"
}
},
"page": {
"size": 20,
"totalElements": 1,
"totalPages": 1,
"number": 0
}
}