Documentation
Cette documentation explique comment enregistrer, configurer et développer votre application afin que vous puissiez utiliser nos API avec succès.
Authentication
All API requests require authentication using an access token. You can obtain an access token by registering your application.
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json
Base URL
All API endpoints are relative to:
https://hi24.co.uk/api/v1
Rate Limiting
API requests are limited to 1000 requests per hour per access token.
Créer une application
Pour que votre application puisse accéder à nos API, vous devez enregistrer votre application à l’aide du bouton Tableau de bord de l’application. L’inscription crée un ID d’application qui nous permet de savoir qui vous êtes, nous aide à distinguer votre application des autres applications.
OAuth Login
Starting the OAuth login process, use a link like this:
<a href="https://hi24.co.uk/api/oauth?app_id=YOUR_APP_ID">Log in With Hi24</a>
Once the user accepted your app, they will be redirected to your App Redirect URL with auth_key:
https://mydomain.com/my_redirect_url.php?auth_key=AUTH_KEY
Jeton d’accès
To get an access token, make an HTTP POST request to the authorize endpoint:
<?php
$app_id = "YOUR_APP_ID";
$app_secret = "YOUR_APP_SECRET";
$auth_key = $_GET['auth_key'];
$postData = ['app_id' => $app_id, 'app_secret' => $app_secret, 'auth_key' => $auth_key];
$ch = curl_init('https://hi24.co.uk/api/authorize');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData));
$response = curl_exec($ch);
curl_close($ch);
$json = json_decode($response, true);
if (!empty($json['access_token'])) {
$access_token = $json['access_token'];
}
?>
User Endpoints
Get Current User — Retrieve information about the authenticated user:
GET /user/me
Response:
{
"user_id": "",
"user_name": "",
"user_email": "",
"user_firstname": "",
"user_lastname": "",
"user_gender": "",
"user_birthdate": "",
"user_picture": "",
"user_cover": "",
"user_verified": ""
}
You can retrieve user info like this:
$get = file_get_contents("https://hi24.co.uk/api/get_user_info?access_token=$access_token");