Announcement

Collapse
No announcement yet.

Remove lead from target list with API

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

  • Remove lead from target list with API

    Hello everybody,

    I'm trying to delete a leads from a target list with API (python). The function executed is:

    client.request('DELETE', f'Lead/LEAD_ID/targetLists', {'id': TARGET_LIST_ID})


    Unfortunately the function always return false and I'm not able to delete leads from list.

    Any suggestion?
    Thank you

  • #2
    Weird,

    Try debugging. https://github.com/espocrm/espocrm/b...ecord.php#L113

    You can put $GLOBALS['log']->error('some message'); it will be printed to the log.

    According this method, false is returned only in the case neither 'id' nor 'ids' parameters were passed in the payload.

    Comment


    • #3
      I found the issue

      In API Python library of espocrm (espo_api_client.py) in the class EspoAPI. At line 59 there is:

      if method in ['POST', 'PATCH', 'PUT']:

      I changed with:

      if method in ['POST', 'PATCH', 'PUT', 'DELETE']:


      Now everythings work as expected.
      Thank you for point me in right directcion!

      Comment

      Working...
      X