Python
import os
from meibel import MeibelClient
from meibel.models import DownloadJobRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
job = client.datasources.downloads.create_job(
"ds_8f3b2c1a9d4e",
DownloadJobRequest(
content="files_and_parsed_content",
data_element_ids=["elem_1a2b3c", "elem_4d5e6f"],
),
)
print(f"job_id={job.job_id} status={job.status}")
print(f"track progress at {job.status_url}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const job = await client.datasources.downloads.createJob(
"ds_8f3a1c2b9e4d",
{
content: "files_and_parsed_content",
data_element_ids: ["elem_4f9a2b1c", "elem_7d2e8a3f"],
}
);
console.log(`Job ${job.job_id} status: ${job.status}`);
console.log(`Track progress at: ${job.status_url}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
job, err := client.Datasources.Downloads.CreateJob(
context.Background(),
"ds_9f8c3a1e2b7d",
&v2.DownloadJobRequest{
Content: v2.String("files_and_parsed_content"),
},
)
if err != nil {
panic(err)
}
fmt.Printf("Job %s status: %s\n", job.JobId, job.Status)
fmt.Printf("Track progress at: %s\n", job.StatusUrl)
}curl --request POST \
--url https://api.meibel.ai/v2/datasources/{datasource_id}/downloads \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"content": "<string>",
"data_element_ids": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '<string>', data_element_ids: ['<string>']})
};
fetch('https://api.meibel.ai/v2/datasources/{datasource_id}/downloads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/datasources/{datasource_id}/downloads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'data_element_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/datasources/{datasource_id}/downloads")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"data_element_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources/{datasource_id}/downloads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"data_element_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"status": "<string>",
"status_url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Downloads
Create Download Job (async)
POST
/
datasources
/
{datasource_id}
/
downloads
Python
import os
from meibel import MeibelClient
from meibel.models import DownloadJobRequest
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
job = client.datasources.downloads.create_job(
"ds_8f3b2c1a9d4e",
DownloadJobRequest(
content="files_and_parsed_content",
data_element_ids=["elem_1a2b3c", "elem_4d5e6f"],
),
)
print(f"job_id={job.job_id} status={job.status}")
print(f"track progress at {job.status_url}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const job = await client.datasources.downloads.createJob(
"ds_8f3a1c2b9e4d",
{
content: "files_and_parsed_content",
data_element_ids: ["elem_4f9a2b1c", "elem_7d2e8a3f"],
}
);
console.log(`Job ${job.job_id} status: ${job.status}`);
console.log(`Track progress at: ${job.status_url}`);package main
import (
"context"
"fmt"
"os"
v2 "github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
job, err := client.Datasources.Downloads.CreateJob(
context.Background(),
"ds_9f8c3a1e2b7d",
&v2.DownloadJobRequest{
Content: v2.String("files_and_parsed_content"),
},
)
if err != nil {
panic(err)
}
fmt.Printf("Job %s status: %s\n", job.JobId, job.Status)
fmt.Printf("Track progress at: %s\n", job.StatusUrl)
}curl --request POST \
--url https://api.meibel.ai/v2/datasources/{datasource_id}/downloads \
--header 'Content-Type: application/json' \
--header 'Meibel-API-Key: <api-key>' \
--data '
{
"content": "<string>",
"data_element_ids": [
"<string>"
]
}
'const options = {
method: 'POST',
headers: {'Meibel-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({content: '<string>', data_element_ids: ['<string>']})
};
fetch('https://api.meibel.ai/v2/datasources/{datasource_id}/downloads', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.meibel.ai/v2/datasources/{datasource_id}/downloads",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'content' => '<string>',
'data_element_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Meibel-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.meibel.ai/v2/datasources/{datasource_id}/downloads")
.header("Meibel-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"content\": \"<string>\",\n \"data_element_ids\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/datasources/{datasource_id}/downloads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"content\": \"<string>\",\n \"data_element_ids\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"job_id": "<string>",
"status": "<string>",
"status_url": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Body
application/json
Was this page helpful?
⌘I