ACF Library

getContaApiKeyandNumber

Back to List

Description: Retrieve the Conta credentials used in the API

FileMaker Prototype:

Set Variable [$res; ACF_Run("getContaApiKeyandNumber";)]

Category: CONTA API

NOTE: This function serves as a reference template. To use it effectively, you may need to adjust certain parts of the code, such as field names, database structures, and specific data lists to fit the requirements of your system. This customization allows the function to work seamlessly within your environment.

Function source:

function getContaApiKeyandNumber ()
   array string apikeys, prod; 
   array int contaOrgNr; 
   JSON retObj; 
   string sql = "SELECT ContaCurrentApiKey, ContaCurrentCompNo, ContaProduction FROM Preferences
   
   INTO :apikeys, :contaOrgNr, :prod"; 
   string res = ExecuteSQL(sql); 
   if ( sizeof (apikeys)>0) then
      retObj = JSON ( "APIkey", apikeys[1], "CompNo", contaOrgNr[1], "Production", trimboth(prod[1])=="Yes"); 
   else
      retObj = JSON ( "APIkey", "", "CompNo", 0, "Production", false);
   end if
   
   return retObj;
end

Back to List