Managing datasets through mxHERO V3 API
To generate your API Key goto "Settings" - “Integrations”; and scroll down to Integrate with mxHERO API
When enabling the integration, an API key will be generated that should be used as the value of the "x-api-key" header in requests (it should replace the {api-key} you see in the examples)
API call examples
To get a dataset created:curl -X GET "https://api.mxhero.com/v3/organizations/{organization ID}/datasets/{dataset ID}" -H "accept: application/json" -H "x-api-key: {api-key}"
To put values on a dataset:curl -X PUT "https://api.mxhero.com/v3/organizations/{organization ID}/datasets/{dataset ID}" \
-H "accept: application/json" \
-H "x-api-key: {api-key}" \
-d "{ \"id\": \"17539a6e-4ccb-447d-b14d-75968bc6a843\", \"organizationId\": \"my-organization-id\", \"name\": \"dataset for test\", \"rows\": { \"john.doe@test.com\": [ \"John Doe\" ], \"jane.doe@mxhero.com\": [ \"Jane Doe\" ] } }"
To put an individual value:curl -X PUT https://api.mxhero.com/v3/organizations/{organization ID}/datasets/{dataset ID}/row?key=KEY_NAME -H "accept: application/json" -H "x-api-key: API_KEY" -H "Content-Type: application/json" -d "[\"KEY_VALUE\"]"
To delete an individual value:curl -X DELETE https://api.mxhero.com/v3/organizations/{organization ID}/datasets/{dataset ID}/row?key=KEY_NAME -H "accept: application/json" -H "x-api-key: API_KEY" -H "Content-Type: application/json"
To know your organization ID you can go to Organization and Domains