Click and Travel API Documentation

1. API URL:

The API URL for accessing stays information is:
https://click-and-travel.com/api/getStays.php

2. Authentication:

To authenticate with the Click and Travel API, you need to use Basic Authentication. Include the usual login email and password in the Authorization header.

Here is an example using cURL:

curl -X GET -H "Authorization: Basic [BASE64_ENCODED_CREDENTIALS]" https://click-and-travel.com/api/getStays.php

3. Example Request:

curl -X GET -H "Authorization: Basic [BASE64_ENCODED_CREDENTIALS]" https://click-and-travel.com/api/getStays.php

4. Expected Response:

{
    "result": [
        {
            "type": "OMRA",
            "libelle": "Omra Confort PARIS",
            // ... Other properties ...
        },
        {
            "type": "SEJOURS",
            "libelle": "Circuit Jordan: Discovering Islam",
            // ... Other properties ...
        },
        // ... Other results ...
    ]
}

5. Result Properties:

6. Example Code (PHP):

<?php

// Replace [BASE64_ENCODED_CREDENTIALS] with Base64-encoded authentication information.

$url = "https://click-and-travel.com/api/getStays.php";
$credentials = "[BASE64_ENCODED_CREDENTIALS]";

$options = [
    "http" => [
        "header" => "Authorization: Basic $credentials",
        "method" => "GET",
    ],
];

$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);

if ($result === FALSE) {
    // Error handling
} else {
    // Processing JSON result
    $decodedResult = json_decode($result, true);
    // ... do something with the data ...
}
?>