Python
import os
from meibel import MeibelClient
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
response = client.batches.execute(
definition_id="batchdef_7f3a2c1e",
)
print(f"execution_id={response.execution_id}, workflow_id={response.workflow_id}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const result = await client.batches.execute("batchdef_7f3a9c2e1d");
console.log(`Execution started: ${result.execution_id}, workflow: ${result.workflow_id}`);package main
import (
"context"
"fmt"
"os"
"github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Batches.Execute(context.Background(), "batchdef_abc123")
if err != nil {
panic(err)
}
fmt.Printf("execution ID: %s, workflow ID: %s\n", resp.ExecutionID, resp.WorkflowID)
}curl --request POST \
--url https://api.meibel.ai/v2/batch-definitions/id/{definition_id}/execute \
--header 'Meibel-API-Key: <api-key>'const options = {method: 'POST', headers: {'Meibel-API-Key': '<api-key>'}};
fetch('https://api.meibel.ai/v2/batch-definitions/id/{definition_id}/execute', 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/batch-definitions/id/{definition_id}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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/batch-definitions/id/{definition_id}/execute")
.header("Meibel-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/batch-definitions/id/{definition_id}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"execution_id": "<string>",
"workflow_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Batches
Execute Batch Definition
POST
/
batch-definitions
/
id
/
{definition_id}
/
execute
Python
import os
from meibel import MeibelClient
client = MeibelClient(api_key=os.environ["MEIBEL_API_KEY"])
response = client.batches.execute(
definition_id="batchdef_7f3a2c1e",
)
print(f"execution_id={response.execution_id}, workflow_id={response.workflow_id}")import { MeibelClient } from "meibel";
const client = new MeibelClient({ apiKey: process.env.MEIBEL_API_KEY });
const result = await client.batches.execute("batchdef_7f3a9c2e1d");
console.log(`Execution started: ${result.execution_id}, workflow: ${result.workflow_id}`);package main
import (
"context"
"fmt"
"os"
"github.com/meibel-ai/meibel-go/v2"
)
func main() {
client := v2.NewClient(v2.WithAPIKey(os.Getenv("MEIBEL_API_KEY")))
resp, err := client.Batches.Execute(context.Background(), "batchdef_abc123")
if err != nil {
panic(err)
}
fmt.Printf("execution ID: %s, workflow ID: %s\n", resp.ExecutionID, resp.WorkflowID)
}curl --request POST \
--url https://api.meibel.ai/v2/batch-definitions/id/{definition_id}/execute \
--header 'Meibel-API-Key: <api-key>'const options = {method: 'POST', headers: {'Meibel-API-Key': '<api-key>'}};
fetch('https://api.meibel.ai/v2/batch-definitions/id/{definition_id}/execute', 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/batch-definitions/id/{definition_id}/execute",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"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/batch-definitions/id/{definition_id}/execute")
.header("Meibel-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.meibel.ai/v2/batch-definitions/id/{definition_id}/execute")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Meibel-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"execution_id": "<string>",
"workflow_id": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Was this page helpful?
⌘I