RizrvDoc

Did You Know?

ROLES

Welcome to Rizrv ! To get characters you need to make a GET call to the following url :

GET ALL ROLES WITH PERMISSION

GEThttps://apis.rizrv.in/api/roles

Parameter

Field Type

name

String

description

String

permissions

array

Use LARAVEL cURL

                                        
                                            $token = "USER_AUTH_TOKEN";
                                            $ch = curl_init();
                                            $header = array();
                                            $header[] = 'Content-length: 0';
                                            $header[] = 'Content-type: application/json';
                                            $header[] = 'Authorization: Bearer '. $token;
                                            curl_setopt($ch, CURLOPT_URL,"https://apis.rizrv.in/api/roles");
                                            curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
                                            curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
                                            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                            $server_output = curl_exec($ch);
                                            curl_close($ch);
                                            $response = json_decode($server_output, true);
                                            if ($response) { ... } else { ... }
                                        
                                    
{
    "status": 200,
    "message": "Success",
    "roles": [
        {
            "id": 2,
            "name": "User",
            "slug": "user",
            "description": null,
            "created_at": "2023-08-03T12:13:30.000000Z",
            "updated_at": "2023-08-10T06:37:02.000000Z",
            "deleted_at": null,
            "permission_role": [
                {
                    "id": 84,
                    "permission_id": 19,
                    "role_id": 2,
                    "created_at": "2023-08-11T09:05:18.000000Z",
                    "updated_at": "2023-08-11T09:05:18.000000Z",
                    "deleted_at": null,
                    "permission": {
                        "id": 19,
                        "name": "add",
                        "slug": "add-franchises",
                        "description": null,
                        "model": "Franchises",
                        "created_at": "2023-08-11T07:59:12.000000Z",
                        "updated_at": "2023-08-11T07:59:12.000000Z",
                        "deleted_at": null
                    }
                },
            ]
        },
    ]
}
                                     

Welcome to Rizrv ! To get Single role data you need to make a GET call to the following url ::

GET SINGLES ROLES WITH PERMISSION

POSThttps://apis.rizrv.in/api/roles/show/ROLE_ID

Use LARAVEL cURL

                                        
                                            $token = "USER_AUTH_TOKEN";
                                            $ch = curl_init();
                                            $header = array();
                                            $header[] = 'Content-length: 0';
                                            $header[] = 'Content-type: application/json';
                                            $header[] = 'Authorization: Bearer '. $token;
                                            curl_setopt($ch, CURLOPT_URL,"https://apis.rizrv.in/api/roles/show/ROLE_ID");
                                            curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
                                            curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
                                            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                            $server_output = curl_exec($ch);
                                            curl_close($ch);
                                            $response = json_decode($server_output, true);
                                            if ($response) { ... } else { ... }
                                        
                                    
{
    "status": 200,
    "message": "Success",
    "roles": [
        {
            "id": 1,
            "name": "Admin",
            "slug": "admin",
            "description": "this is the role for admin",
            "created_at": "2023-08-07T09:46:25.000000Z",
            "updated_at": "2023-08-07T09:46:25.000000Z",
            "deleted_at": null,
            "permission_role": [
                {
                    "id": 1,
                    "permission_id": 20,
                    "role_id": 32,
                    "created_at": "2023-08-07T09:46:25.000000Z",
                    "updated_at": "2023-08-07T09:46:25.000000Z",
                    "deleted_at": null,
                    "permission": {
                        "id": 20,
                        "name": "list",
                        "slug": "list-rolepremission",
                        "description": "new permission",
                        "model": "RolePremission",
                        "created_at": "2023-08-07T09:41:14.000000Z",
                        "updated_at": "2023-08-07T09:41:14.000000Z",
                        "deleted_at": null
                    }
                },
                {
                    "id": 2,
                    "permission_id": 19,
                    "role_id": 32,
                    "created_at": "2023-08-07T09:46:25.000000Z",
                    "updated_at": "2023-08-07T09:46:25.000000Z",
                    "deleted_at": null,
                    "permission": {
                        "id": 19,
                        "name": "add",
                        "slug": "add-staff",
                        "description": "dem",
                        "model": "Staff",
                        "created_at": "2023-08-07T09:14:56.000000Z",
                        "updated_at": "2023-08-07T09:14:56.000000Z",
                        "deleted_at": null
                    }
                }
            ]
        }
    ]
}
                                     

Welcome to Rizrv ! To add new roles call to the following url :

ROLES DATE STORE

POSThttps://apis.rizrv.in/api/roles/store

Use LARAVEL cURL

                                        
                                            $token = "USER_AUTH_TOKEN";
                                            $ch = curl_init();
                                            $header = array();
                                            $header[] = 'Content-length: 0';
                                            $header[] = 'Content-type: application/json';
                                            $header[] = 'Authorization: Bearer '. $token;
                                            curl_setopt($ch, CURLOPT_URL,"https://apis.rizrv.in/api/roles/show/ROLE_ID");
                                            curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
                                            curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
                                            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                            $server_output = curl_exec($ch);
                                            curl_close($ch);
                                            $response = json_decode($server_output, true);
                                            if ($response) { ... } else { ... }
                                        
                                    
{
    "status": 200,
    "message": "Success",
    "role": {
        "name": "user123",
        "slug": "user123",
        "description": "welcomesf",
        "updated_at": "2023-08-17T10:23:28.000000Z",
        "created_at": "2023-08-17T10:23:28.000000Z",
        "id": 8
    }
}
                                     

Welcome to Rizrv ! To update role call to the following url using POST Method:

ROLES UPDATE

POSThttps://apis.rizrv.in/api/roles/update/ROLE_ID

Use LARAVEL cURL

                                
                                    $token = "USER_AUTH_TOKEN";
                                    $ch = curl_init();
                                    $header = array();
                                    $header[] = 'Content-length: 0';
                                    $header[] = 'Content-type: application/json';
                                    $header[] = 'Authorization: Bearer '. $token;
                                    curl_setopt($ch, CURLOPT_URL,"https://apis.rizrv.in/api/roles/update/ROLE_ID");
                                    curl_setopt($ch, CURLOPT_POST, 1);
                                    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
                                    curl_setopt($ch, CURLOPT_POSTFIELDS,"name=role_name&description=description&permissions=permissions");
                                    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                    $server_output = curl_exec($ch);
                                    curl_close($ch);
                                    $response = json_decode($server_output, true);
                                    if ($response) { ... } else { ... }
                                
                            
{
    "status": 200,
    "message": "Success",
    "role": {
        "name": "user123",
        "slug": "user123",
        "description": "welcomesf",
        "updated_at": "2023-08-17T10:23:28.000000Z",
        "created_at": "2023-08-17T10:23:28.000000Z",
        "id": 8
    }
}
                                     

Welcome to Rizrv !To delete role call to the following url using DELETE Method:

ROLES DELETE

DELETEhttps://rizrv.in/api/roles/delete/ROLE_ID

Use LARAVEL cURL

                                
                                    $token = "USER_AUTH_TOKEN";
                                    $ch = curl_init();
                                    $header = array();
                                    $header[] = 'Content-length: 0';
                                    $header[] = 'Content-type: application/json';
                                    $header[] = 'Authorization: Bearer '. $token;
                                    curl_setopt($ch, CURLOPT_URL,"https://apis.rizrv.in/api/roles/delete/ROLE_ID");
                                    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
                                    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
                                    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                    $server_output = curl_exec($ch);
                                    curl_close($ch);
                                    $response = json_decode($server_output, true);
                                    if ($response) { ... } else { ... }
                                
                            
{
        "status": 200,
        "message": "Deleted"
    }