I am getting the response:
msg => "Secret key verification failed"
My php code simplified:
`
$api_secret_key = trim((string) $api_secret_key);
// 2. Generate Authentication Parameters
$token_md5 = md5($api_secret_key);
$request_time = (string) time();
$request_token = md5($request_time . $token_md5);
// 5. Construct payload matching the Python data dictionary
$auth_data = [
"request_token" => $request_token,
"request_time" => (int)$request_time
];
//$path below = for example: 'system'
$endpoint = 'https://'.$panel_url.":$api_port/$path?action=$action";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $endpoint);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);`
Response:
status: 0
msg: Secret key verification failed
I've been banging my head on this for 2 days with chatgpt, no luck. There's such less documentation and whatever there is extremely unclear. What am I doing wrong?