Developer Forum [ All Topics | New Topic ]

Thread: How to integrate Rapnet with php

Hi all , I wants to integrate Rapnet with my php site. How can i do so? Thanks in Advance

>> add a comment
11/12/2009 01:06

4 Replies:

Assuming you have the PHP Curl library installed. Trying to post PHP code here results in an error. Rapaport Technet forums seem to suck a bit.

>> add a comment
12/12/2009 3:03:00 PM
Hi, Thank you for you feed back. We changed our forums to except tags , so now you can enter code that requires them such as PHP. Eli Sack Rapaport IT Team

>> add a comment
Eli Sack
12/24/2009 5:04:00 AM
Can Anyone Help Me, I've Used The PHP Code To Download The Price List But The CSV File Remains Empty.

//1 - Authenticate with TechNet. The authentication ticket will be stored in $auth_ticket. Note this MUST be HTTPS.
$auth_url = "";
$post_string = "username=xx&password=" . urlencode("xx");

//create HTTP POST request with curl:
$request = curl_init($auth_url); // initiate curl object
curl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($request, CURLOPT_RETURNTRANSFER, 1); // Returns response data instead of TRUE(1)
curl_setopt($request, CURLOPT_POSTFIELDS, $post_string); // use HTTP POST to send form data
curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE); // uncomment this line if you get no gateway response.
$auth_ticket = curl_exec($request); // execute curl post and store results in $auth_ticket
curl_close ($request);

//2 - prepare HTTP request for data. Copy the URL from the RapLink Feed page in 
// go to:, choose your parameters, and click
// generate code. Make sure to specify the columns wanted. This can produce a very long URL.

$feed_url = "
$feed_url .= "&ticket=".$auth_ticket; //add authentication ticket:

//prepare to save response as file.
$fp = fopen('rapnetfeed1.csv', 'wb');
if ($fp == FALSE)
echo "File not opened";

//create HTTP GET request with curl 
$request = curl_init($feed_url); // initiate curl object
curl_setopt($request, CURLOPT_FILE, $fp); //Ask cURL to write the contents to a file
curl_setopt($request, CURLOPT_HEADER, 0); // set to 0 to eliminate header info from response
curl_setopt($request, CURLOPT_TIMEOUT, 300); //set timeout to 5 mins
curl_exec($request); // execute curl post
// additional options may be required depending upon your server configuration
// you can find documentation on curl options at
curl_close ($request); // close curl object 
fclose($fp); //close file;

//Special thanks to David Meyers for helping me to create the sample file. \\ :-) // 

 Thank You In Advance

>> add a comment
Chris S
3/17/2010 12:02:00 AM
Do you get an authentication ticket back?

>> add a comment
Eli Sack
3/18/2010 2:51:00 AM