<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apigcp.trynia.ai/v2/sources",
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([
'repository' => '<string>',
'branch' => '<string>',
'ref' => '<string>',
'url' => '<string>',
'url_patterns' => [
'<string>'
],
'exclude_patterns' => [
'<string>'
],
'project_id' => '<string>',
'max_age' => 123,
'formats' => [
'<string>'
],
'only_main_content' => true,
'limit' => 123,
'max_depth' => 123,
'crawl_entire_domain' => true,
'wait_for' => 123,
'include_screenshot' => true,
'check_llms_txt' => true,
'llms_txt_strategy' => '<string>',
'add_as_global_source' => true,
'is_pdf' => true,
'is_spreadsheet' => true,
'display_name' => '<string>',
'gcs_path' => '<string>',
'focus_instructions' => '<string>',
'extract_branding' => true,
'extract_images' => true,
'config' => '<string>',
'folder_name' => '<string>',
'folder_path' => '<string>',
'files' => [
[
'path' => '<string>',
'content' => '<string>'
]
],
'database' => [
'filename' => '<string>',
'content' => '<string>'
],
'slack_installation_id' => '<string>',
'google_drive_installation_id' => '<string>',
'google_drive_file_ids' => [
'<string>'
],
'google_drive_folder_ids' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}