Sitze und Rechtsformen aus Zefix API
This commit is contained in:
parent
28661a198a
commit
6d1fcf67b3
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue