Ask Your Question

Invalid Format argument [COMPACT-DECODED....

asked 2018-05-02 11:34:46 -0600

sam gravatar image

Hi, I keep getting this error message:


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


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-05-02 11:49:10 -0600

updated 2018-05-02 16:39:07 -0600

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:

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.

edit flag offensive delete link more


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 gravatar imagesam ( 2018-05-02 12:38:24 -0600 )edit

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

bwolven gravatar imagebwolven ( 2018-05-02 13:59:47 -0600 )edit

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

bwolven gravatar imagebwolven ( 2018-05-02 14:04:41 -0600 )edit

This is the login URL: 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 gravatar imagesam ( 2018-05-02 14:57:59 -0600 )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 gravatar imagebwolven ( 2018-05-02 15:29:59 -0600 )edit

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

sam gravatar imagesam ( 2018-05-02 15:40:54 -0600 )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 gravatar imagebwolven ( 2018-05-02 15:41:32 -0600 )edit

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

sam gravatar imagesam ( 2018-05-02 15:52:54 -0600 )edit

If you are using POST, try using GET instead.

bwolven gravatar imagebwolven ( 2018-05-02 16:07:10 -0600 )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 gravatar imagesam ( 2018-05-02 16:09:48 -0600 )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 gravatar imagebwolven ( 2018-05-02 16:11:59 -0600 )edit

ok Thanks for the help

sam gravatar imagesam ( 2018-05-02 16:15:21 -0600 )edit

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

bwolven gravatar imagebwolven ( 2018-05-02 16:36:33 -0600 )edit

ok, thanks thats the beauty of open source :)

sam gravatar imagesam ( 2018-05-02 16:57:59 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-05-02 11:34:46 -0600

Seen: 650 times

Last updated: May 02 '18