php - onsite booking for expedia by rest api calling using curl post -


onsite booking process using rest api calling data booking process.but problem when set form url :-

$url = 'https://book.api.ean.com/ean-services/rs/hotel/v3/res? minorrev=99 &cid=55505 &sig=1893d9f7e3e9fbd3f8a36f43cd61287d &apikey=1bn8n4or4tjajq23fe4l6m18lp &customeruseragent=mozilla/5.0 (windows nt 6.1; wow64; rv:38.0) gecko/20100101 firefox/38.0 &customeripaddress=223.30.152.118 &customersessionid=e80df6de9008af772cfb48a389465415 &locale=en_us &currencycode=usd &hotelid=106347 &arrivaldate=10/30/2015 &departuredate=11/01/2015 &suppliertype=e &ratekey=469e1aff-49de-4944-a64d-25d96ccde3aa &roomtypecode=200127420 &ratecode=200706716 &chargeablerate=257.20 &room1=2,5,7 &room1firstname=test &room1lastname=testers &room1bedtypeid=23 &room1smokingpreference=ns &email=test@yoursite.com &firstname=tester &lastname=testing &homephone=2145370159 &workphone=2145370159 &creditcardtype=ca &creditcardnumber=5401999999999999 &creditcardidentifier=123 &creditcardexpirationmonth=11 &creditcardexpirationyear=2015 &address1=travelnow &city=bellevue &stateprovincecode=wa &countrycode=us &postalcode=98004'; 

and when manually posted data response when using curl post url have posted previous face error. curl code :-

$header[] = "accept: application/json"; $header[] = "accept-encoding: gzip"; $header[] = "content-length: 0"; $ch = curl_init();  curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_customrequest, 'post'); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_ssl_verifyhost, false); curl_setopt($ch, curlopt_httpheader, $header); curl_setopt($ch, curlopt_encoding, "gzip"); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_returntransfer, true);  curl_setopt($ch, curlopt_verbose, true); $verbose = fopen('php://temp', 'rw+'); curl_setopt($ch, curlopt_stderr, $verbose);  $result = curl_exec($ch); 

after posting data response

{"hotelroomreservationresponse":{"eanwserror":{"itineraryid":-1,"handling":"unrecoverable","category":"exception","exceptionconditionid":-1,"presentationmessage":"travelnow.com cannot service request.","verbosemessage":"exception caught: null"},"customersessionid":"8ab1d482-f968-49d2-a429-a1cbab748fe5"}} 

so error repeatedly. please me how can find right data.

your problem here parsing parameters in url need given in body see thetop of page: http://developer.ean.com/docs/book-reservation/examples/rest-reservation/

not sure how in php can use -d on command line


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -