Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
technical:api-profiles [2025/04/02 10:41] – system | technical:api-profiles [2025/04/02 12:51] (current) – system | ||
---|---|---|---|
Line 9: | Line 9: | ||
* Each **Permanent User**, **Voucher** or **BYOD Device** has to belong to a **Profile** and **Realm** in order to be useful to RADIUS. | * Each **Permanent User**, **Voucher** or **BYOD Device** has to belong to a **Profile** and **Realm** in order to be useful to RADIUS. | ||
* Before we can bulk import Permanent Users using a CSV file, we need to ensure that all the profiles used by the users in the CSV file already exist. | * Before we can bulk import Permanent Users using a CSV file, we need to ensure that all the profiles used by the users in the CSV file already exist. | ||
- | * In this page we will show you how to read the profile names from a text file and then add each one using an API call. | + | * In this page we will show you how to read profile names from a text file and then add each one to RADIUSdesk |
* We will use PHP but the principles can be applied using any programming language. | * We will use PHP but the principles can be applied using any programming language. | ||
Line 39: | Line 39: | ||
$api_url = ' | $api_url = ' | ||
$names_file = ' | $names_file = ' | ||
- | $token = 'fe707fcd-6316-4c26-b14c-03ae7fc49065'; // replace with your token (If you want to add the profile as system wide, you will need root's token) | + | $token = '617088c3-f908-4f1f-8091-82223c571cc67'; // replace with your token (If you want to add the profile as system wide, you will need root's token) |
- | $cloud_id = 23; // replace with the Cloud ID that you want to work on. | + | $cloud_id = 56; // replace with the Cloud ID that you want to work on. |
// Read names from file | // Read names from file | ||
Line 47: | Line 47: | ||
// Set API payload | // Set API payload | ||
$payload = [ | $payload = [ | ||
- | | + | // |
" | " | ||
" | " | ||
Line 80: | Line 80: | ||
?> | ?> | ||
</ | </ | ||
+ | * There are a few items which will be unique to your specific deployment. | ||
+ | * It is | ||
+ | * The Token. | ||
+ | * The Cloud ID. | ||
+ | * The server' | ||
+ | * The Token can be found when you edit an Admin. | ||
+ | <panel type=" | ||
+ | {{: | ||
+ | </ | ||
+ | * The Cloud ID is listed under the Cloud Applet. | ||
+ | <panel type=" | ||
+ | {{: | ||
+ | </ | ||
+ | * Below is the result of our script: | ||
+ | <panel type=" | ||
+ | {{: | ||
+ | </ | ||