Forums / Developer / Import datas from an external site

Import datas from an external site

Author Message

laurent le cadet

Tuesday 27 March 2007 6:31:42 am

Hi,

I need to deal with another site which will send me xml.

Here is the story :

Authentification:
distantsite.net/.com/?action=auth&cid=CID&pass=PASS
return: KO or session_id (ex: 5b9eb0befe9b646bde790605e58f9fb4)

From here I have to store the session ID on my eZ site to send it each time I ask for other service from the distant site.

Offers:
distantsite.net/.com/?action=list_offers&session=5b9eb0befe9b646bde790605e58f9fb4
return: 0411111111;0611111111

Detailed bill:
distantsite.net/.com/?action=is_bill_detailed&session=5b9eb0befe9b646bde790605e58f9fb4
return : Y ou N

Bill listing:
distantsite.net/.com/?action=list_billing_out&session=5b9eb0befe9b646bde790605e58f9fb4
return : (1 line per bill)
2006-12-02;19910000;33.7;Y
(emission, n°, total include VAT, closed (Y ou N))

Listing payement:
distantsite.net/.com/?action=list_billing_in&session=5b9eb0befe9b646bde790605e58f9fb4
return : (1 line per payement)
2006-12-02;33.7;chèque n°12345567
(date, price include VAT, reference)

Bill export:
distantsite.net/.com/?action=dump_bill&bid=19910000&type=raw&session=5b9eb0befe9b646bde790605e58f9fb4
return : flux xls or pdf with the bill. bid = bill number.
type=raw (export xls brut), or pdf.

Nothing more ;)

Any chance to perform this with eZ, keep the session alive and print out the datas correctly ?

Any help will be greatly appreciated

Laurent

Ps : I never done that before :((

Kristof Coomans

Wednesday 28 March 2007 10:38:15 am

You can use curl [http://www.php.net/manual/en/ref.curl.php] for that.

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org