Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddingProspectAccount #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

lzpup
Copy link

@lzpup lzpup commented Nov 17, 2020

Hello,
Super fan of this project. I am hoping to pitch in. This is my first contribution.

I am attempting to add support for ProspectAccounts. I have copied your code an implemented. I have duplicated some of your custom field code from Prospect to support the custom fields on the Prospect Account.

I have been testing and it mostly works with my Pardot instance. I have run into one issue with the retrieving the name of the ProspectAccount. I think we overrode the name field with "Name" field and it seems to not retrive the name of any ProspectAccount on my instance, and i get an execption if i don't specify fields and use instead .withName() (example)
[I also get this issue if i specify our fields and pass "name"]
Exception in thread "main" com.darksci.pardot.api.ParserException: Cannot deserialize instance of java.lang.String out of START_OBJECT token
at [Source: (StringReader); line: 77, column: 13] (through reference chain: com.darksci.pardot.api.response.prospectaccount.ProspectAccountQueryResponse["result"]->com.darksci.pardot.api.response.prospectaccount.ProspectAccountQueryResponse$Result["prospectAccount"]->java.util.ArrayList[1]->com.darksci.pardot.api.response.prospectaccount.ProspectAccount["name"])
at com.darksci.pardot.api.PardotClient.submitRequest(PardotClient.java:346)
at com.darksci.pardot.api.PardotClient.prospectAccountQuery(PardotClient.java:1108)
at com.precor.marketinganalytics.TestCrim.PardotAPIClient.TestQueryAccountName(PardotAPIClient.java:439)
at com.precor.marketinganalytics.TestCrim.TestCrimApp.main(TestCrimApp.java:419)
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.lang.String out of START_OBJECT token
at [Source: (StringReader); line: 77, column: 13] (through reference chain: com.darksci.pardot.api.response.prospectaccount.ProspectAccountQueryResponse["result"]->com.darksci.pardot.api.response.prospectaccount.ProspectAccountQueryResponse$Result["prospectAccount"]->java.util.ArrayList[1]->com.darksci.pardot.api.response.prospectaccount.ProspectAccount["name"])

Wondering if you could try the branch against your instance and see if its an issue my instance, or the code.
Otherwise the rest of the methods work great. Hope I can contribute..

@Crim
Copy link
Owner

Crim commented Nov 17, 2020

Awesome! Thanks for the contribution. I'll try to take a look at this soon and let you know what I find.

@Crim
Copy link
Owner

Crim commented Nov 19, 2020

I played around with this a bit today. I think the deserializer needs some work, potentially a custom Deserializer instance. I took a rough stab in the following branch here by adding a couple test cases, and started on a deserializer. I think it's headed in the right direction, but still has issues. I think perhaps the ProspectAccountCustomFieldValueDeserializer is conflicting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants