Spurtcommerce
DocumentAPI ReferenceAdd-ons
API Reference
API Reference
  • About Spurtcommerce APIs
  • Spurtcommerce
    • Admin API
      • Admin
        • Authentication
        • My Profile
        • Support
      • Buyers
        • Manage Buyer
      • Chat
      • CMS
        • Manage Banner
        • Manage Blogs
        • Manage Pages
        • Manage SEO
      • Dashboard
      • Marketing
        • Manage Cross Selling
          • Related Products
        • Manage Promotions
          • Coupon
      • Marketplace
        • Manage Products
        • Manage Sales
        • Manage Settlements
        • Product Configuration
        • Reports
      • Sellers
        • Seller
        • Seller Group
        • Seller KYC Request
      • Settings
        • Add-ons
        • Add-ons Product Attributes
        • Localization
        • Order Fulfilment Status
        • Personalise
        • Site Settings
        • Store Settings
        • System
        • User and Permission
        • Support-Category
    • Store API
      • Account Settings
        • Customer
        • My Order
        • My Quotation
        • My Wishlist
        • Profile
        • Support
      • Checkouts
      • Store
        • Admin Contact
        • Categories
        • Home
        • Product Detail Page
    • Vendor API
      • Page 1
      • Catalogue
        • Bulk Product Imports
          • Custom
          • Standard
        • Common Product
        • Data Export
        • Pricing
        • Product Localisation
        • Product List
        • Product Variants
        • Related Products
      • CRM
        • Customer
        • Customer Group
        • Question and Answer
        • Rating and Review
      • Dashboard
      • Marketing
      • Payments
        • Archeived Payments
        • Earnings
        • Settlements
      • Profile
        • Account Settings
          • My Business
          • My KYC
          • My Profile
          • My Shop
          • Personalised Setting
        • Chat
        • Vendor
        • Support
      • Reports
      • Sales
        • Archeive Orders
        • Back Orders
        • Failed Orders
        • Orders
        • Quotation Request
        • Stock Update
        • Variant Stock Update
      • Supplier
        • Contact
        • Supplier
Powered by GitBook
On this page
  1. Spurtcommerce
  2. Admin API
  3. Settings

User and Permission

PreviousSystemNextSupport-Category

Last updated 3 months ago

Get a complete list of permission modules

get

Retrieves a list of permission modules with pagination and filtering options.

Query parameters
limitintegerOptional

The number of permission modules to retrieve per request

offsetintegerOptional

The offset to retrieve the list from

keywordstringOptional

Search keyword to filter the permission modules

countbooleanOptional

Flag to include count in the response

statusstringOptional

Filter permission modules by status

Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Responses
200
Successfully retrieved the list of permission modules
get
GET /backend/api/permission-module/list HTTP/1.1
Host: 139.59.67.17
Authorization: text
Accept: */*
200

Successfully retrieved the list of permission modules

<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>Successfully got the complete list of pages</message>
</object>

Get permissions based on reference type and reference ID

get

Retrieves a list of permissions for a specific reference type and ID.

Query parameters
refTypeintegerRequired

The reference type (e.g., 1 for a specific object)

refIdintegerRequired

The reference ID to fetch permissions for

Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Responses
200
Successfully retrieved the permission list
get
GET /backend/api/permission-module/get-permission HTTP/1.1
Host: 139.59.67.17
Authorization: text
Accept: */*
200

Successfully retrieved the permission list

<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>Successfully got permission list</message>
</object>

Delete a role by ID

delete

Deletes the role identified by the provided role ID.

Path parameters
roleIdintegerRequired

ID of the role to delete

Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Responses
200
Successfully deleted the role
delete
DELETE /backend/api/role/delete-role/{roleId} HTTP/1.1
Host: 139.59.67.17
Authorization: text
Accept: */*
200

Successfully deleted the role

<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>Successfully deleted the role</message>
</object>

Get list of users

get

Retrieves a list of users based on the provided parameters like limit, offset, and status.

Query parameters
limitintegerOptional

Limit of users per request

Default: 10
offsetintegerOptional

Offset to start fetching the list

Default: 0
countbooleanOptional

Whether to count the total number of users

Default: false
statusstringOptional

Filter users based on their status

Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Responses
200
Successfully retrieved the user list
get
GET /backend/api/auth/userlist HTTP/1.1
Host: 139.59.67.17
Authorization: text
Accept: */*
200

Successfully retrieved the user list

<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>Successfully got all user list</message>
</object>

Delete a user

delete

