fixing API Problems when to many results
This commit is contained in:
+4
-4
@@ -44,7 +44,7 @@ function sendAPICompanyInfoRequest(string $username, string $password, string $u
|
||||
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/ZefixREST/api/v1/firm/search.json';
|
||||
|
||||
// Headers
|
||||
$headers = array(
|
||||
@@ -77,7 +77,7 @@ curl_close($ch);
|
||||
function sendAPICommunityRequest(string $username, string $password): string|bool
|
||||
{
|
||||
// API endpoint
|
||||
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/community';
|
||||
$apiUrl = 'https://www.zefix.admin.ch/ZefixREST/api/v1/community.json';
|
||||
|
||||
// Headers
|
||||
$headers = array(
|
||||
@@ -110,7 +110,7 @@ function sendAPICommunityRequest(string $username, string $password): string|boo
|
||||
function communityCSV(string $username, string $password): string {
|
||||
$response = sendAPICommunityRequest($username, $password);
|
||||
$communityArray = json_decode($response, true);
|
||||
$csvOutput = 'bfsId,Kanton,Gemeindename,registryOfCommerceId\n';
|
||||
$csvOutput = 'id,bfsId,Kanton,Gemeindename,registryOfCommerceId,replacedById,alternateNames\n';
|
||||
// Create CSV rows
|
||||
|
||||
foreach ($communityArray as $item) {
|
||||
@@ -122,7 +122,7 @@ function communityCSV(string $username, string $password): string {
|
||||
function sendAPILegalFormRequest(string $username, string $password): string|bool
|
||||
{
|
||||
// API endpoint
|
||||
$apiUrl = 'https://www.zefix.admin.ch/ZefixPublicREST/api/v1/legalForm';
|
||||
$apiUrl = 'https://www.zefix.admin.ch/ZefixREST/api/v1/legalForm.json';
|
||||
|
||||
// Headers
|
||||
$headers = array(
|
||||
|
||||
Reference in New Issue
Block a user