Method Community

 

API Update Issue.

Last post 05-26-2017 3:39 PM by Method_Audisho. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-25-2017 6:14 PM

    API Update Issue.

    I have run into an issue with the update call with the api.  On the contacts table, it has stopped updating every field every time.  I can not say why this has happend.  I am running the UpdateV2 call via SOAP.  When I run the call, sometimes it will update every field, but sometimes the fields LastName, Email, and Phone will not update.  Here are two json objects with examples of data I pass in the update call.  The two customers are identical except for the recordID and the username value.  On one update call, the update went through as expected.  On the second update call, I got the same response, which said it was succuessful, but those three fields I mentioned did not actually update.  I am really struggling to figure out why one call would fail, while the other would not, since the two calls are so similar.  The calls happen shortly after I create a new Contact in the system.  This is the inital update call I make to insert the inital data.  

    Call One: Success

    {"strCompanyAccount":"XXXXXXXXXXXXXX","strLogin":"XXXXXXXXXXXXXX","strSessionID":"","strTable":"Contacts","arrUpdateFieldsArray":["AdaNum","AdvancedTrainingUniversity","AgdNum","AlumniLookUpDisplayAddress","AlumniLookUpDisplayPhone","AlumniLookUpOption","BillingAddress1","BillingAddress2","BillingAddressCity","BillingAddressCountry","BillingAddressFirstName","BillingAddressLastName","BillingAddressRegion","BillingAddressState","BillingAddressZip","Birthday","CellPhone","CertificateName","ChildrensNames","ContactGender","CustomerWebsite","DateCreated","DateModified","DentistsInPractice","DoctorSpecialty","Email","FirstName","FoodAllergies","GrewUpIn","HearAbout","HearAboutDetails","HometownCity","HometownState","HometownCountry","LastName","OfficeAddress1","OfficeAddress2","OfficeAddressCity","OfficeAddressCountry","OfficeAddressRegion","OfficeAddressState","OfficeAddressZip","OfficeContact","OfficeContactEmail","OfficeFax","OfficeName","OfficePhone","Phone","PreferredName","PreferredContactMethod","PrimaryBusinessType","PronouncedName","SharePersonalInfo","ShippingAddress1","ShippingAddress2","ShippingAddressCity","ShippingAddressCountry","ShippingAddressFirstName","ShippingAddressLastName","ShippingAddressRegion","ShippingAddressState","ShippingAddressZip","Shirt","SyncedWithWordPress","ShouldSendIntroPacket","SpouseName","SpecialRequests","Title","UserName","YearAdvancedTrainingComplete","YearBeganPractice"],"arrUpdateValueArray":["456","","123",true,true,"Display to public","2716 A Street","Office","Tacoma","United States","DevAuto","MatedTest1234","","Washington","98402","1981-03-02 08:00:00","123-456-7890","Automated Certificate","Automated Test Jr","Undisclosed","https:\/\/www.sitecrafting.com","2017-05-25 23:00:05","2017-05-25 23:00:05","10 or more","General Practice","mschnepf+1495745356942@sitecrafting.com","DevAuto","Pollen in the air","New England","Mailer \/ Flyer","","South Berwick","Maine","USA","MatedTest1234","2716 A Street","Office","Tacoma","United States","","Washington","98402","Automated","mschnepf+1495745356942@sitecrafting.com","(123) 456-7890","My Office","1-234-567-8900","1234567890","Dev","Phone","Full-time Faculty","DAMT",true,"2716 A Street","Office","Tacoma","United States","DevAuto","MatedTest1234","","Washington","98402","Men XL",true,true,"Mrs. Automated Test","candy candy candy","Dr.","devgitestFromPostman5","","1999"],"intRecordID":154}

    Call Two: Failure
    {"strCompanyAccount":"XXXXXXXXXXXXXX","strLogin":"XXXXXXXXXXXXXX","strSessionID":"","strTable":"Contacts","arrUpdateFieldsArray":["AdaNum","AdvancedTrainingUniversity","AgdNum","AlumniLookUpDisplayAddress","AlumniLookUpDisplayPhone","AlumniLookUpOption","BillingAddress1","BillingAddress2","BillingAddressCity","BillingAddressCountry","BillingAddressFirstName","BillingAddressLastName","BillingAddressRegion","BillingAddressState","BillingAddressZip","Birthday","CellPhone","CertificateName","ChildrensNames","ContactGender","CustomerWebsite","DateCreated","DateModified","DentistsInPractice","DoctorSpecialty","Email","FirstName","FoodAllergies","GrewUpIn","HearAbout","HearAboutDetails","HometownCity","HometownState","HometownCountry","LastName","OfficeAddress1","OfficeAddress2","OfficeAddressCity","OfficeAddressCountry","OfficeAddressRegion","OfficeAddressState","OfficeAddressZip","OfficeContact","OfficeContactEmail","OfficeFax","OfficeName","OfficePhone","Phone","PreferredName","PreferredContactMethod","PrimaryBusinessType","PronouncedName","SharePersonalInfo","ShippingAddress1","ShippingAddress2","ShippingAddressCity","ShippingAddressCountry","ShippingAddressFirstName","ShippingAddressLastName","ShippingAddressRegion","ShippingAddressState","ShippingAddressZip","Shirt","SyncedWithWordPress","ShouldSendIntroPacket","SpouseName","SpecialRequests","Title","UserName","YearAdvancedTrainingComplete","YearBeganPractice"],"arrUpdateValueArray":["456","","123",true,true,"Display to public","2716 A Street","Office","Tacoma","United States","DevAuto","MatedTest1234","","Washington","98402","1981-03-02 08:00:00","123-456-7890","Automated Certificate","Automated Test Jr","Undisclosed","https:\/\/www.sitecrafting.com","2017-05-25 23:00:58","2017-05-25 23:00:58","10 or more","General Practice","mschnepf+1495745356942@sitecrafting.com","DevAuto","Pollen in the air","New England","Mailer \/ Flyer","","South Berwick","Maine","USA","MatedTest1234","2716 A Street","Office","Tacoma","United States","","Washington","98402","Automated","mschnepf+1495745356942@sitecrafting.com","(123) 456-7890","My Office","1-234-567-8900","1234567890","Dev","Phone","Full-time Faculty","DAMT",true,"2716 A Street","Office","Tacoma","United States","DevAuto","MatedTest1234","","Washington","98402","Men XL",true,true,"Mrs. Automated Test","candy candy candy","Dr.","devgitestFromPostman6","","1999"],"intRecordID":155}

  • 05-26-2017 3:03 PM In reply to

    Re: API Update Issue.

    Answer

    Hi dknoben,

    First of all, I'm sorry that you're running into this issue. There's no reason that the API would be leaving out data that you're explicitly sending without returning an error. This is however, a tricky one as there are multiple moving parts here.

    The first thing I would check is that your sync is not overwriting the data. If the update call happens immediately after inserting the customer record, the sync triggered by the insert may still be in-progress. Each sync to QuickBooks includes a return sync to Method and if your update is occurring somewhere in between, it may be that the return sync is simply overwriting this data.

    You can also try creating an XML payload instead of converting from JSON to determine if the payload isn't being converted correctly in some cases. Additionally, you could try adding a delay in between these calls to test if you're encountering a race condition.

    Hopefully one of my suggestions leads you to a solution, but please let me know if you're still encountering this problem and we can discuss some further troubleshooting options.

    Cheers,
    Audisho

    Audisho Sada
    Product Manager
    Method:CRM
    a.sada@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
  • 05-26-2017 3:30 PM In reply to

    Re: API Update Issue.

    After doing some tests I think you are correct, it was a race case. I was only initially saving the first name and name fields to the Method Customer object, so it makes sense that those fields would not get overwritten, but the other three which I was not entering would. I thought, since those fields were in the contact table in method, and not the customer table, they would be separate, but I guess that  is not the case.  

    Thanks for the help. 

  • 05-26-2017 3:39 PM In reply to

    Re: API Update Issue.

    Hi dknoben,

    It's my pleasure. I just want to touch on the customer/contact scenario the you mentioned. We do include some backend logic or "Method magic" as we like to refer to it here that keeps the customer and primary contact data in-sync. You can actually see this take place in Method; when you update this data on the customer, the primary contact's data will be updated as well and vice-versa.

    I hope this sheds some additional light on this scenario for you.

    Cheers,
    Audisho

    Audisho Sada
    Product Manager
    Method:CRM
    a.sada@method.me
    Toll Free: 1.888.925.6238
    Local & Overseas: 416.847.0400
    Fax: 416.640.6027
Page 1 of 1 (4 items)