Quick Start¶
Fairdata Services¶
If you don’t already have API credentials to Metax API, get in contact with Metax developers. After that, see the examples sections in topics Datasets API, Files API, or whatever API it is that you are going to interact with.
End Users¶
No chit-chat get a dataset published into Metax and see it in the Fairdata service Etsin:
Copy the following Python code into a file:
import requests
token = 'paste your token here'
response = requests.get('https://metax.fairdata.fi/rpc/v2/datasets/get_minimal_dataset_template?type=enduser')
assert response.status_code == 200, response.content
dataset_data = response.json()
headers = { 'Authorization': 'Bearer %s' % token }
response = requests.post('https://metax.fairdata.fi/rest/v2/datasets', json=dataset_data, headers=headers)
assert response.status_code == 201, response.content
identifier = response.json()['identifier']
print('I have created a dataset, and its identifier is: %s' % identifier)
print('Find the published dataset in Etsin: etsin.fairdata.fi/dataset/%s' % identifier)
Log into https://metax.fairdata.fi/secure
Copy your token from the presented web page and use it in the script as the value for variable
token
.Execute the script.
You should now have a published dataset, and you should be able to find it in the Fairdata service Etsin by using the identifier printed by the script in the following url:
etsin.fairdata.fi/dataset/<identifier>
In reality you will probably want to create a dataset with a little bit more interesting data in it, but using the example dataset from API GET /rpc/v2/datasets/get_minimal_dataset_template
is a good starting point for your modifications. For more involved examples, see the examples sections in topics Datasets API and Files API, or start browsing the various sections of the documentation to get to know what’s what.