Not entirely sure what the field part of this module is supposed to do; i assume you can enter address field postal code and it will fill in the rest; but that doesn't work.

I have had some success using the API directly though and calling this:

addressfield_lookup_get_addresses('k1t4c5', 'ca');

does return an ID value of: CA|CP|ENG|4C5-K1T:Find

but, then running this:

addressfield_lookup_get_address_details('CA|CP|ENG|4C5-K1T:Find');

gives this error:

Address details retrieval failed. Reason: Error 1001 (Id Invalid). The Id parameter supplied was invalid.. Resolution: Try again, using only IDs from the Find services.

am i missing something here?

Comments

liquidcms created an issue. See original summary.

liquidcms’s picture

perhaps if there was documentation somewhere on what an Address ID looked like.

liquidcms’s picture

i think i am closing on the issue here. my guess is this is bug in the module code.

from the api tester here: https://www.pcapredict.com/support/webservice/captureplus/interactive/fi...

i can enter my address id: CA|CP|ENG|4C5-K1T and it comes up with a list of valid results (but using api calls in this module it generates an error);

but, if i use the ID from one of the results given by the api tester; to the module code:

addressfield_lookup_get_address_details('CA|CP|B|6178047');

then the module returns a valid result.

my guess is the module only handles ids that equate to a single result; as opposed to any result returned from addressfield_lookup_get_addresses ??

liquidcms’s picture

From a convoluted answer i received from PCA Predict i think the API for this module is missing a few things.

Mostly just trial and error I discovered that I need to supply both:

SearchTerm=k1t4c5
LastId=CA|CP|ENG|4C5-K1T

This gives the array of answers I am looking for.

this module, as far as I can tell from the code is missing a recursive component. My guess is this need to perform the search call with different parameters depending on the method returned in the previous call. In other words, if the call returns “Find” in the result; it needs to do another call. Perhaps this is country specific and maybe in Canada this 2nd call is always required and maybe in other countries no 2nd call or maybe more than 2 calls is required (i.e. needs to a recursive routine?).

liquidcms’s picture

Category: Support request » Bug report