Ask Your Question
0

Invalid Format argument [COMPACT-DECODED....

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

sam gravatar image

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

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

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.

edit flag offensive delete link more

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 gravatar imagesam ( 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 gravatar imagebwolven ( 2018-05-02 13:59:47 -0500 )edit

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

bwolven gravatar imagebwolven ( 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 gravatar imagesam ( 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 gravatar imagebwolven ( 2018-05-02 15:29:59 -0500 )edit

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

sam gravatar imagesam ( 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 gravatar imagebwolven ( 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 gravatar imagesam ( 2018-05-02 15:52:54 -0500 )edit

If you are using POST, try using GET instead.

bwolven gravatar imagebwolven ( 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 gravatar imagesam ( 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 gravatar imagebwolven ( 2018-05-02 16:11:59 -0500 )edit

ok Thanks for the help

sam gravatar imagesam ( 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 gravatar imagebwolven ( 2018-05-02 16:36:33 -0500 )edit

ok, thanks thats the beauty of open source :)

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

Question Tools

1 follower

Stats

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

Seen: 203 times

Last updated: May 02 '18