0
예를 들어 WHMCS API를 사용하여 클라이언트를 얻으려고합니다.WHMCS Api를 사용할 때 인증 실패 오류
{ "결과": "오류", "메시지": "인증 실패"}
내가 테스트 내가 파일 PHP를 실행할 때, 그것은 나에게 JSON에서이 오류를 준 웹 사이트에서 사용자 이름과 비밀번호를 인증합니다.
해결 방법을 제안하십시오.
<?php
// Création d'une ressource cURL
$ch = curl_init();
//L'URL à récupérer
curl_setopt($ch, CURLOPT_URL, 'https://example.com/includes/api.php');
//TRUE pour que PHP fasse un HTTP POST
curl_setopt($ch, CURLOPT_POST, 1);
//les données à passer lors d'une opération de HTTP POST
curl_setopt($ch, CURLOPT_POSTFIELDS,
http_build_query(
array(
'action' => 'GetClients',
'username' => 'myUsername',
'password' => 'myPassword',
'responsetype' => 'json')
)
);
$response = curl_exec($ch);
curl_close($ch);
// Decode response
$jsonData = json_decode($response, true);
// Dump array structure for inspection
//var_dump($jsonData);
?>
제안이나 답변이 있으십니까?! –