Hello, I'm new here and try to figure out how to use API. I read documentation and still nothing happens.
There is a error:
Fatal error: Uncaught Exception: EspoClient: Unknown Error in C:\xampp\htdocs\espo\Test.php:163 Stack trace: #0 C:\xampp\htdocs\espo\Test.php(24): EspoApiClient->request('POST', 'Lead', Array) #1 C:\xampp\htdocs\espo\Test.php(234): test->insert() #2 {main} thrown in C:\xampp\htdocs\espo\Test.php on line 163
That's the code:
There is a error:
Fatal error: Uncaught Exception: EspoClient: Unknown Error in C:\xampp\htdocs\espo\Test.php:163 Stack trace: #0 C:\xampp\htdocs\espo\Test.php(24): EspoApiClient->request('POST', 'Lead', Array) #1 C:\xampp\htdocs\espo\Test.php(234): test->insert() #2 {main} thrown in C:\xampp\htdocs\espo\Test.php on line 163
That's the code:
PHP Code:
public function insert()
{ $url = 'https://127.0.0.1/espo';
$client = new EspoApiClient($url);
$client->setApiKey("d6901311d3553408e9cd1676243ff6f2");
$response = $client->request('POST', 'Lead', [ 'firstName'=> 'test', 'lastName'=> 'hello']); }
Comment