Remove lead from target list with API

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • egy87
    replied
    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!

    Leave a comment:


  • yuri
    replied
    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.

    Leave a comment:


  • egy87
    started a topic Remove lead from target list with API

    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
Working...