PHP Classes

accessing Cleartrip flight webservices

Recommend this page to a friend!

      REST Client  >  All threads  >  accessing Cleartrip flight webservices  >  (Un) Subscribe thread alerts  
Subject:accessing Cleartrip flight webservices
Summary:Error When creating itinerary
Messages:3
Author:shrishail
Date:2011-07-06 05:34:39
Update:2013-01-30 10:31:17
 

  1. accessing Cleartrip flight webservices   Reply   Report abuse  
Picture of shrishail shrishail - 2011-07-06 05:34:39
Hi,
Very helpful Class RestClient.Class.php......!
I am using RestClient.Class.php for consuming cleartrip.com restful webservices.

I have done searching for flight service correctly.Now I am trying to get next service i.e creat itinerary. But I am getting error message "Not authorized to access the service".

Here is the link for cleartrip api doc.
http://www.cleartrip.com/api

and the code is

<?php
include 'webservices/RestClient.class.php';
include "webservices/xmltoassoc.php";

$arrinput=array ( "itinerary" => array ( "cabin-type" => E,
"flights" => array ( "flight-spec" => array (
0 => array ( "fare-key" => 'supp_INDIGO|si-1d226b84-15dc-465e-815e-5948db6024b4|fk_6E_182_1309880400000_K1BOMDEL_true__fpr_9027',"segments" => array ( "segment-spec" => array ( "departure-airport" => 'BOM', "arrival-airport" => 'DEL' ,"flight-number" => 182, "airline" => '6E' ,"operating-airline" => '6E' ,"departure-date" => '2011-07-05' ) ) ),
1 => array ( "fare-key" => 'supp_INDIGO|si-1d226b84-15dc-465e-815e-5948db6024b4|fk_6E_212_1309926600000_K1BOMDEL_true__fpr_7523' ,"segments" => array ( "segment-spec" => array ( "departure-airport" => 'DEL', "arrival-airport" => 'BOM' ,"flight-number" => 212, "airline" => '6E' ,"operating-airline" => '6E' ,"departure-date" => '2011-07-06' ) ) ) ) ),
"pax-info-list" => array ( "pax-info" => array ( 0 => array ( "title" => 'Mr' ,"first-name" => 'Nikhil',"last-name" => 'Prabhakar' ,"type" => 'ADT' ),1 => array ( "title" => 'Mstr' ,"first-name" => 'Chaitanya' ,"last-name" => 'Gupta' ,"type" => 'CHD' ,"date-of-birth" => '2007-05-05' ) ) ),
"contact-detail" => array ( "title" => 'Mr' ,"first-name" => 'Nikhil' ,"last-name" => 'Prabhakar' ,"email" => 'noreply.test@cleartrip.com', "address" => 'Lower Parel, Mumbai', "mobile" => 919810000000 ,"landline" => 912240554225 ,"city-name" => 'Mumbai' ,"state-name" => 'Maharashtra' ,"country-name" => 'India' ,"pin-code" => 400011 ),
"payment-detail" => array ( "payment-type" =>'CC' ,"card-detail" => array ( "card-number" => 999999999,"card-expiry-date" => '2025-01',"card-cvv" => 733 ,"card-type" => 'AMEX' ,"card-holder-name" => 'Don Juan' ,"billing-address" => array ( "first-name" => 'Cleartrip' ,"last-name" => 'Travels' ,"address" => 'Lower Parel' ,"city-name" => 'Mumbai' ,"state-name" => 'Maharashtra' ,"country-name" => 'india' ,"pin-code" => 400005 ) ) ) ),
"itinerary_attr" => array ( "xmlns" => 'http://api.staging.cleartrip.com/air/' ) );
$restclient = RestClient::post("http://api.staging.cleartrip.com/air/1.0/itinerary/create",$arrinput);
$response=$restclient->getResponse();

$reader = new XMLReader();
$reader->XML($response);
$content = xml2array($response);
print_r($content);
?>

Please suggest me, how to solve this problem.

Thanks and regards,
Shrishail

  2. Re: accessing Cleartrip flight webservices   Reply   Report abuse  
Picture of smiley smiley - 2012-11-11 20:38:24 - In reply to message 1 from shrishail
hi,
i am also getting the same error. if your problem solved then please tell me how it solved.if you could help me it will be great thankful.

Thanks,

  3. Re: accessing Cleartrip flight webservices   Reply   Report abuse  
Picture of Neel P Neel P - 2013-01-30 10:31:17 - In reply to message 2 from smiley
hello Shrishail,

do i know full php code to intigrate cleartrip api in my website. or can you pls let me know where can i find rest.class.php file