prepared Task Executer

This commit is contained in:
schrom01
2023-09-25 15:45:26 +02:00
parent b178df10e3
commit 3fa9fa6d79
3 changed files with 53 additions and 14 deletions
+5 -6
View File
@@ -11,20 +11,19 @@ $password = getenv("password");
* @param array $data
* @return bool|string
*/
function sendAPICompanySearchRequest(string $username, string $password, array $data): string|bool
{
function sendAPICompanySearchRequest(string $username, string $password, array $data): string|bool {
// API endpoint
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/company/search';
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/company/search';
// Headers
$headers = array(
$headers = array(
"accept: application/json",
"Content-Type: application/json"
);
// Initialize cURL session
$ch = curl_init();
$ch = curl_init();
// Set cURL options
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_URL, $apiUrl);