Deletes an existing user by user ID.

Path parameters
userIdintegerRequired

ID of the user to be deleted

Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Responses
200
Successfully deleted the user
400
Bad Request - Invalid user ID
delete
DELETE /backend/api/auth/delete-user/{userId} HTTP/1.1
Host: 139.59.67.17
Authorization: text
Accept: */*
<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>User deleted successfully</message>
</object>
  • GETGet role list
  • POSTCreate a new role
  • PUTUpdate an existing role
  • GETGet a complete list of permission modules
  • GETGet permissions based on reference type and reference ID
  • POSTAdd permissions based on reference type and reference ID
  • DELETEDelete a role by ID
  • GETGet list of users
  • POSTCreate a new user
  • PUTUpdate a user
  • DELETEDelete a user

Get role list

get

Fetches a list of all roles with optional pagination and filtering.

Query parameters
limitintegerOptional

The number of results to return per page.

Default: 10
offsetintegerOptional

The number of records to skip before starting to return results.

Default: 0
countbooleanOptional

Indicates whether to count the total number of records available.

Default: false
Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Responses
200
Successfully fetched the role list
get
GET /backend/api/role/rolelist HTTP/1.1
Host: 139.59.67.17
Authorization: text
Accept: */*
200

Successfully fetched the role list

<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>Successfully get all role list</message>
</object>

Create a new role

post

Creates a new role with a name and status.

Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Body
namestringRequiredExample: test
statusbooleanRequiredExample: true
Responses
200
Successfully created a new role
400
Role already exists
post
POST /backend/api/role/create-role HTTP/1.1
Host: 139.59.67.17
Authorization: text
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 29

"name='test'&status=true"
<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>Successfully created a new role</message>
</object>

Update an existing role

put

Updates the role details (name and status) for a given roleId.

Path parameters
roleIdintegerRequired

ID of the role to update

Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Body
namestringRequiredExample: testtttt
statusintegerRequiredExample: 1
idintegerRequiredExample: 30
Responses
200
Role updated successfully
put
PUT /backend/api/role/update-role/{roleId} HTTP/1.1
Host: 139.59.67.17
Authorization: text
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 38

"name='testtttt'&status=1&id=30"
200

Role updated successfully

<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>Role updated successfully</message>
</object>

Add permissions based on reference type and reference ID

post

Adds a list of permissions for a specific reference type and ID.

Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Body
refTypeintegerRequiredExample: 1
permissionstring[]RequiredExample: ["list-order"]
refIdintegerRequiredExample: 30
Responses
200
Successfully updated the permissions
post
POST /backend/api/permission-module/add-permission HTTP/1.1
Host: 139.59.67.17
Authorization: text
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 52

"refType=1&permission=['list-order']&refId=30"
200

Successfully updated the permissions

<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>Successfully updated the permission</message>
</object>

Create a new user

post

Creates a new user in the system with the provided user details.

Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Body
firstNamestringRequired

The user's first name

lastNamestringRequired

The user's last name

emailstring · emailRequired

The user's email address

userGroupIdintegerRequired

The ID of the user's group

usernamestringRequired

The user's username

passwordstringRequired

The user's password

Responses
200
Successfully created the user
400
Bad Request - User already exists
post
POST /backend/api/auth/create-user HTTP/1.1
Host: 139.59.67.17
Authorization: text
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 115

"firstName='text'&lastName='text'&email='name@gmail.com'&userGroupId=1&username='text'&password='text'"
<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>User created successfully</message>
</object>

Update a user

put

Updates an existing user in the system with the provided user details.

Path parameters
userIdintegerRequired

ID of the user to be updated

Header parameters
AuthorizationstringRequired

Bearer token for authentication.

Body
firstNamestringRequired

The user's first name

lastNamestringRequired

The user's last name

emailstring · emailRequired

The user's email address

userGroupIdintegerRequired

The ID of the user's group

usernamestringRequired

The user's username

passwordstringRequired

The user's password (hashed)

idintegerRequired

The ID of the user being updated

Responses
200
Successfully updated the user
400
Bad Request - Invalid user data
put
PUT /backend/api/auth/update-user/{userId} HTTP/1.1
Host: 139.59.67.17
Authorization: text
Content-Type: application/x-www-form-urlencoded
Accept: */*
Content-Length: 122

"firstName='text'&lastName='text'&email='name@gmail.com'&userGroupId=1&username='text'&password='text'&id=1"
<?xml version="1.0"?>
<object>
	<status>1</status>
	<message>User updated successfully</message>
</object>