Announcement

Collapse
No announcement yet.

Espo Put Patch Post api requests don't work

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

  • Espo Put Patch Post api requests don't work

    I recently attempted to use the espo CRM API for some POST, PUT and PATCH api requests by using postman on my desktop

    However, despite authorisation working, and getting a JSON response, none of the posted attributes are submitting.

    I have checked the network tab in my browser when I use the CRM user interface and I can't see anything different that my browser is doing compared to postman?

    For example if I do a POST to Contact entity then it creates a new blank contact, even if I submitted a firstName attribute. Similarly, post and PUT requests to Contact/5b2a708fba66eb4ea are updating the "updated" timestamp on the records timestamp, but not actually updating any data, even if I copy the request that my browser does when using espoused CRM UI. The body I am sending is simply {"lastName":"APITestdendendddddd"}

    I feel like there is just a lack of documentation, or from other similar questions previously, perhaps a hosting issue?

    Here are some logs from espo crm:

    HTML Code:
    [2018-06-20 16:34:31] Espo.ERROR: E_RECOVERABLE_ERROR: Argument 2 passed to Espo\Services\Record::beforeCreate() must be of the type array, null given, called in /var/sites/l/latuscrm.co.uk/public_html/application/Espo/Services/Record.php on line 704 and defined {"code":4096,"message":"Argument 2 passed to Espo\\Services\\Record::beforeCreate() must be of the type array, null given, called in /var/sites/l/latuscrm.co.uk/public_html/application/Espo/Services/Record.php on line 704 and defined","file":"/var/sites/l/latuscrm.co.uk/public_html/application/Espo/Services/Record.php","line":733,"context":{"entity":"[object] (Espo\\Modules\\Crm\\Entities\\Contact: {"id":null,"fields":{"id":{"dbType":"varchar","len":24,"type":"id"},"name":{"type":"varchar","notStorable":true,"select":"TRIM(CONCAT(IFNULL(contact.first_name, ''), ' ', IFNULL(contact.last_name, '')))","where":{"LIKE":"(contact.first_

    HTML Code:
    [2018-06-20 16:34:31] Espo.WARNING: E_WARNING: Invalid argument supplied for foreach() {"code":2,"message":"Invalid argument supplied for foreach()","file":"/var/sites/l/latuscrm.co.uk/public_html/application/Espo/Services/Record.php","line":530,"context":{"data":"{"firstName":"AppPostTest","emailAddress":"removed@myemailAddress.com"}","attribute":"portalUserId"}} []
    [2018-06-20 16:34:31] Espo.WARNING: E_WARNING: get_object_vars() expects parameter 1 to be object, string given {"code":2,"message":"get_object_vars() expects parameter 1 to be object, string given","file":"/var/sites/l/latuscrm.co.uk/public_html/application/Espo/Services/Record.php","line":704,"context":{"entity":"[object] (Espo\\Modules\\Crm\\Entities\\Contact: {"id":null,"fields":{"id":{"dbType":"varchar","len":24,"type":"id"},"name":{"type":"varchar","notStorable":true,"select":"TRIM(CONCAT(IFNULL(contact.first_name, ''), ' ', IFNULL(contact.last_name, '')))","where":{"LIKE":"(contact.first_na

  • #2
    Hi, I think this got missed due to the delay in authorising the post? Anyone else able to PUT or POST to their CRM?

    Comment


    • #3
      Yes, PUT or POST work fine for my CRM. You may use these API clients: https://github.com/espocrm/documenta...implementation.
      Job Offers and Requests

      Comment

      Working...
      X