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_live_YOUR_KEY
There is one key type — sk_live_ — created from /dashboard/keys. It acts on whatever channels your workspace has connected.
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