The Lead Commerce 301 Redirect API is part of the Pages API. The Pages API 301 Redirect allows for creating new entries only. There is no view, edit or delete on this API extension. Unlike creating them in the backoffice, if a duplicate exists, the API will skip over that entry.
Data Points
Key | Data Type | Required | Example | Notes |
---|---|---|---|---|
old |
string |
Yes |
/myoldpage.php?page=3&view=8 |
The URL of the old page to redirect |
new |
string |
No |
/my/newpage.html |
If left blank, it will redirect to the homepage. |
Example:
header("Content-type: text/xml;"); $insert = array('old' => '/myoldpage.php?page=3&view=8', 'new' => '/my/newpage.html'), array('old' => '/redirect/old/page.html'), ); $credentials = array('identifier' => 'LC350000000', 'key' => 'dynKSr4I7y2K3RrPRsFYFJr03IXUbv', 'inserts' => array($insert)); $curl = curl_init(); curl_setopt($curl,CURLOPT_POSTFIELDS, http_build_query($credentials)); curl_setopt($curl,CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_URL, 'http://leadcommercestore.web/api/v/Pages/redirect.xml'); curl_exec($curl); curl_close($curl);
If you are using a csv to import a mass amount of CSV's, we have included a sample php script to import your csv. Click Here