Naveed Khan
Naveed Khan

Reputation: 95

QPX Express query error

My request was being processed correctly, I tried to get custom result like:

https://www.googleapis.com/qpxExpress/v1/trips/search
?key=MY_API_KEY&fields=tri‌​ps(tripOption(saleTotal,slice(segment(leg(arrivalTime,departureTime,origin,destin‌​ation,originTerminal,duration,operatingDisclosure)))))

But it's producing the following error:

{ "error":
    { "errors":
        [ {
        "domain": "global",
        "reason": "invalidParameter",
        "message": "Invalid field selection trips(tripOption(saleTotal,slice(segment(leg(arrivalTime,departureTime,origin,destination,originTerminal,duration,operatingDisclosure)))))", "locationType": "parameter", "location": "fields" } ],
        "code": 400,
        "message": "Invalid field selection trips(tripOption(saleTotal,slice(segment(leg(arrivalTime,departureTime,origin,destination,originTerminal,duration,operatingDisclosure)))))"
    }
}
array(1) { [0]=> string(1) "1" }

Upvotes: 0

Views: 102

Answers (1)

David Ferenczy Rogožan
David Ferenczy Rogožan

Reputation: 25431

The value of the fields parameter contains some weird characters, namely \u200c, which is the Unicode Zero Width Non-Joiner.

You can see it in the message field of the response. Just remove those characters. It's possible that they're not visible in your editor, maybe try it rewrite while string manually.

Upvotes: 0

Related Questions