PHP
Use the Repull API from PHP with cURL.
1
Prerequisites
PHP 8.1+ and Composer installed on your machine.
You also need a Repull API key. Get one from your dashboard.
2
Install
composer require repull/sdk
3
Set up environment variables
Add your credentials to a .env file in your project root:
REPULL_API_KEY=sk_test_YOUR_KEY REPULL_WORKSPACE_ID=YOUR_WORKSPACE_ID
Start with sk_test_ keys for sandbox data. Switch to sk_live_ when you are ready for production.
4
Make your first API call
Set up the SDK with your API key, then call any endpoint. The example below lists properties and fetches reservations.
<?php
$ch = curl_init('https://api.repull.dev/v1/properties');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer ' . getenv('REPULL_API_KEY'),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$properties = json_decode($response, true);
echo "Found " . count($properties['data']) . " properties\n";
curl_close($ch);5
Next steps
You are all set. Explore the rest of the platform:
AI