Role Management Service API (1.0.0)

Perform CRUD actions for roles.

Initialize the roles of organization

Initialize the roles of organization

Responses

Response samples

Content type
application/json
{
  • "message": "Successfully initialize roles"
}

Return the list of roles within the targeted organ

Return the list of roles within the targeted organization

path Parameters
orgID
required
string

ID of the organization

Responses

Response samples

Content type
application/json
Example
{
  • "roles": [ ]
}

Create a role. * this API is only for SysAdmin fr

Create a role.

  • this API is only for SysAdmin from Versafleet. OrgID in URL determine the organization that the role belongs to.

  • root, sysadmin, admin, sys, system, FreelanceDriver and their upper case, lower case case variations are not allowed to be used.

  • versafleet, gotsurge and their upper case, lower case case variations are not allowed to be used in the name.

path Parameters
orgID
required
string

ID of the organization

Request Body schema: application/json
role_name
string
type
string

Responses

Request samples

Content type
application/json
{
  • "role_name": "My Role",
  • "type": "built-in"
}

Response samples

Content type
application/json
{
  • "message": "Successfully created a role"
}

Update the role name

This API is only for SysAdmin

Role name can be updated to :

  • OrgAdmin : For merchant
  • OrgTransporter : For Transporter
path Parameters
orgID
required
string

ID of the organization

Request Body schema: application/json
role_name
string
Enum: "OrgAdmin" "OrgTransporter"

Responses

Request samples

Content type
application/json
{
  • "role_name": "OrgAdmin"
}

Response samples

Content type
application/json
{
  • "message": "Successfully updated a role"
}

Assign role to user for SysAdmin. * If the user d

Assign role to user for SysAdmin.

  • If the user does not belong to an organization, only the role of FreelanceDriver can be assigned to the user
path Parameters
userID
required
string

ID of the user

roleID
required
string

ID of the role

Responses

Response samples

Content type
application/json
{
  • "message": "Successfully assign role to user"
}

Assign role to user for OrgAdmin and OrgTransporte

Assign role to user for OrgAdmin and OrgTransporter.

  • targeted user must be in the same organization
path Parameters
userID
required
string

ID of the user

roleID
required
string

ID of the role

Responses

Response samples

Content type
application/json
{
  • "message": "Successfully assign role to user"
}

Assign 'Freelance Driver' role to user

Assign 'Freelance Driver' role to user

Responses

Response samples

Content type
application/json
{
  • "message": "Successfully assign freelance driver role to user"
}

For now, this API return the roles that a user has

For now, this API return the roles that a user has.

In the future, this API will return claims instead of role.

  • This API can only be called by the user himself/herself for login purpose
path Parameters
userID
required
string

ID of the user

Responses

Response samples

Content type
application/json
Example
{
  • "roles": [ ]
}

For now, this API return the roles that a user has

For now, this API return the roles that a user has.

In the future, this API will return claims instead of role.

  • This API is designed for SysAdmin to get the targeted user roles
path Parameters
userID
required
string

ID of the user

Responses

Response samples

Content type
application/json
Example
{
  • "roles": [ ]
}

Return the list of roles within current user orgID

Return the list of roles within current user orgID

Can be accessed by OrgAdmin and OrgTransporter

Responses

Response samples

Content type
application/json
Example
{
  • "roles": [ ]
}

Return the list of roles within the organization g

Return the list of roles within the organization given list

Request Body schema: application/json
org_ids
Array of strings

Responses

Request samples

Content type
application/json
{
  • "org_ids": [
    ]
}

Response samples

Content type
application/json
Example
{
  • "roles": [ ]
}

Assign role to user for OrgAdmin and OrgTransporte

Assign role to user for OrgAdmin and OrgTransporter.

  • the organization is the associated organization from platform partners
  • targeted user must be in the same organization
path Parameters
userID
required
string

ID of the user

roleID
required
string

ID of the role

Responses

Response samples

Content type
application/json
{
  • "message": "Successfully assign role to user"
}

Initialize the roles of organization that same wit

Initialize the roles of organization that same with its platform partners

Responses

Response samples

Content type
application/json
{
  • "message": "Successfully initialize roles"
}

Return the list of roles within the targeted organ

Return the list of roles within the targeted organization managed by platform partners

path Parameters
orgID
required
string

ID of the organization

Responses

Response samples

Content type
application/json
Example
{
  • "roles": [ ]
}