Legacy Key Sunsetting

@Marion_Dorsett2, nice work in getting an initial version of the Legacy iSDK supported with the changes.

For your reference you can avoid modifying the PHP XML-RPC library by using one of its newer features in setting the cURL HTTP Header. It is not made obvious, but you have to supply the Original Header that it would sent plus the additional header lines, which would be the X-Keap-API-Key or Authorization Bearer.

For the Legacy Key / Service Account Key you can set up the Header as this.

$this->client->setOption('extracurlopts', 
    [ 
        CURLOPT_HTTPHEADER => 
        [
            "Content-Type: text/xml",
            "Accept-Charset: UTF-8,ISO-8859-1,US-ASCII",
            "Expect:",
            "X-Keap-API-Key: {$this->key}"
        ];
    ]
);

For the OAuth Access Token you can set up the Header as this.

$this->client->setOption('extracurlopts', 
    [ 
        CURLOPT_HTTPHEADER => 
        [
            "Content-Type: text/xml",
            "Accept-Charset: UTF-8,ISO-8859-1,US-ASCII",
            "Expect:",
            "Authorization: Bearer {$this->key}"
        ];
    ]
);

@Tom_Scott - Thank you in updating the documentation.

2 Likes