This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| 2021:rd_api_permanent_users [2021/10/01 16:35] – [Adding A New Permanent User] admin | 2021:rd_api_permanent_users [2021/10/03 07:00] (current) – [Activate & Expire] admin | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| * **realm_id** Each Permanent User has to belong to a Realm. A Realm is like a group but used by RADIUS. | * **realm_id** Each Permanent User has to belong to a Realm. A Realm is like a group but used by RADIUS. | ||
| * **profile_id** Each Permanent User have to a Profile. A Profile can be used by RADIUS to dictate the service (bandwidth, amount of data available etc) a Permanent User will get when connecting to the Internet. | * **profile_id** Each Permanent User have to a Profile. A Profile can be used by RADIUS to dictate the service (bandwidth, amount of data available etc) a Permanent User will get when connecting to the Internet. | ||
| - | * So to recap. A Permanent User has to have: | + | * So to recap, **BEFORE** you can create a Permanent User **MAKE SURE** you have the following items since they are compulsory: |
| * An Owner | * An Owner | ||
| * A Realm | * A Realm | ||
| Line 37: | Line 37: | ||
| | realm_id | | realm_id | ||
| | profile_id | | profile_id | ||
| - | | token | b4c6ac81-8c7c-4802-b50a-0a6380555b50 | + | | token | b4c6ac81-8c7c-4802-b50a-0a6380555b50 |
| + | ==== Finding the detail of the items ==== | ||
| + | === API Key === | ||
| + | * Each Access Provider (including the **root** user) in RADIUSdesk has a unique security token associated with them referred to as the API Key. This token changes each time the Access Provider password is changed. | ||
| + | * An Access Provider can see their own API Key. | ||
| + | * Log into RADIUSdesk | ||
| + | * At the top right, click the menu button and select **Settings**. | ||
| + | {{: | ||
| + | * An Access Provider can see any of the Access Providers under it by going to the Access Providers applet and edit a selected Access Provider. There will be a read-only field with the API Key for the selected Access Provider. | ||
| + | {{: | ||
| + | === Realm === | ||
| + | * The list of Realms are shown by calling this URL (Be sure to replace the token with your API Key) | ||
| + | * http:// | ||
| + | * If there are a large amount of Realms on the system you may have to add pager items to the URL but this beyond the scope of this document. | ||
| + | * Here is a sample reply | ||
| + | <code javascript> | ||
| + | { | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | } | ||
| + | * We can either use **realm_id = 1** or **realm = demo1** when calling the API. The back-end is smart enough to convert the Realm name to to the Realm ID when adding the user. | ||
| + | </ | ||
| + | === Profile === | ||
| + | * The list of Profiles are shown by calling this URL (Be sure to replace the token with your API Key) | ||
| + | * http:// | ||
| + | * If there are a large amount of Profiles on the system you may have to add pager items to the URL but this beyond the scope of this document. | ||
| + | * Here is a sample reply | ||
| + | <code javascript> | ||
| + | { | ||
| + | " | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | ], | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | * We can either use **profile_id = 1** or **profile = demo1** when calling the API. The back-end is smart enough to convert the Profile name to to the Profile ID when adding the user. | ||
| + | |||
| + | ==== Alternative items to include in the POST ==== | ||
| + | * The following is the **minimum** items (as an alternative based on the info above) than needs to be included in the POST request. | ||
| + | <code javascript> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ==== Reply from the server to the POST ==== | ||
| + | * If the request was successful the server will reply with the following | ||
| + | <code javascript> | ||
| + | { | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | " | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Adding a suffix to the username ===== | ||
| + | * You might have noticed that we specified the username as **demo2** but the name that was created has a **@demo1** added. | ||
| + | * This is because of a setting we specified in the Realm we used. | ||
| + | * See the following screenshot | ||
| + | {{: | ||
| + | * Go ahead and remove the check for Permanent Users, save it and run the API call again. | ||
| + | * The **@demo** should now be missing in the username. | ||
| + | |||
| + | ===== Items allowed in the API ===== | ||
| + | * This section will list all the additional items that can be contained in the API call when adding a Permanent User. | ||
| + | * The only compulsory ones are those discussed earlier in the document. | ||
| + | |||
| + | ==== Personal Info ==== | ||
| + | |||
| + | ^ Item ^ Typical Value ^ Comment | ||
| + | | name |John |varchar(50) | ||
| + | | surname | ||
| + | | phone |+27-724952041 | ||
| + | | language | ||
| + | | email | john@radiusdesk.com | ||
| + | | address | ||
| + | |||
| + | ==== Activate & Expire ==== | ||
| + | ^ Item ^ Typical Value ^ Comment | ||
| + | | from_date | ||
| + | | to_date | ||
| + | |||
| + | * If these items are not specified, the account will be always active. | ||
| + | |||
| + | ==== Optional Items ==== | ||
| + | ^ Item ^ Typical Value ^ Comment | ||
| + | | static_ip | ||
| + | | extra_name | ||
| + | | extra_value | ||