Announcement

Collapse
No announcement yet.

EspoApiClient error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • EspoApiClient error

    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:
    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']); } 

  • #2
    Here's a step by step guide to create an API with PHP, hopefully this can help

    https://forum.espocrm.com/forum/deve...46-api-example

    Comment


    • #3
      I use Test API Software (for example Postman or Insomnia) to test out API system, perhaps that is something you can consider trying before start using the code.

      Comment

      Working...
      X