Re: [merchantos-api-developers] Can't load relations?

256 views
Skip to first unread message

Nathan Horter

unread,
Apr 16, 2013, 2:17:55 PM4/16/13
to merchantos-a...@googlegroups.com
Hi Tyson,

I think there is an error in our parsing code that is having problems with the single relation loaded. If you can try loading a second relation and see if that resolves the issue and let me know.

I'll see if I can identify the parsing problem and get it resolved.



On Tue, Apr 16, 2013 at 10:55 AM, <ty...@bebikes.com> wrote:
Hello,

I'm using curl to test a few things but am having an error I can't figure out. This request works just fine:

curl -u apikey:apikey -G https://api.merchantos.com/API/Account/xxxxx/Customer?load_relations=all

However, this request does not:

curl -g -u apikey:apikey -G https://api.merchantos.com/API/Account/xxxxx/Customer?load_relations=["Contact"] 

That error message that gets returned says "load_relations must be passed as a JSON encoded array." What am I missing? All the examples I can find in the group and help documentation don't show anything different.

Thanks for your help!

--
You received this message because you are subscribed to the Google Groups "MerchantOS API Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to merchantos-api-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Peter Henry

unread,
Apr 16, 2013, 2:23:16 PM4/16/13
to merchantos-a...@googlegroups.com
It would probably save a lot of questions in the future if the api/search help page explicitly stated that square braces (and quote mark) are actually used in load_relations, unlike the convention everywhere else in the API help where they are used to set off optional words and clauses, or to list the alternative values.

On the topic of the api/search help page, I think your example of the 'or' and 'like' ~ operator has a typo, it says
    or=description%3D,~foo|description%3D,~bar
but I think you might have meant
    or=description%3D~,foo|description%3D~,bar



On 4/16/2013 1:55 PM, ty...@bebikes.com wrote:

Nathan Horter

unread,
Apr 16, 2013, 2:55:04 PM4/16/13
to merchantos-a...@googlegroups.com
Peter,

I'll look at the documentation and see if I can get that fixed.

Tyson,

I'm having trouble duplicating the error with the curl requests you included. Is it possible that your quotes need escaping?

ty...@bebikes.com

unread,
Apr 16, 2013, 11:42:46 PM4/16/13
to merchantos-a...@googlegroups.com
Escaping the quotes worked. Thank you! For anyone else that finds this in the future I should note that the -g option turned off globbing which allowed the square brackets to be passed in the url. Also for future reference this is the code that worked:

curl -g -u apikey:apikey -G https://api.merchantos.com/API/Account/xxxxx/Customer?load_relations=[\"Contact\"]

Trying to load more than one relation did not help, but does work when escaping those quotes as well.

Thanks again for your help!
To unsubscribe from this group and stop receiving emails from it, send an email to merchantos-api-developers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
You received this message because you are subscribed to the Google Groups "MerchantOS API Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to merchantos-api-developers+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages