Fetch list of note types via API

Hi,

We have a native integration with Keap and need an API to be able to fetch the list of note types – default as well as user defined. Couldn’t find an existing API in the developer docs.

Thanks
JustCall Team

Hi @Gaurav_Sharma,

I presume you mean the Types list in the CRM - Settings - Task/Appt/Note Settings.

You will need to use the Get Application Configuration API function here: https://developer.infusionsoft.com/docs/restv2/#tag/Settings/operation/getApplicationConfigurationsUsingGET

The “note - appointment_types” is what you need. Double check, if it returns the matching result.

Just for reference, the Legacy PHP iSDK would be this function:
$result = $app->dsGetSetting('ContactAction', 'optionstype');

Hope that helps.

Hi @Pav,

Thanks for looking into this. Unfortunately, it didn’t work for us.

We wish to fetch the list of note types – default and user defined, as highlighted in the below screenshot.

Thanks,
JustCall Team

If I use the XML-RPC version I can get a String with the Note Types (Comma separated).

So, the question is here, if there is an issue wtih the REST API Response, or it needs the fields supplied to it.

What happens if you use the “fields” parameter set to “appointment_types”?

Hey Pav,

Could you please share exact CURL call that might help us fetch the required data of Appointment_types?

Here is an example PHP XML-RPC API Script that uses the Legacy API Key to get the Note Types.

The “$app” and “$key” variables would need to be set to your Application Account Name (Subdomain) and the API Key (Legacy, not OAuth).

When dealing with the raw XML-RPC, then it would be better to use the SDK to make it easier for yourself.

<?php

    // Example PHP script to update the Contact Job Title field via the XML-RPC using the Legacy API Encrypted Key.

    ini_set("display_errors", 1);
    ini_set("display_startup_errors", 1);
    error_reporting(E_ALL);

    // API Connection.
    $app = "XXX";    // Your Keap Account Name.
    $key = "XXX";    // Your API Encrypted Key.

    // API Request.
    $request = "<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>DataService.getAppSetting</methodName>
  <params>
    <param>
      <value><string>{$key}</string></value>
    </param>
    <param>
      <value><string>ContactAction</string></value>
    </param>
    <param>
      <value><string>optionstype</string></value>
    </param>    
  </params>
</methodCall>";

    $url       = "https://{$app}.infusionsoft.com:443/api/xmlrpc";
    $headers   = [ "Content-Type: text/xml", "Accept-Charset: UTF-8,ISO-8859-1,US-ASCII", "Expect:" ];
    $useragent = "XML-RPC Example";

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
    curl_setopt($ch, CURLOPT_HEADER, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_ENCODING, "");
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($ch, CURLOPT_SSLVERSION, 0);

    $output = curl_exec($ch);

    curl_close($ch);

    list($headers, $content) = explode("\r\n\r\n", $output, 2);

  //  print_r($output);

    $xml = new SimpleXMLElement($content); 

    echo $xml->params->param->value;

Hope that helps.