Sitze und Rechtsformen aus Zefix API

This commit is contained in:
schrom01 2023-08-21 20:52:20 +02:00
parent 28661a198a
commit 6d1fcf67b3
1 changed files with 2 additions and 2 deletions

View File

@ -49,6 +49,8 @@ curl_close($ch);
function sendAPICommunityRequest(string $username, string $password): string|bool function sendAPICommunityRequest(string $username, string $password): string|bool
{ {
echo $username;
echo $password;
// API endpoint // API endpoint
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/community'; $apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/community';
@ -85,9 +87,7 @@ function sendAPICommunityRequest(string $username, string $password): string|boo
function communityCSV(string $username, string $password): string { function communityCSV(string $username, string $password): string {
$response = sendAPICommunityRequest($username, $password); $response = sendAPICommunityRequest($username, $password);
echo "TEST";
echo $response; echo $response;
echo "TEST3";
$communityArray = json_decode($response, true); $communityArray = json_decode($response, true);
$csvOutput = 'bfsId,Kanton,Gemeindename,registryOfCommerceId\n'; $csvOutput = 'bfsId,Kanton,Gemeindename,registryOfCommerceId\n';
// Create CSV rows // Create CSV rows