First time here? Check out the FAQ!
0

Invalid Format argument [COMPACT-DECODED....

Hi, I keep getting this error message:

 Invalid Format argument [COMPACT-DECODED,COMPACT-DECODED,COMPACT-DECODED,COMPACT-DECODED]'

This is the code i used:

while ($maxRows) {
       $results = $rets->Search('Property', 'RE_1', 'L_City=Pasco', [
       'limit' => $limit,
       //'select' => $selectFields,
       'format' => 'COMPACT-DECODED',
       'Offset' => 1
]);

I am using troydavisson PHRETS latest version

Thanks

sam's avatar
sam
asked 2018-05-02 11:34:46 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

The default format should be COMPACT-DECODED.

Don't know if case matters but you can try: 'Format' => 'COMPACT-DECODED'

Internal search defaults are: $defaults = [ 'SearchType' => $resource_id, 'Class' => $class_id, 'Query' => $dmql_query, 'QueryType' => 'DMQL2', 'Count' => 1, 'Format' => 'COMPACT-DECODED', 'Limit' => 99999999, 'StandardNames' => 0, ];

This is from Session.php on GitHub: https://github.com/troydavisson/PHRETS

I'm not a PHP guy but I have played around with PHRETS it a little.

UPDATE: Looks like the use_post_method option in PHRETS puts the parameters on both the URL and the body instead of switching from one to the other. This results in duplicate parameter values in Paragon RETS servers.

bwolven's avatar
bwolven
answered 2018-05-02 11:49:10 -0500, updated 2018-05-02 16:39:07 -0500
edit flag offensive 0 remove flag delete link

Comments

I changed it from format to Format and i got this: Invalid Format argument [COMPACT-DECODED,COMPACT-DECODED]' in If i change it to FORMAT not Format i get this: Invalid Format argument [COMPACT-DECODED,COMPACT-DECODED,COMPACT-DECODED,COMPACT-DECODED]' I think it is case sensitive,

sam's avatar sam (2018-05-02 12:38:24 -0500) edit

What happens if you comment out the format assignment? Also your query should be in parenthesis '(L_City=Pasco)'

bwolven's avatar bwolven (2018-05-02 13:59:47 -0500) edit

Also what RETS login URL are you using and account name (NO PASSWORD Please)?

bwolven's avatar bwolven (2018-05-02 14:04:41 -0500) edit

This is the login URL: https://pacmls-rets.paragonrels.com/r... Username: samgpone

I added the () to the query and i got the same result: [COMPACT-DECODED,COMPACT-DECODED,COMPACT-DECODED,COMPACT-DECODED]

Thanks for the help!

sam's avatar sam (2018-05-02 14:57:59 -0500) edit

And you fixed the case on your request to be 'Format' and 'Limit'. I did verify that PHP array_merge is case sensitive which would cause the parameter value duplication.

bwolven's avatar bwolven (2018-05-02 15:29:59 -0500) edit

Yes, I have double checked it and I keep getting the same error message.

sam's avatar sam (2018-05-02 15:40:54 -0500) edit

Here's what I show you are sending: SearchType=Property&Class=RE_1&Query=(L_City=Pasco)&QueryType=DMQL2&Count=1&Format=COMPACT-DECODED&Limit=5&StandardNames=0&Offset=1&SearchType=Property&Class=RE_1&Query=(L_City=Pasco)&QueryType=DMQL2&Count=1&Format=COMPACT-DECODED&Limit=5&StandardNames=0&Offset=1

bwolven's avatar bwolven (2018-05-02 15:41:32 -0500) edit

Any idea how I would fix that? I have checked the script and it looks like it is only being send once.

sam's avatar sam (2018-05-02 15:52:54 -0500) edit

If you are using POST, try using GET instead.

bwolven's avatar bwolven (2018-05-02 16:07:10 -0500) edit

Looks like it went through, but if i use get, wouldn't my data response be shorter, since GET can only handle so many characters?

sam's avatar sam (2018-05-02 16:09:48 -0500) edit

Get should work just fine. The only reason you may need to use POST is if your parameter list were to get real long. For some reason, PHRETS sends parameters on both URL and in body when POST is selected.

bwolven's avatar bwolven (2018-05-02 16:11:59 -0500) edit

ok Thanks for the help

sam's avatar sam (2018-05-02 16:15:21 -0500) edit

I opened an issue on the GitHub site about the use_post_method putting the parameters both places too.

bwolven's avatar bwolven (2018-05-02 16:36:33 -0500) edit

ok, thanks thats the beauty of open source :)

sam's avatar sam (2018-05-02 16:57:59 -0500) edit
add a comment see more comments

Your Answer

Login/Signup to Answer