Announcement

Collapse
No announcement yet.

REST API - How to get deleted meetings

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

  • REST API - How to get deleted meetings

    Hi
    I am on the way creating an interface between Espo CRM Meeting and Caldav Calendar. I am reading events from Espo via the REST API in PHP with following piece of code

    PHP Code:
    $response $client->request('GET''Meeting', [
          
    'where'  => Array(
                            
    => Array(
                                    
    'type' => 'after',
                                    
    'field' => 'modifiedAt',
                                    
    'value' => '2019-01-12 09:29:23',
                                    
    'dateTime' => true,
                                    
    'timeZone' => 'Europe/Berlin'
                                    
    )
                            )      
    ]); 
    This way I read all new or modified entries since last update.
    What I am missing now are deleted events. As I saw they are marked as deleted but they still available in the system. I saw also that the field "deleted" is available in the meeting response:


    [3] => Array
    (
    [id] => 5c3b3048b90fd4e5b
    [name] => Business day
    [deleted] =>
    [status] => Planned
    [dateStart] => 2019-01-25 07:00:00
    [dateEnd] => 2019-01-25 16:00:00
    [duration] => 32400
    [description] => Business day
    [createdAt] => 2019-01-13 12:34:16
    [modifiedAt] => 2019-01-13 12:34:16
    [parentId] => 5be9ee548f5213c86
    [parentType] => Contact
    [parentName] => Max Musterman
    [accountId] =>
    [accountName] =>
    [createdById] => 5af5a91684f046d99
    [createdByName] => Demo User
    [modifiedById] =>
    [modifiedByName] =>
    [assignedUserId] => 5af5a91684f046d99
    [assignedUserName] => Demo User
    )
    But in the moment the meeting is marked as deleted the records is no more available over API.

    How can I get also deleted events?

    Thank you

    Gino
    Last edited by gino909; 01-16-2019, 05:21 PM.

  • #2
    Trying to find out how is working... following piece of code works for active meetings

    PHP Code:
    $response $client->request('GET''Meeting', [
          
    'where'  => Array(
                            
    => Array(
                                    
    'type' => 'equals',
                                    
    'field' => 'deleted',
                                    
    'value' => 0
                                    
    )
                            )
    ]); 
    But is not working when changing value to "1"

    PHP Code:
    $response $client->request('GET''Meeting', [
          
    //'offset' => '0',
          
    'where'  => Array(
                            
    => Array(
                                    
    'type' => 'equals',
                                    
    'field' => 'deleted',
                                    
    'value' => 1
                                    
    )
                            )
    ]); 
    Can someone say why?

    Comment


    • #3
      So is there a way to do this (for any record type)? Is it possible to access deleted records in any way programmatically (through record API, record history, etc)?

      This is very much needed for integration and synchronization purposes.

      Thank you!
      Last edited by syncpenguin; 02-10-2020, 02:58 PM.

      Comment


      • #4
        Originally posted by syncpenguin View Post
        So is there a way to do this (for any record type)? Is it possible to access deleted records in any way programmatically (through record API, record history, etc)?

        This is very much needed for integration and synchronization purposes.

        Thank you!
        Dear syncpenguin,

        got any further with this? i am also interested in syncing with CalDAV, perhaps we should combine our efforts?

        To get the deleted records i just found out to use SQL...
        This example is based on the structure of https://github.com/espocrm/documenta...heduled-job.md

        $entityManager = $this->getEntityManager();
        $sql = $entityManager->runQuery('select * from meeting where deleted = 1');
        $sqlResult = $sql->fetchAll();
        throw new Error($sqlResult[0]["id"]);

        Comment

        Working...
        X