API request proxied through to BAAS - odd erroneous response

Not applicable

Hi All,

I am currently making a request to this URL:

http://[organisation-name].apigee.net/test

"test" is set-up as a target endpoint, like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TargetEndpoint name="test">
    <Description/>
    <FaultRules/>
    <Flows/>
    <HTTPTargetConnection>
        <Properties/>
        <URL>https://api.usergrid.com/[organisation-name]/testapp/campsites/?ql=SELECT uuid, ar_ref, name, display_name, descriptions, images, location, ordering ORDER BY ordering DESC</URL>
    </HTTPTargetConnection>
    <PreFlow name="PreFlow">
        <Request/>
        <Response/>
    </PreFlow>
    <PostFlow name="PostFlow">
        <Request/>
        <Response/>
    </PostFlow>
</TargetEndpoint>

The response I get is like this:

{
  "action" : "get",
  "application" : "[application-uuid]",
  "params" : { },
  "path" : "/tests",
  "uri" : "https://api.usergrid.com/[organisation-name]/testapp/tests",
  "entities" : [ ],
  "timestamp" : 1412862762404,
  "duration" : 9,
  "organization" : "[organisation-name]",
  "applicationName" : "testapp"
}

Note that the path returned says "/tests" and the uri also ends in "tests", where the request was only to "test".

Does anyone know why is this?

The real problem is that if I use the proxied URL directly (in the <URL> tag in the XML) I get expected results, when proxied, as shown above, I just get an empty entities array. I wondered if this seeming pluralisation effect goes any way to explain what is going on?

Many thanks,

-Rob

Solved Solved
0 1 214
1 ACCEPTED SOLUTION

Not applicable

I believe the problem is with your HTTPTargetConnection. If instead you use https://api.usergrid.com/[organisation-name]/testapp/campsites and then call your API with the query string attached (http://[organisation-name].apigee.net/test?ql=SELECT uuid, ar_ref, name, display_name, descriptions, images, location, ordering ORDER BY ordering DESC) it should work. I tried a similar API on some sample data here and it worked as expected.

View solution in original post

1 REPLY 1

Not applicable

I believe the problem is with your HTTPTargetConnection. If instead you use https://api.usergrid.com/[organisation-name]/testapp/campsites and then call your API with the query string attached (http://[organisation-name].apigee.net/test?ql=SELECT uuid, ar_ref, name, display_name, descriptions, images, location, ordering ORDER BY ordering DESC) it should work. I tried a similar API on some sample data here and it worked as expected.