API changing individual password

Home Forums General Issues API changing individual password

This topic contains 7 replies, has 2 voices, and was last updated by  AAC 3 years, 4 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #948

    AAC
    Participant

    Trying to update an individual record and update the password, my parameters are,

    $neon_args =array(
    “individualAccount.accountId” => $account_id,
    “individualAccount.primaryContact.contactId” => $contact_id,
    “individualAccount.primaryContact.firstName” => $first_name,
    “individualAccount.primaryContact.lastName” => $last_name ,
    “individualAccount.login.username” => $user_name,
    “individualAccount.login.password” => $password,
    );

    But I am getting a

    [“operationResult”]=> string(4) “FAIL” [“responseDateTime”]=> string(28) “2016-05-16T22:23:28.223+0000” [“errors”]=> array(1) { [“error”]=> array(1) { [0]=> array(2) { [“errorCode”]=> string(5) “10026” [“errorMessage”]=> string(99) “ExistingOrgnizationId is invalid, you can use linkIndividualToOrganization to add new relationship.” } } } }

    error, im not passing a ExistingOrgnizationId why would this happen ?

    #949

    AAC
    Participant

    im guessing we need to map the entire records. is there a quick way to map the record and just change the one we want to update ?

    ie: by getting the retrieveIndividualAccount and putting it on updateIndividualAccount and change the field need to be updated ?

    • This reply was modified 3 years, 5 months ago by  AAC.
    #951

    Colin Pizarek
    Keymaster

    You are correct. When you update an existing account, you need to populate all of the fields. The documentation covers this:

    Danger! If you include a blank parameter:

    &individualAccount.primaryContact.phone1=

    Any existing data will be deleted. Also, if you fail to include a field parameter in your request, any existing data in that field will be deleted. In practical terms, to use this method to update data from an existing account, you’ll want to:

    1. Retrieve the complete account data using Retrieve Individual Account
    2. Populate all of that data into the parameters specified in this method
    3. Submit this request to the server.
    #952

    Colin Pizarek
    Keymaster

    That said, I think there’s an interesting possibility to add that capability to the PHP library, since this is a common task. The API itself, however, is not going to change anytime soon. It works that way due to NeonCRM’s architecture.

    #959

    AAC
    Participant

    Colin,

    Thanks we got this done by mapping the entire list of items, but slight issue with the address post in the question below.

    One thing if you can clear for me, which you also mentioned in another thread, so I will ask in there,

    API add value to organization company profile

    #961

    AAC
    Participant

    Check incase this dropped out let me ask the question here again,

    so for an individual record if there are multiple addresses how does the array key need to be formatted here:

    $neon_args[“individualAccount.primaryContact.addresses.address.isPrimaryAddress”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.isShippingAddress”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.addressType.id”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.addressType.Name”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.addressLine1”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.addressLine2”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.addressLine3”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.addressLine4”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.city”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.state.code”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.state.name”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.province”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.county”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.country.id”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.country.name”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.zipCode”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.zipCodeSuffix”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.startDate”] =
    $neon_args[“individualAccount.primaryContact.addresses.address.endDate”] =

    #962

    AAC
    Participant

    One of the issues we are having is that, when doing this update, some accounts work and some dont, the $neon_args is pretty much identical beside the field values from the records that work and dont work.

    updateIndividualAccount() returns null for the ones that dont work. Troubleshooting for quite some time but cant seem to see the issue, can i get some guidance.

    #963

    AAC
    Participant

    was able to sort out the updateIndividualAccount() issue, it was failing on the PhoneType where retrieveIndividualAccount() was returning the value in all caps and the update function was expecting only the first letter to be caps.

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.