Step 1. Get your project API key
If you’re the admin of your team, get API key of the target project on the admin console. If you’re a system user or virtual user in a team, simply ask your admin to provide you with one.Step 2. Create a dataset and upload a data source to it
This step is optional but highly recommended, as it allows you to receive insights tailored to your own data.
- Method 1: Create a dataset first, then add data sources to it.
- Method 2: Create a data source directly without specifying a dataset, and Powerdrill will automatically create a dataset for it.
- Method 1
- Method 2
-
Make a request to
POST /v1/team/datasetsendpoint to create a dataset. Example request:Example response:Replace$PD_API_KEYwith the API key you’ve obtained in Step 1.Obtain theidvalue (dataset ID) from the response and save it for later use. -
Make a request to the
POST /v1/team/datasets/{datasetId}/datasourcesendpoint. Replace thedatasetIdvalue with the ID of the dataset you’ve created in the previous sub-step
When making the request, specify either
url or fileKey, but not both. Use url to upload a file through a publicly accessible URL. For privately accessible files, use fileKey.Example response:
Repeat this sub-step to create multiple data sources in the same dataset.
Step 3. Create a session
To create a session, make a request to the POST /v1/team/sessions endpoint. Sessions are essential for running jobs on Powerdrill, as each job must be linked to a session using its session ID. Example request:When making a request:
-
Replace
$PD_API_KEYwith the API key you’ve obtained in Step 1. - Set the user ID to your actual user ID.
id value (session ID) from the response and save it for use in the following step.
Step 4. Create a job
Now, after you’ve prepared a session and probably a dataset stuffed with data sources, you can create a job to start conversing with Powerdrill.For the definition of job, see What Is Job?.
stream parameter. For more details about how to understand the streaming mode, see Streaming.
-
If
streamis set to true, streaming is enabled. -
If
streamis set to false, streaming is disabled.
- Set stream to true:
- Set stream to false:
Example request:
Example response:
Example response:
When making a request:
-
Replace
$PD_API_KEYwith the API key you’ve obtained in Step 1. -
Since this topic covers running a general job and no data agent is used, set the
x-pd-api-agent-idheader toGENERAL(uppercase). -
Replace the
sessionIdvalue with the ID of the session you’ve created in Step 3. -
To enable Powerdrill to retrieve information from your own data and provide responses specific to it, set the
datasetIdto the ID of the dataset obtained in Step 2.