getContaBaseURL
Back to ListDescription: Get the CONTA API base URL, Sandbox or production URLs
FileMaker Prototype:
Set Variable [$res; ACF_Run("getContaBaseURL"; bool_production)]
Category: CONTA API
Function source:
function getContaBaseURL (bool production)
if ( production ) then
return "https://api.gateway.conta.no";
else
return "https://api.gateway.conta-sandbox.no";
end if
end
The getContaBaseURL Function is part of the Conta api. It returns the base URL used for api calls. The production parameter select the version to use, sandbox or real environment. See the API documentation for further documentation.
Its a simple function, and is mainly used from other API functions that do API calls. In this way, you avoid having the URL's scattered around the code. The change can be done in one place if it needs change.
Example from a different API function using it.
string hdr = 'apiKey:'+APIkey;
string url = getContaBaseURL(production)+"/invoice/organizations";
// Do the API call
result = HTTP_GET(url, hdr);
The API call are then using the the sharp API or the sandbox dependant of the value of the production variable, true or false.
