Rest api add Calls

Hi,

I'm a developer at Ringover, a web-based telephony solution.
We use Sugar's REST API to log calls in our client's instances.


One of our mutual clients reported an issue: when we add a call, emails are sent.

This behavior is undesirable but we haven't seen anything in the API that allows us to control this behavior.

The client persists in claiming it's on our end (he contacted Sugar support).
He sends us an image of the sugar interface, but we haven't found anything in the API that references this.



Can anyone help us with this ?
We use this rest route to add a call.
support.sugarcrm.com/.../


Thank you !
Regards
Rémi MOINAS
Ringover Group

Parents
  • If I am not mistaken, and I've not tried this, setting the $callsBean->send_invites  to false in your Calls bean should stop the notifications from being sent, by default they are sent.

    Again, I've not tried this, I just checked the _sendNotifications function in

    data/SugarBean.php in v25.1

    It looks like this, note the  comments about some bugs that may affect you.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /**
    * Send assignment notifications and invites for meetings and calls
    * @param bool $check_notify
    */
    // @codingStandardsIgnoreLine PSR2.Methods.MethodDeclaration.Underscore
    protected function _sendNotifications($check_notify)
    {
    if ($check_notify || (isset($this->notify_inworkflow) && $this->notify_inworkflow == true) && // cn: bug 5795 - no invites sent to Contacts, and also bug 25995, in workflow, it will set the notify_on_save=true.
    !$this->isOwner($this->created_by) && // cn: bug 42727 no need to send email to owner (within workflow)
    $this->module_name !== 'PushNotifications'
    ) {
    $admin = Administration::getSettings();
    $sendNotifications = false;
    if ($admin->settings['notify_on']) {
    $GLOBALS['log']->info('Notifications: user assignment has changed, checking if user receives notifications');
    $sendNotifications = true;
    } elseif (isset($this->send_invites) && $this->send_invites == true) {
    // cn: bug 5795 Send Invites failing for Contacts
    $sendNotifications = true;
    } else {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    FrancescaS

  • Hi,

    Thanks for this response and sorry for the delay.

    I tried setting "send_invites" to false/0 in the query parameters of the POST request.
    No change, invitation emails are still sent.
    Is there an email address to contact Sugar technical support ?

    Regards
    Rémi MOINAS
    Ringover Group

  • Hi Remi,

    Thanks for sharing this!

    I’ve been testing this on a stock installation, and I can confirm that the send_invites parameter is indeed responsible for controlling whether invites are sent. If it’s set to true, invites will be sent. If it’s false, they won’t be.

    You my check bellow my example payload with send_invites set to false. 
    Can you try building a similar one and confirm that the invites are not sent this way? 

    If invites are still being sent with this setting in place, then there may be something else affecting the behavior. Here are a couple of possibilities to consider:

    1. The emails you’re seeing might not be invitation emails—they could be assignment notifications instead.
    2. The send_invites parameter might be getting reset somewhere during the process.

    Endpoint that I am using to test: 

    aserrazina25.sugaropencloud.eu/.../Calls



    My postman Payload: 


    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    {
    "deleted": false,
    "duration_hours": 0,
    "status": "Planned",
    "reminder_time": 1800,
    "email_reminder_time": -1,
    "email_reminder_sent": false,
    "repeat_interval": 1,
    "series_deleted": false,
    "dri_workflow_sort_order": 1,
    "customer_journey_progress": 0,
    "cj_momentum_ratio": 0,
    "customer_journey_points": 10,
    "is_cj_parent_activity": false,
    "is_customer_journey_activity": false,
    "assigned_user_id": "083d63f6-e41e-48fc-900d-012015385df7",
    "date_start": "2025-06-30T12:00:00+01:00",
    "date_end": "2025-06-30T12:30:00+01:00",
    "duration_minutes": 30,
    "repeat_type": "",
    "repeat_selector": "None",
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    Let me know how the test goes. 

    Cheers, 

    André 

  • Hi,

    Thanks for detailed response.
    I made more test, this is conclusion in my side.

    The presence or absence of send_invites in the payload does not change anything (true or false, nevermind).

    This request send an invitation : POST {{sugar_url}}/rest/v11_16/Calls?send_invites=0
    This request does not send an invitation : POST {{sugar_url}}/rest/v11_16/Calls?send_invites=1 (or other value)

    The payload for these requests is : 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    {
    "date_start": "2025-06-27T10:10:10+00:00",
    "date_end": "2025-06-27T10:20:10+00:00",
    "direction": "Inbound",
    "description": "Test",
    "status": "Held",
    "duration_minutes": 10,
    "assigned_user_id": "67ab219a-5a6e-405f-92d3-ab8b00f4b783",
    "parent_type": "Accounts",
    "name": "Invites_will_not_be_sent_15"
    }
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    Name is changed at each request, so no possible confusion..

    The user setting "Email on Assignement" is checked.
    Is this behavior logical? Why? And why a difference in behavior between your tests and mine? (same api version and raw instance in our side)

    I would like to understand so that I can produce a stable patch for our client.

    Thanks a lot !
    Regards,
    Rémi MOINAS 
    Ringover Group

  • Hi Rémi,

    Are the users synchronizing their calls to their Outlook calendar with the Sugar Connect plugin? If so, when the call gets synchronized to their Outlook calendar, Outlook will send out an invite to any invitees.

    Chris

  • Hi Chris, 

    I don't think that the email in question has not been ressembled to an Outlook email.

    Thanks !
    Regards,
    Rémi MOINAS 
    Ringover Group

  • Hey Remi! 

    I think I see what’s going on — it looks like you’re including send_invites in the URL, but it actually needs to be part of the payload.

    Try using this URL:

     POST {{sugar_url}}/rest/v11_16/Calls

    And add the "send_invites": false parameter to your payload

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    {
    "date_start": "2025-06-27T10:10:10+00:00",
    "date_end": "2025-06-27T10:20:10+00:00",
    "direction": "Inbound",
    "description": "Test",
    "status": "Held",
    "duration_minutes": 10,
    "assigned_user_id": "67ab219a-5a6e-405f-92d3-ab8b00f4b783",
    "parent_type": "Accounts",
    "name": "Invites_will_not_be_sent_15",
    "send_invites": false
    ***Rest of payload
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    Let me know if that helps! 


    Cheers, 

    André 



  • Hello  , 

    Did you manage to test using the send_invites in the payload body? 
    Did that work or are you still facing the issue? 

    Thanks in advance for keeping us posted. 

    Cheers, 

    André 

Reply Children
No Data