Discussion:
making google qpx api calls with CF
(too old to reply)
chris hendrix
2014-09-01 20:45:21 UTC
Permalink
can anyone help me figure out how to cfhttp with this api?

https://developers.google.com/qpx-express/
e***@wearerndtbl.com
2015-02-06 21:22:09 UTC
Permalink
Post by chris hendrix
can anyone help me figure out how to cfhttp with this api?
https://developers.google.com/qpx-express/
This will dump the results. The rest is up to you.

<cfset qpxFields = '{
"request": {
"slice": [
{
"origin": "MCO",
"destination": "JFK",
"date": "2015-02-13"
}
],
"passengers": {
"adultCount": 1,
"infantInLapCount": 0,
"infantInSeatCount": 0,
"childCount": 0,
"seniorCount": 0
},
"solutions": 20,
"refundable": false
}
}'>

<cfhttp url="https://www.googleapis.com/qpxExpress/v1/trips/search?key=AIzaSyD70yKSjx6qAjio3y6yTzn-i47X8u_EuBE" method="post" result="httpResp" timeout="60">
<cfhttpparam type="header" name="Content-Type" value="application/json" />
<cfhttpparam type="body" value="#serializeJSON(qpxFields)#">
</cfhttp>

<cfoutput>
#httpResp.FileContent#
</cfoutput>
e***@wearerndtbl.com
2015-02-06 21:27:05 UTC
Permalink
Post by chris hendrix
can anyone help me figure out how to cfhttp with this api?
https://developers.google.com/qpx-express/
<cfset qpxFields = '{
"request": {
"slice": [
{
"origin": "MCO",
"destination": "JFK",
"date": "2015-02-13"
}
],
"passengers": {
"adultCount": 1,
"infantInLapCount": 0,
"infantInSeatCount": 0,
"childCount": 0,
"seniorCount": 0
},
"solutions": 20,
"refundable": false
}
}'>

<cfhttp url="https://www.googleapis.com/qpxExpress/v1/trips/search?key=KEYHERE" method="post" result="httpResp" timeout="60">
<cfhttpparam type="header" name="Content-Type" value="application/json" />
<cfhttpparam type="body" value="#serializeJSON(qpxFields)#">
</cfhttp>

<cfoutput>
#qpxFields#
</cfoutput>

Loading...