Skip to content

Getting your credentials and a token

During the course of the explanation, we will use the file file BankLoanData-EN.csv. It can be found here.

Getting your credentials


Get your Authentication URL, Mining API URL, Workgroup Technical ID and Workgroup Private Key from your workgroup (link). You can find this information in the Open API tab of your workgroup.

Getting a token


To be able to do CURL requests, we must first get a token. This token will be used in all curl commands. When the token is generated, copy and paste it in a notepad so that you do not lose it. Be careful to copy and paste the access token and not the refresh token. Each token has a lifespan of 30min. If the time is up, please regenerate one.

You can install jq to read the token more easily.

curl -X POST <Your authentication URL>/protocol/openid-connect/token --data "grant_type=client_credentials" --data "client_id=<Your workgroup ID>" --data "client_secret=<Your workgroup Key>" | jq

Replace <Your authentication URL>, <Your Workgroup ID>, <Your Workgroup Key> by their respective values found in the latter step.

After running the command a token will be returned that looks something like this:

{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJJbzFIbFNYemdlWXBQQTZGcWtITTRLZC1RdWNxLW1KOFdEaWhFZGliLUZvIn0.eyJleHAiOjE2OTU4MDU1NDUsImlhdCI6MTY5NTgwNTI0NSwianRpIjoiNTljNTBkZDItZTMzZC00M2VlLWE5YmMtODcxZjE0ZWUzMmJmIiwiaXNzIjoiaHR0cHM6Ly9pZGVudGl0eS1lbWVhLmlncmFmeGNsb3VkLmNvbS9yZWFsbXMvbG9ncGlja3ItYXBpLXdldS1taW5pbmciLCJhdWQiOlsibWluaW5nLXdldS11aS1jbGllbnQiLCJhY2NvdW50Il0sInN1YiI6IjI0YzUwYTJiLTRjNzEtNGJiMy04MTkyLTZiYTRjNDBjNDVmYyIsInR5cCI6IkJlYXJlciIsImF6cCI6IjE0NTAwMmU3LTdiZTYtNGM5Ny05MjQzLTE3MjE1YjkzMDQ5NCIsInNlc3Npb25fc3RhdGUiOiJlMTA4NzE1NS1lMTJhLTQ0OTAtYThlYy1kNmM1NDVlZTY0YmUiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbImh0dHBzOi8vd2V1LW1p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vUjgOE4exSBaF7hIu1O798K4GwuwK6kgZfdN7uAbmWD_6TmwdOAeVRxiNUEZSNMp5YmreH3NweiebJqblsWXA","expires_in":300,"refresh_expires_in":1800,"refresh_token":"eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJmMjY1NWRhYi1kY2ZmLTRiYWQtOGU3Yi00YjE4YjE0NTUwZDcifQ.eyJleHAiOjE2OTU4MDcwNDUsImlhdCI6MTY5NTgwNTI0NSwianRpIjoiMDExOTc5YTQtMDM3MS00MjVlLTgzZDgtOTg3MjMyYmRiZGI0IiwiaXNzIjoiaHR0cHM6Ly9pZGVudGl0eS1lbWVhLmlncmFmeGNsb3VkLmNvbS9yZWFsbXMvbG9ncGlja3ItYXBpLXdldS1taW5pbmciLCJhdWQiOiJodHRwczovL2lkZW50aXR5LWVtZWEuaWdyYWZ4Y2xvdWQuY29tL3JlYWxtcy9sb2dwaWNrci1hcGktd2V1LW1pbmluZyIsInN1YiI6IjI0YzUwYTJiLTRjNzEtNGJiMy04MTkyLTZiYTRjNDBjNDVmYyIsInR5cCI6IlJlZnJlc2giLCJhenAiOiIxNDUwMDJlNy03YmU2LTRjOTctOTI0My0xNzIxNWI5MzA0OTQiLCJzZXNzaW9uX3N0YXRlIjoiZTEwODcxNTUtZTEyYS00NDkwLWE4ZWMtZDZjNTQ1ZWU2NGJlIiwic2NvcGUiOiJwcm9maWxlIGVtYWlsIG1pbmluZy13ZXUtdWktY2xpZW50c2NvcGUiLCJzaWQiOiJlMTA4NzE1NS1lMTJhLTQ0OTAtYThlYy1kNmM1NDVlZTY0YmUifQ.DDwQpVW-yIoDqQ-6nmqniYxO8Kx6joJZ4xk3ism7rK4","token_type":"Bearer","not-before-policy":0,"session_state":"e1087155-e12a-4490-a8ec-d6c545ee64be","scope":"profile email mining-weu-ui-clientscope"}

Make sure to only copy the access token in a notepad so that it’s accessible.

Here the access token is:

eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2l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UiLCJzaWQiOiJlMTA4NzE1NS1lMTJhLTQ0OTAtYThlYy1kNmM1NDVlZTY0YmUiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsImNsaWVudElkIjoiMTQ1MDAyZTctN2JlNi00Yzk3LTkyNDMtMTcyMTViOTMwNDk0IiwiY2xpZW50SG9zdCI6IjE4NS4xMjIuMTYxLjI1MyIsInByZWZlcnJlZF91c2VybmFtZSI6InNlcnZpY2UtYWNjb3VudC0xNDUwMDJlNy03YmU2LTRjOTctOTI0My0xNzIxNWI5MzA0OTQiLCJjbGllbnRBZGRyZXNzIjoiMTg1LjEyMi4xNjEuMjUzIn0.vd_DimpHJ45n3g4AygnOdHgMv_hxTCpYSYmEmOUdaFU1p6EbkPB2B-_tg4H-gcRwMIF3dlYRkIjUnxaV7dKCQfFCPkw72y-tdnmZCmzfWajbIOnJM3tgYFi05jTrT60xMTu6IReS73ac56-10XaQXGIdZP4bEc6_Sb4LDu8zXW9sViEwGATatHksfB0mHCjabqYaA3ptM-qKhnYhFHvr_MVq5ggGuwCfV_cHiMKHXMR6TA8gdai4Izl_e4fKh7u6nvUjgOE4exSBaF7hIu1O798K4GwuwK6kgZfdN7uAbmWD_6TmwdOAeVRxiNUEZSNMp5YmreH3NweiebJqblsWXA

If you prefer, you can feed an environment variable with this command:

TOKEN=$(curl -s -S -X POST <Your authentication URL>/protocol/openid-connect/token --data "grant_type=client_credentials" --data "client_id=<Your Workgroup Technical ID>" --data "client_secret=<Your Workgroup Private Key>" | jq '.access_token' | sed 's/"//g')