Not able to update/add OwnerID through REST API

Hello! I am using Gravity Form’s Infusionsoft integration to add contacts to our database, and everything is working well except adding an Owner to the contact. I am not the developer of the plugin (who is no longer supporting it), but I am happy to dig in to find any helpful information. I am not seeing any errors, so I am wondering if there are any settings on the API side of things that might be causing issues (permissions, needing to add something to the API settings, etc). Also, any suggestions on where I should begin investigating the problem? I will post the REST data posted on an example form submission. Thank you for your help!

Bryan

Array
(
    [Form Entry Data] => Array
        (
            [id] => 201
            [form_id] => 13
            [date_created] => 2017-10-12 19:18:44
            [is_starred] => 0
            [is_read] => 0
            [ip] => 141.101.148.33
            [source_url] => http://madiagnostic.wpengine.com/diagnostic/?consultant=33222&consultant_email=bryan%40smartchurchproject.com
            [post_id] => 
            [currency] => USD
            [payment_status] => 
            [payment_date] => 
            [transaction_id] => 
            [payment_amount] => 
            [payment_method] => 
            [is_fulfilled] => 
            [created_by] => 2
            [transaction_type] => 
            [user_agent] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36
            [status] => active
            [8.3] => Bryan
            [8.6] => Miller
            [9] => XXX-XXX-XXXX
            [2] => email@email.com
            [1] => Test Church 5
            [11] => Lawrence
            [25] => Kansas
            [23] => Lutheran
            [24] => 301 - 500
            [16] => 300
            [18] => 1
            [19] => 1
            [20] => 1
            [21] => 1
            [3] => http://madiagnostic.wpengine.com/ministry-architects-diagnostic-tool/
            [4] => single
            [27] => 11111
            [28] => email@email.com
            [8.2] => 
            [8.4] => 
            [8.8] => 
            [17] => 
            [26] => 
        )
    [Infusionsoft Feed Meta Data] => Array
        (
            [id] => 1
            [form_id] => 13
            [is_active] => 1
            [meta] => Array
                (
                    [contact_object_name] => 
                    [field_map] => Array
                        (
                            [City] => 11
                            [Company] => 1
                            [Email] => 2
                            [FirstName] => 8.3
                            [LastName] => 8.6
                            [OwnerID] => 27
                            [Phone1] => 9
                            [State] => 25
                            [_Denomination0] => 23
                            [_WorshipAttendance] => 16
                            [_OwnerofContact0] => 27
                            [_ChurchSize1] => 24
                        )

                    [optin_enabled] => 
                    [optin_value] => 
                    [optin_operator] => 
                    [optin_field_id] => 
                    [tag_optin_enabled] => 
                    [tag_optin_field_id] => 
                    [tag_optin_operator] => 
                    [tag_optin_tags] => 
                    [tag_optin_value] => 
                )

        )
    [Infusionsoft Posted Merge Data] => Array
        (
            [City] => Lawrence
            [Company] => Test Church 5
            [Email] => bryan@smartchurchproject.com
            [FirstName] => Bryan
            [LastName] => Miller
            [OwnerID] => 11111
            [Phone1] => XXX-XXX-XXXX
            [State] => Kansas
            [_Denomination0] => Lutheran
            [_WorshipAttendance] => 300
            [_OwnerofContact0] => 11111
            [_ChurchSize1] => 301 - 500
        )
    [Posted Data ($_POST)] => Array
        (
            [input_8_3] => Bryan
            [input_8_6] => Miller
            [input_9] => XXX-XXX-XXXX
            [input_2] => email@email.com
            [input_1] => Test Church 5
            [input_11] => Lawrence
            [input_25] => Kansas
            [input_23] => Lutheran
            [input_23_other] => Other
            [input_24] => 301 - 500
            [input_24_other] => Other
            [input_16] => 300
            [input_18] => 1
            [input_19] => 1
            [input_20] => 1
            [input_21] => 1
            [input_3] => http://madiagnostic.wpengine.com/ministry-architects-diagnostic-tool/
            [input_4] => single
            [input_27] => 11111
            [input_28] => email@email.com
            [is_submit_13] => 1
            [gform_submit] => 13
            [gform_unique_id] => 
            [state_13] => WyJbXSIsIjdjNTYxZDc4MTU4ODUxMWI0OWQxZWU3ZTVlNzQ2YzBjIl0=
            [gform_target_page_number_13] => 0
            [gform_source_page_number_13] => 1
            [gform_field_values] => 
        )

    [Contact ID] => 30362
    [Adding Tags] => Array
        (
        )

)

@Carlos_Ochoa and myself were just looking at this; are you trying to set the OwnerId to a ContactId, or to the UserId of the user in question?

Hi Tom!

Thank you for the followup! I replaced the UserID with a random number, not the actual user’s ID (would have been 33222). In essence, we are adding contacts to the database and would like to assign that contact to one of the users in our account. I was told by the sales staff of the company that this was done through setting the user as the “Owner,” which I assume is set through OwnerID. I tried setting it by simply adding the user name as a string (didn’t work), but then saw in the documentation that it should be an ID and not a string. So, I tried setting it to the UserID, but that did not work either. Hopefully this clarifies things a bit, but please let me know if I can provide more information!

Thank you!
Bryan

Hi @Non-Connections_Team, It seems like this may be going through the legacy (xmlrpc) api? I have just tested using the following example in the REST API:

POST to /contacts

{
  "given_name": "TestContact",
  "owner_id": "1872",
	"email_addresses": [
	    {
	      "email": "email@example.com",
	      "field": "EMAIL1"
	    }
	]
}

I was able to create a contact with the correct owner. Are you able to try the api call here and see if it works for you?

I was able to use the following in xmlrpc to get the same result:

<?xml version='1.0' encoding='UTF-8'?>
<methodCall>
  <methodName>ContactService.add</methodName>
  <params>
    <param>
      <value><string>{{APIKey}}</string></value>
    </param>
     <param>
      <value><struct>
        <member><name>FirstName</name>
          <value><string>TestContact</string></value>
        </member>
        <member><name>Email</name>
          <value><string>email@example.com</string></value>
        </member>
        <member><name>OwnerID</name>
          <value><string>1872</string></value>
        </member>
      </struct></value>
    </param>
  </params>
  </methodCall>

Hi @Carlos_Ochoa! You are right! I think the plugin is using xmlrpc. The funny thing is, I am able to create and update contacts without any issue except for the OwnerID. There aren’t any permission issues or anything similar that would prevent it from being updated, are there?

Thank you,
Bryan

@Carlos_Ochoa - I am starting to wonder if I need to have anything set on the server side. We are hosting on WP Engine, and they think that there are some settings that need to be set for the integration to work. Any thoughts here?

Thank you!
Bryan

Hey Bryan, I am not too familiar with the gravity forms wordpress integration :frowning: , without seeing the request body itself, or the code that is creating the call, I am not 100% sure if there is any additional configuration needed. If the plugin is using our SDK, it should allow you to pass the OwnerID and set it correctly. I recommend looking at the source to see if the call that the plugin is using is actually passing that owner id, and that the value being passed at the time of the call is correct.

I am not sure if this is a big amount of work to do, but you may be able to extend the source to allow OwnerID to be passed if it is something that is missing.