Podbox research & development

updating a contact via API deletes the email address (Sugar OpenCloud API)

Discussion created by Podbox research & development on Jul 10, 2015
Latest reply on Mar 27, 2017 by Ajay Kumar
Hello,

Podbox provides automatic data sync services either for hosted SugarCRM or Sugar OpenCloud  accounts. Our SugarCRM connector works like a charm with hosted accounts but calls to the contact update web service systematically deletes the email addresses. Thanks to our own backup mechanics we did not loose customers, but we have closed our business and services for OpenCloud accounts :(

Changes to lead and contact email addresses not saving and set_entry via the API deletes email addresses are possible issue duplicates for which I wanted to add technical details, especially regarding the requests and responses that illustrate the issue (I have stripped some text for safety and legibility reasons):

1. I created a "John Doe - john@doe.com" contact in the blank podboxisv1.sugaropencloud.eu account. API request and response to read this contact:
  • request (I URL-decoded the rest data for legibility sake):

POST /service/v2/rest.php?method=get_entry_list&input_type=JSON&response_type=JSON&rest_data={"session":"[stripped]","module_name":"Contacts","query":"","order_by":"id","offset":0,"select_fields":[],"link_name_to_fields_array":[],"max_results":3,"deleted":0}

  • response:
{
    "result_count": 1,
    "next_offset": 1,
    "entry_list": [
        {
            "id": "c0c4037f-7b92-ce95-2bae-559e8830ce6e",
            "module_name": "Contacts",
            "name_value_list": {
                ...
                "date_entered": {
                    "name": "date_entered",
                    "value": "2015-07-09 14:42:38"
                },
                "date_modified": {
                    "name": "date_modified",
                    "value": "2015-07-09 14:42:38"
                },
                ...
                "team_name": {
                    "name": "team_name",
                    "value": "Global"
                },
                "email1": {
                    "name": "email1",
                    "value": "john@doe.com"
                },
                "email2": {
                    "name": "email2",
                    "value": ""
                },
                ...
                "first_name": {
                    "name": "first_name",
                    "value": "John"
                },
                "last_name": {
                    "name": "last_name",
                    "value": "Doe"
                },
                ...
            }
        }
    ],
    "relationship_list": []
}

2. request and response to update the contact (upercased the family name):
  • request (I bolden the email1 address so that you can see that it was not omitted from the request) that I haven't stripped to let you check anything you want:
POST /service/v2/rest.php?method=set_entry&input_type=JSON&response_type=JSON&rest_data={"session":"[...]","module_name":"Contacts","name_value_list":[{"name":"my_favorite"},{"name":"following"},{"name":"id","value":"c0c4037f-7b92-ce95-2bae-559e8830ce6e"},{"name":"name"},{"name":"date_entered","value":"2015-07-09 14:42:38"},{"name":"date_modified","value":"2015-07-09 14:42:38"},{"name":"modified_user_id","value":"1"},{"name":"modified_by_name","value":"Dom Administrator"},{"name":"created_by","value":"1"},{"name":"created_by_name","value":"Dom Administrator"},{"name":"doc_owner"},{"name":"user_favorites"},{"name":"description"},{"name":"deleted","value":"false"},{"name":"assigned_user_id","value":"1"},{"name":"assigned_user_name","value":"Dom Administrator"},{"name":"team_id","value":"1"},{"name":"team_set_id","value":"1"},{"name":"team_count"},{"name":"team_name","value":"Global"},{"name":"email"},{"name":"email1","value":"john@doe.com"},{"name":"email2"},{"name":"invalid_email"},{"name":"email_opt_out"},{"name":"email_addresses_non_primary"},{"name":"salutation"},{"name":"first_name","value":"John"},{"name":"last_name","value":"DOE"},{"name":"full_name"},{"name":"title"},{"name":"facebook"},{"name":"twitter"},{"name":"googleplus"},{"name":"department"},{"name":"do_not_call","value":"false"},{"name":"phone_home"},{"name":"phone_mobile"},{"name":"phone_work"},{"name":"phone_other"},{"name":"phone_fax"},{"name":"primary_address_street"},{"name":"primary_address_street_2"},{"name":"primary_address_street_3"},{"name":"primary_address_city"},{"name":"primary_address_state"},{"name":"primary_address_postalcode"},{"name":"primary_address_country"},{"name":"alt_address_street"},{"name":"alt_address_street_2"},{"name":"alt_address_street_3"},{"name":"alt_address_city"},{"name":"alt_address_state"},{"name":"alt_address_postalcode"},{"name":"alt_address_country"},{"name":"assistant"},{"name":"assistant_phone"},{"name":"picture"},{"name":"email_and_name1"},{"name":"lead_source"},{"name":"account_name"},{"name":"account_id"},{"name":"dnb_principal_id"},{"name":"opportunity_role_fields"},{"name":"opportunity_role_id"},{"name":"opportunity_role"},{"name":"reports_to_id"},{"name":"report_to_name"},{"name":"birthdate"},{"name":"campaign_id"},{"name":"campaign_name"},{"name":"c_accept_status_fields"},{"name":"m_accept_status_fields"},{"name":"accept_status_id"},{"name":"accept_status_name"},{"name":"accept_status_calls"},{"name":"accept_status_meetings"},{"name":"sync_contact"},{"name":"mkto_sync","value":"false"},{"name":"mkto_id"},{"name":"mkto_lead_score"},{"name":"last_campaign_clicks_c"},{"name":"last_campaign_opens_c"},{"name":"last_campaign_name_c"},{"name":"contact_type_c"}]}

  • response:
{"id":"c0c4037f-7b92-ce95-2bae-559e8830ce6e"}

3. the next read contacts call, whose response misses the email1 address:
  • request:

POST
/service/v2/rest.php?method=get_entry_list&input_type=JSON&response_type=JSON&rest_data={"session":"[stripped]","module_name":"Contacts","query":"","order_by":"id","offset":0,"select_fields":[],"link_name_to_fields_array":[],"max_results":3,"deleted":0}

  • response:
{
    "result_count": 1,
    "next_offset": 1,
    "entry_list": [
        {
            "id": "c0c4037f-7b92-ce95-2bae-559e8830ce6e",
            "module_name": "Contacts",
            "name_value_list": {
                ...
                "date_entered": {
                    "name": "date_entered",
                    "value": "2015-07-09 14:42:38"
                },
                "date_modified": {
                    "name": "date_modified",
                    "value": "2015-07-09 14:52:00"
                },
                ...
                "team_name": {
                    "name": "team_name",
                    "value": "Global"
                },
                "email1": {
                    "name": "email1",
                    "value": ""
                },
                "email2": {
                    "name": "email2",
                    "value": ""
                },
                ...
                "first_name": {
                    "name": "first_name",
                    "value": "John"
                },
                "last_name": {
                    "name": "last_name",
                    "value": "DOE"
                },
                ...
           }
        }
    ],
    "relationship_list": []
}

Thank you in advance for your help, looking forward to hearing from you soon so that we can get back in syncing SugarOpenCloud accounts, in the interest of our common users.

Have a nice day!
Luc Sorel, PhD - R&D at www.podbox.com/integration/sugar-crm

Outcomes