added more API documentation
This commit is contained in:
65
API/v1/portal-management/permissions/PUT Permission.md
Normal file
65
API/v1/portal-management/permissions/PUT Permission.md
Normal file
@@ -0,0 +1,65 @@
|
||||
# PUT Permission
|
||||
This PUT request updates permission data. This can only be done by the superuser
|
||||
|
||||
#### Location
|
||||
```
|
||||
/api/v1/portal-management/permissions/
|
||||
```
|
||||
|
||||
#### Permissions required
|
||||
Being `superuser`.
|
||||
|
||||
#### Body parameters
|
||||
| Parameter | Type | Required | Description |
|
||||
| ---------------------- | ------ | -------- | ------------------------------------------- |
|
||||
| permission_name | string | yes | The name of the permission. |
|
||||
| permission_slugify | string | yes | The slugify version of the permission name. |
|
||||
| permission_description | string | yes | The description of the permission. |
|
||||
| module_uuid | uuid | yes | The `module_uuid` linked to the permission. |
|
||||
|
||||
### Example Body (json)
|
||||
```json
|
||||
{
|
||||
"permission_name": "admin-test",
|
||||
"permission_slugify": "admin-test",
|
||||
"permission_description": "test permission.",
|
||||
"module_uuid": "0f044275-1744-444c-9627-736310d7997e"
|
||||
}
|
||||
```
|
||||
|
||||
### Example Request
|
||||
```php
|
||||
$curl = curl_init();
|
||||
|
||||
curl_setopt_array($curl, [
|
||||
CURLOPT_URL => $baseUrl . '/api/v1/portal-management/modules/',
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => $json_payload,
|
||||
CURLOPT_HTTPHEADER => [
|
||||
'Authorization: Bearer ' . $token,
|
||||
'Content-Type: application/json',
|
||||
'X-HTTP-Method-Override: PUT'
|
||||
],
|
||||
]);
|
||||
|
||||
$response = curl_exec($curl);
|
||||
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
|
||||
if ($response === false) {
|
||||
echo curl_error($curl);
|
||||
}
|
||||
|
||||
curl_close($curl);
|
||||
```
|
||||
|
||||
### Example Response
|
||||
```json
|
||||
"Permission updated successfully."
|
||||
```
|
||||
|
||||
#### Known errors or issues.
|
||||
None are known at the time
|
||||
If you do encounter issues and get an http code in return, check the response codes on this page.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user