Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents
stylenone


1. Requirements

Definition of a Secret Key in the account settings in the MY-Area

A secret key must be used to authenticate the request to the API. You can generate this in your MY area by clicking on your Vendor Name → Account Settings → API → Secret Key → Generate.

...

In the HEAD of the request the secret key above must be supplied:

X-API-KEY=[ihr api key]

3. Example code

The following code shows an example of the call via Curl and PHP


Code Block
languagephp
titleBeispiel PHP + CURL request
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://secure.affilibank.de/demo-account-affilicon/getproducts',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'X-API-KEY: DEMO_API_KEY'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

...