API
When building an API, you may need a transformation layer that sits between your Eloquent models and the JSON responses that are actually returned to your application's users. For example, you may wish to display certain attributes for a subset of users and not others, or you may wish to always include certain relationships in the JSON representation of your models. Eloquent's resource classes allow you to expressively and easily transform your models and model collections into JSON.
Of course, you may always convert Eloquent models or collections to JSON using their toJson methods; however, Eloquent resources provide more granular and robust control over the JSON serialization of your models and their relationships.
Sign In
To get authorization token you need to sign in
first. After the successful sign in
,
an api_token
in the response will be there which you can use as authorization token.
For sign in
follow below link :
POST <public-url>/api/signin
Request samples
let params = {
email:"",
password:"",
}
Response samples
{
"success": true,
"data": {
"item": {
.............
.............
"api_token": "3EsIxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxdyN9",
}
}
}
Sign Up
If you don't have an account by using sign up you can create account
For sign up
follow below link :
POST <public-url>/api/signup
Request samples
let params = {
first_name:"",
email:"",
password:"",
password_confirmation:"",
is_active:"",
status:"",
username:"",
}
Response samples
{
"success": true,
"data": {
"item": {
.............
.............
}
},
"messages": [
"Saved successfully"
]
}
Authentication
NOTE
VaahCms supports API authentication.
This allows you to protect the URLs on your web server so that only you can access them.
In order to authenticate with HTTP, you may provide a API Token
in Header.
The most common way of accessing OAuth 2.0 APIs is using a “Bearer Token”.
This is a single string which acts as the authentication of the API request,
sent in an HTTP “Authorization” header. The string is meaningless to clients using it,
and may be of varying lengths.
Authorization: Bearer <api-token>
You can ask to Admin for assigning you a API Token
.
The following is a curl example using the HTTP Authorization header using the Bearer schema with a line break and spaces for readability.
curl -H 'Authorization: Bearer <api-token>' \
<public-url>/api/users
Registration
Create
Create new registration with HTTP request. During the creation you can set up attributes.
URL
GET/POST <public-url>/api/registrations/create
Request samples
let params = {
api_token:''
email:"",
username:"",
password:"",
display_name:"",
title:"",
designation:"",
first_name:"",
middle_name:"",
last_name:"",
gender:"",
country_calling_code:"",
phone:"",
bio:"",
timezone:"",
alternate_email:"",
avatar_url:"",
birth:"",
country:"",
country_code:"",
status:"",
activation_code:"",
activation_code_sent_at:"",
activated_ip:"",
invited_by:"",
invited_at:"",
invited_for_key:"",
invited_for_value:"",
user_id:"",
user_created_at:"",
created_ip:"",
registration_id:"",
meta:""
}
Response samples
{
"success": true,
"data": {
"item": {
.............
.............
}
},
"messages": [
"Saved successfully."
]
}
Get a List
Using this API you can get list of all the registration objects and their all properties.
This method supports some of the query parameters to help customize the response.
Parameter | Description | Type | Default |
---|---|---|---|
q | Value to be search in first_name , middle_name , last_name , display_name , email and id Column | String | |
per_page | N Item Per Page | Number | 20 |
from | Initial Date | String (Y-m-d) | |
to | Final Date | String (Y-m-d) | |
status | Status of Registration and it may be either email-verification-pending , email-verified or user-created | String | |
trashed | Set true to show Trashed (Soft Delete) data | Boolean | false |
URL
GET/POST <public-url>/api/registrations
Request samples
let params = {
api_token:"",
q:"",
from:"",
to:"",
status:"",
per_page:"",
trashed:""
}
Response samples
{
"success": true,
"data": {
"list": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "<public-url>/api/registrations?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "<public-url>/api/registrations?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "<public-url>/api/registrations?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "<public-url>/api/registrations",
"per_page": 20,
"prev_page_url": null,
"to": 2,
"total": 2
}
}
}
Get Item
Get a Item of the Registration objects. This will retrieves a User by their custom attributes, and returns all the properties of Registration.
Column can be id, uuid, email, username, password or any of the attributes from the vh_registrations
table and their value.
URL
GET/POST <public-url>/api/registrations/{column}/{value}
eg.
GET/POST <public-url>/api/registrations/id/1
Request samples
let params = {
api_token:"",
trashed:""
}
Response samples
{
"success": true,
"data": {
.............
.............
.............
}
}
Update
Simple HTTP request to Registrations API and you can update standard attributes for a user within few seconds!
Column can be id, uuid, email, username or Registration's attribute and their value.
URL
GET/POST <public-url>/api/registrations/{column}/{value}/update
Request samples
let params = {
api_token:''
email:"",
username:"",
password:"",
display_name:"",
title:"",
designation:"",
first_name:"",
middle_name:"",
last_name:"",
gender:"",
country_calling_code:"",
phone:"",
bio:"",
timezone:"",
alternate_email:"",
avatar_url:"",
birth:"",
country:"",
country_code:"",
status:"",
activation_code:"",
activation_code_sent_at:"",
activated_ip:"",
invited_by:"",
invited_at:"",
invited_for_key:"",
invited_for_value:"",
user_id:"",
user_created_at:"",
created_ip:"",
registration_id:"",
meta:""
}
Response samples
{
"success": true,
"messages": [
"Saved"
],
"data": {
...........
...........
}
}
Delete
Using this API we can delete a particular registration. We just need to pass the column name
and their value by which we want to select a particular user from the database.
Column can be id, uuid, email, username or any of the attributes from the vh_registrations
and their respective value.
URL
GET/POST <public-url>/api/registrations/{column}/{value}/delete
eg.
GET/POST <public-url>/api/registrations/id/4/delete
Response samples
{
"success": true,
"data": [],
"messages": [
"Action was successful"
]
}
Create User
Simple HTTP request to Registration API to create User.
URL
GET/POST <public-url>/api/registrations/{column}/{value}/create-user
Response samples
{
"success": true,
"data": {
"user": {
...........
...........
}
},
"messages": [
"User is created."
]
}
Users
The User API provides operations to manage users in your organization.
Create user
Create new user with HTTP request. During the creation you can set up attributes.
URL
let config = {
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${api_token}`
}
};
let response = await this.axios.get("<public-url>/api/users/create", config);
Request samples
POST <public-url>/api/users/create
let params = {
api_token:"",
email:"",
username:"",
password:"",
display_name:"",
title:"",
designation:"",
first_name:"",
middle_name:"",
last_name:"",
gender:"",
country_calling_code:"",
phone:"",
bio:"",
timezone:"",
alternate_email:"",
avatar_url:"",
birth:"",
country:"",
country_code:"",
is_active:"",
status:"",
activation_code:"",
activation_code_sent_at:"",
activated_ip:"",
invited_by:"",
invited_at:"",
invited_for_key:"",
invited_for_value:"",
user_id:"",
user_created_at:"",
created_ip:"",
registration_id:"",
meta:""
}
Response samples
{
"success": true,
"data": {
"item": {
..........
..........
}
},
"messages": [
"Saved successfully."
]
}
Get a List of Users
Get a list of the User
objects and their properties in a list with Pagination
.
This method supports some of the query parameters to help customize the response.
Parameter | Description | Type | Default |
---|---|---|---|
q | Value to be search in first_name , middle_name , last_name , display_name , email and id Column | String | |
per_page | N Item Per Page | Number | 20 |
from | Initial Date | String (Y-m-d) | |
to | Final Date | String (Y-m-d) | |
status | Status of User and may be either active or inactive | String | |
trashed | Set true to show Trashed (Soft Delete) data | Boolean | false |
URL
let config = {
headers: {
'Accept': 'application/json',
'Authorization': `Bearer ${api_token}`
}
};
let response = await this.axios.get("<public-url>/api/users", config);
Request samples
POST <public-url>/api/users
let params = {
api_token:"",
q:"",
from:"",
to:"",
status:"",
per_page:"",
trashed:""
}
Response samples
{
""success": true,
"data": {
"list": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "<public-url>/api/users?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "<public-url>/api/users?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "<public-url>/api/users?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "<public-url>/api/users",
"per_page": 20,
"prev_page_url": null,
"to": 2,
"total": 2
}
}
}
Get User Item
Get a Item of the User
objects .
This will retrieves a User
by their custom attributes
, and returns all the properties of User.
Column can be id
, uuid
, email
, username
or User's attribute and their value.
URL
<public-url>/api/users/{column}/{value}
eg.
<public-url>/api/users/id/1
Request samples
let params = {
trashed:""
}
Response samples
{
"success": true,
"data": {
.............
.............
}
}
Update
Simple HTTP request to Users API and you can update standard attributes for a user within few seconds!
You will be able to update all the attributes of a user by passing column
name and a particular value.
Column can be id
, uuid
, email
, username
or User's attribute and their value.
URL
GET/POST <public-url>/api/users/{column}/{value}/update
e.g
GET/POST <public-url>/api/users/email/test@gmail.com/update
Request samples
let params = {
api_token:''
email:"",
username:"",
password:"",
display_name:"",
title:"",
designation:"",
first_name:"",
middle_name:"",
last_name:"",
gender:"",
country_calling_code:"",
phone:"",
bio:"",
website:"",
timezone:"",
alternate_email:"",
avatar_url:"",
birth:"",
country:"",
country_code:"",
last_login_at:"",
last_login_ip:"",
remember_token:"",
login_otp:"",
api_token_used_at:"",
api_token_used_ip:"",
is_active:"",
activated_at:"",
status:"",
affiliate_code:"",
affiliate_code_used_at:"",
reset_password_code:"",
reset_password_code_sent_at:"",
reset_password_code_used_at:"",
foreign_user_id:"",
meta:"",
created_ip:"",
}
Response samples
{
"success": true,
"messages": [
"Saved"
],
"data": {
...........
...........
}
}
Delete
Simple HTTP request to Users API to delete user. Using this you can delete a particular user, you
just need to pass the column
name and their respective value.
Column can be id
, uuid
, email
, username
or User's attribute.
URL
GET/POST <public-url>/api/users/{column}/{value}/delete
e.g
GET/POST <public-url>/api/users/id/14/delete
Response samples
{
"success": true,
"data": [],
"messages": [
"Action was successful"
]
}
Get User's Roles
Get user's roles
via GET/POST request.
Column can be id
, uuid
, email
, username
or User's attribute and their value.
URL
GET/POST <public-url>/api/users/{column}/{value}/roles
Request samples
let params = {
api_token:"",
q:"",
per_page:""
}
Response samples
{
"data": {
"user": {
.............
.............
},
"roles": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "http://localhost/vikram/vaahcms-dev-env/public/api/users/id/2/roles?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://localhost/vikram/vaahcms-dev-env/public/api/users/id/2/roles?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://localhost/vikram/vaahcms-dev-env/public/api/users/id/2/roles?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://localhost/vikram/vaahcms-dev-env/public/api/users/id/2/roles",
"per_page": 20,
"prev_page_url": null,
"to": 3,
"total": 3
}
},
"success": true,
}
User has Role
API to check if an user has a specific role.
We just need to pass the following three attributes:
- Attribute from
users
table - Value of the Attribute from
users
table role_slug
fromvh_roles
table
URL
GET/POST <public-url>/api/users/{column}/{value}/roles/{role_slug}
e.g
GET/POST <public-url>/api/users/id/5/roles/manager
Response samples
{
"success": true,
"data": true/false,
}
Get User's Permissions
Get user's permissions via GET/POST request. We just need to pass the following three attributes:
- Any attribute of that specific user like name,email etc.
- Value of that specific Attribute from
users
table - Any of the VaahCMS permissions.
It will return all of the permissions for a particular user.
URL
GET/POST <public-url>/api/users/{column}/{value}/permissions
e.g
GET/POST <public-url>/api/users/id/1/permissions
Request samples
let params = {
api_token:"",
q:"",
per_page:""
}
Response samples
{
"data": {
"user": {
.............
.............
},
"permissions": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "http://localhost:8000/api/users/id/1/permissions?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://localhost:8000/api/users/id/1/permissions?page=4",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://localhost:8000/api/users/id/1/permissions?page=1",
"label": "1",
"active": true
},
{
"url": "http://localhost:8000/api/users/id/1/permissions?page=2",
"label": "2",
"active": false
},
{
"url": "http://localhost:8000/api/users/id/1/permissions?page=3",
"label": "3",
"active": false
},
{
"url": "http://localhost:8000/api/users/id/1/permissions?page=4",
"label": "4",
"active": false
},
{
"url": "http://localhost:8000/api/users/id/1/permissions?page=2",
"label": "Next »",
"active": false
}
],
"next_page_url": "http://localhost:8000/api/users/id/1/permissions?page=2",
"path": "http://localhost:8000/api/users/id/1/permissions",
"per_page": 20,
"prev_page_url": null,
"to": 20,
"total": 75
}
},
"success": true,
}
User has Permission
API to check if an user has a specific role.
We just need to pass the following three attributes:
- Attribute of that specific user like id,name,email
- Value of the Attribute for that specific user
permission_slug
fromvh_permissions
table
URL
GET/POST <public-url>/api/users/{column}/{value}/permissions/{permission_slug}
GET/POST <public-url>/api/users/id/1/permissions/can-login-in-backend
Response samples
{
"success": true,
"data": true/false,
}
Roles
Create
Create new role with HTTP request. During the creation you can set up attributes.
URL
GET/POST <public-url>/api/roles/create
Request samples
let params = {
api_token:""
name:"",
slug:"",
details:"",
is_active:"",
type:"",
}
Response samples
{
"success": true,
"data": {
..........
..........
},
"messages": [
"Saved successfully."
]
}
Get a List
Get a list of the Role objects and their properties in a list with Pagination.
This method supports some of the query parameters to help customize the response.
Parameter | Description | Type | Default |
---|---|---|---|
q | Value to be search in name and slug Column | String | |
per_page | N Item Per Page | Number | 20 |
from | Initial Date | String (Y-m-d) | |
to | Final Date | String (Y-m-d) | |
filter | Status of Role, it may be active ,inactive , frontend or backend | String | |
trashed | Set true to show Trashed (Soft Delete) data | Boolean | false |
URL
GET/POST <public-url>/api/roles
Request samples
let params = {
api_token:"",
q:"",
from:"",
to:"",
filter:"",
per_page:"",
trashed:""
}
Response samples
{
"success": true,
"data": {
"list": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "<public-url>/api/roles?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "<public-url>/api/roles?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://localhost:8000/api/roles?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "<public-url>/api/roles",
"per_page": 20,
"prev_page_url": null,
"to": 2,
"total": 2
}
}
}
Get Item
This API will retrieve a Role by their custom attributes, and returns all the properties of specific Role. Column can be id, uuid, email, username or Role's attribute and their value.
URL
GET/POST <public-url>/api/roles/{column}/{value}
e.g
GET/POST <public-url>/api/roles/name/Administrator
Request samples
let params = {
api_token:"",
trashed:""
}
Response samples
{
"success": true,
"data": {
.............
.............
}
}
Update
Simple HTTP requests to Role API and you can update standard attributes for a specific role within few seconds!
Column can be id, uuid,name,slug or any of the Role's attribute and their value.
URL
GET/POST <public-url>/api/roles/{column}/{value}/update
e.g
GET/POST <public-url>/api/roles/id/2/update
Request samples
let params = {
api_token:'',
name:"",
slug:"",
details:"",
is_active:"",
type:"",
}
Response samples
{
"success": true,
"messages": [
"Saved"
],
"data": {
...........
...........
}
}
Delete
Simple HTTP request to Role API to delete roles.
Column can be id, uuid,name,slug or Role's attribute and their respective value.
URL
GET/POST <public-url>/api/roles/{column}/{value}/delete
e.g
GET/POST <public-url>/api/roles/name/Tester/delete
Response samples
{
"success": true,
"data": [],
"messages": [
"Action was successful"
]
}
Get Role's Users
This API will return all the users who have been assigned the given role.
URL
GET/POST <public-url>/api/roles/{column}/{value}/users
Here the Column can be id, uuid,name,slug or Role's attribute and their value.
Request samples
let params = {
api_token:"",
q:"",
per_page:""
}
Response samples
{
"data": {
"role": {
.............
.............
},
"users": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "http://localhost:8000/api/roles/name/Tester/users?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://localhost:8000/api/roles/name/Tester/users?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://localhost:8000/api/roles/name/Tester/users?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://localhost/vikram/vaahcms-dev-env/public/api/roles/id/2/users",
"per_page": 20,
"prev_page_url": null,
"to": 3,
"total": 3
}
},
"success": true,
}
Get Role's Permissions
Get role's permissions via GET/POST request. This API will return all the permissions of a specific role. Column can be id, uuid, email, name, slug or Role's attribute and their value.
URL
GET/POST <public-url>/api/roles/{column}/{value}/permissions
e.g
GET/POST <public-url>/api/roles/name/Super Administrator/permissions
Request samples
let params = {
api_token:"",
q:"",
per_page:""
}
Response samples
{
"data": {
"role": {
.............
.............
},
"permissions": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "http://localhost:8000/api/roles/name/Super%20Administrator/permissions?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://localhost:8000/api/roles/name/Super%20Administrator/permissions?page=4",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://localhost:8000/api/roles/name/Super%20Administrator/permissions?page=1",,
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://localhost/vikram/vaahcms-dev-env/public/api/roles/{column}/{value}/permissions",
"per_page": 20,
"prev_page_url": null,
"to": 20,
"total": 75
}
},
"success": true,
}
Permission
Get a List
Get a list of the Permission objects and their properties in a list with Pagination.
This method supports some of the query parameters to help customize the response.
Parameter | Description | Type | Default |
---|---|---|---|
q | Value to be search in name and slug Column | String | |
per_page | N Item Per Page | Number | 20 |
from | Initial Date | String (Y-m-d) | |
to | Final Date | String (Y-m-d) | |
filter | Status of Permission and may be either active , inactive or {module_name} | String | |
section | if filter = {module_name} | String | |
trashed | Set true to show Trashed (Soft Delete) data | Boolean | false |
URL
GET/POST <public-url>/api/permissions
Request samples
let params = {
api_token:"",
q:"",
from:"",
to:"",
filter:"",
section:"",
per_page:"",
trashed:""
}
Response samples
{
"success": true,
"data": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "<public-url>/api/permissions?page=1",
"from": 1,
"last_page": 4,
"last_page_url": "<public-url>/api/permissions?page=4",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "<public-url>/api/permissions?page=1",
"label": "1",
"active": true
},
{
"url": "http://localhost:8000/api/permissions?page=2",
"label": "2",
"active": false
},
{
"url": "http://localhost:8000/api/permissions?page=3",
"label": "3",
"active": false
},
{
"url": "http://localhost:8000/api/permissions?page=4",
"label": "4",
"active": false
},
{
"url": "http://localhost:8000/api/permissions?page=2",
"label": "Next »",
"active": false
}
],
"next_page_url":"http://localhost:8000/api/permissions?page=2",
"path": "http://localhost:8000/api/permissions",
"per_page": 20,
"prev_page_url": null,
"to": 2,
"total": 75
}
}
Get Item
Get a Item of the Permission objects . This will retrieves a permission by their custom attributes, and returns all the properties of Permission.
URL
GET/POST <public-url>/api/permissions/{column}/{value}
Here Column can be id, uuid, slug, module or any of the Permission's attribute and their respective value.
e.g
GET/POST <public-url>/api/permissions/name/Can Login In Backend
Request samples
let params = {
api_token:"",
trashed:""
}
Response samples
{
"success": true,
"data": {
.............
.............
}
}
Delete
Simple HTTP request to delete permission object.
URL
GET/POST <public-url>/api/permissions/{column}/{value}/delete
Column can be id, uuid, slug, module or any of the Permission's attribute and their value.
Response samples
{
"success": true,
"data": [],
"messages": [
"Action was successful"
]
}
Get Permission's Users
Get permission's users via GET/POST request. This api will return the list of users
who have been
assigned the given permission.
URL
GET/POST <public-url>/api/permissions/{column}/{value}/users
Here Column can be id, name, uuid, slug, module or any of the Permission's attribute and their value.
e.g
GET/POST <public-url>/api/permissions/name/Can Login In Backend/users
Response samples
{
"data": {
"role": {
.............
.............
},
"users": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "http://localhost:8000/api/permissions/name/Can%20Login%20In%20Backend/users?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://localhost:8000/api/permissions/name/Can%20Login%20In%20Backend/users?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://localhost/vikram/vaahcms-dev-env/public/api/permissions/id/2/users?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://localhost:8000/api/permissions/name/Can%20Login%20In%20Backend/users",
"per_page": 20,
"prev_page_url": null,
"to": 2,
"total": 2
}
},
"success": true,
}
Get Permission's Roles
Get permission's roles via GET/POST request. This API will get you the list of roles who have the given permission assigned.
URL
GET/POST <public-url>/api/permissions/{column}/{value}/roles
Here Column can be id, name, uuid, slug, module or any of the Permission's attribute and their respective value.
e.g
GET/POST <public-url>/api/permissions/name/Can Login In Backend/roles
Request samples
let params = {
api_token:"",
q:"",
per_page:""
}
Response samples
{
"data": {
"permission": {
..............
..............
},
"roles": {
"current_page": 1,
"data": [
{
..........
..........
}
],
"first_page_url": "http://localhost:8000/api/permissions/name/Has%20Access%20of%20Setting%20Section/roles?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://localhost:8000/api/permissions/name/Has%20Access%20of%20Setting%20Section/roles?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://localhost:8000/api/permissions/name/Has%20Access%20of%20Setting%20Section/roles?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://localhost:8000/api/permissions/name/Has%20Access%20of%20Setting%20Section/roles",
"per_page": 20,
"prev_page_url": null,
"to": 1,
"total": 1
}
},
"success": true
}
Taxonomy
Create
Create new Taxonomy with HTTP request. During the creation you have to setup its attributes.
URL
GET/POST <public-url>/api/taxonomies/create
Request samples
let params = {
api_token:'',
name:"",
slug:"",
type:"",
parent:"",
}
Response samples
{
"success": true,
"data": {
"item": {
..........
..........
}
},
"messages": [
"Saved successfully."
]
}
Get a List
Get a list of the Taxonomy objects and their properties in a list with Pagination.
This method supports some of the query parameters to help customize the response.
Parameter | Description | Type | Default |
---|---|---|---|
q | Value to be search in name and slug Column | String | |
per_page | N Item Per Page | Number | 20 |
from | Initial Date | String (Y-m-d) | |
to | Final Date | String (Y-m-d) | |
status | Status of taxonomy and may be either active or inactive | String | |
trashed | Set true to show Trashed (Soft Delete) data | Boolean | false |
URL
GET/POST <public-url>/api/taxonomies
Request samples
let params = {
api_token:"",
q:"",
from:"",
to:"",
status:"",
types:"",
per_page:"",
trashed:""
}
Response samples
{
"success": true,
"data": {
"list": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "<public-url>/api/taxonomies?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "<public-url>/api/taxonomies?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "<public-url>/api/taxonomies?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "<public-url>/api/taxonomies",
"per_page": 20,
"prev_page_url": null,
"to": 2,
"total": 2
}
}
}
Get Item
Get a Item of the Taxonomy objects . This will retrieves a taxonomy by their custom attributes, and returns all the properties of Taxonomy.
URL
GET/POST <public-url>/api/taxonomies/{column}/{value}
Column can be id, uuid, parent_id, name, slug or Taxonomy's attribute and their value. e.g
GET/POST <public-url>/api/taxonomies/name/User Created
Request samples
let params = {
api_token:"",
trashed:""
}
Response samples
{
"success": true,
"data": {
.............
.............
}
}
Update
Simple HTTP request to Taxonomy API and you can update standard attributes of a taxonomy within few seconds!
URL
GET/POST <public-url>/api/taxonomies/{column}/{value}/update
Column can be id, uuid, parent_id, name, slug or Taxonomy's attribute and their value.
e.g
GET/POST <public-url>/api/taxonomies/name/User Created/update
Request samples
let params = {
api_token:'',
name:"",
slug:"",
type:"",
parent:"",
}
Response samples
{
"success": true,
"messages": [
"Saved"
],
"data": {
...........
...........
}
}
Delete
Simple HTTP request to Taxonomies API to delete taxonomy.
URL
GET/POST <public-url>/api/taxonomies/{column}/{value}/delete
Column can be id, uuid, parent_id, name, slug or Taxonomy's attribute and their value.
e.g
GET/POST <public-url>/api/taxonomies/name/User Created/delete
Response samples
{
"success": true,
"data": [],
"messages": [
"Action was successful"
]
}
Taxonomy Type
Create
Create new Taxonomy Type with HTTP request. During the creation you need to set up attributes.
URL
GET/POST <public-url>/api/taxonomy-types/create
Request samples
let params = {
api_token:'',
name:"",
slug:"",
parent:"",
}
Response samples
{
"success": true,
"data": {
"item": {
..........
..........
}
},
"messages": [
"Saved successfully."
]
}
Get a List
Get a list of the Taxonomy Type objects and their properties in a list with Pagination.
This method supports some of the query parameters to help customize the response.
Parameter | Description | Type | Default |
---|---|---|---|
q | Value to be search in name and slug Column | String | |
per_page | N Item Per Page | Number | 20 |
from | Initial Date | String (Y-m-d) | |
to | Final Date | String (Y-m-d) | |
with_children | When true, get Response with children attribute | Boolean | false |
trashed | Set true to show Trashed (Soft Delete) data | Boolean | false |
URL
GET/POST <public-url>/api/taxonomy-types
Request samples
let params = {
api_token:'',
name:"",
slug:"",
parent:"",
to:'',
per_page:"",
trashed:"",
with_children:"",
}
Response samples
{
"success": true,
"data": {
"list": {
"current_page": 1,
"data": [
..............
..............
],
"first_page_url": "<public-url>/api/taxonomy-types?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "<public-url>/api/taxonomy-types?page=1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "<public-url>/api/taxonomy-types?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "<public-url>/api/taxonomy-types",
"per_page": 20,
"prev_page_url": null,
"to": 2,
"total": 2
}
}
}
Get Item
Get a Item of the Taxonomy Type objects . This will retrieves a taxonomy by their custom attributes, and returns all the properties of Taxonomy Type.
URL
GET/POST <public-url>/api/taxonomy-types/{column}/{value}
Column can be id,name, slug or Taxonomy Type's attribute and their value.
e.g
GET/POST <public-url>/api/taxonomy-types/name/countries
Request samples
let params = {
api_token:''
trashed:''
}
Response samples
{
"success": true,
"data": {
.............
.............
}
}
Update
Simple HTTP request to Taxonomy type API and you can update standard attributes for a taxonomy type within few seconds!
URL
GET/POST <public-url>/api/taxonomy-types/{column}/{value}/update
Column can be id,name, slug or Taxonomy Type's attribute and their value. e.g
GET/POST <public-url>/api/taxonomy-types/name/countries/update
Request samples
let params = {
api_token:''
slug:"",
parent:"",
}
Response samples
{
"success": true,
"messages": [
"Saved"
],
"data": {
...........
...........
}
}
Delete
Simple HTTP request to Users API to delete taxonomy type.
URL
GET/POST <public-url>/api/taxonomy-types/{column}/{value}/delete
Column can be id,name, slug or Taxonomy Type's attribute and their value.
e.g
GET/POST <public-url>/api/taxonomy-types/name/countries/delete
Response samples
{
"success": true,
"data": [],
"messages": [
"Action was successful"
]
}
Dashboard
This is the home page of VaahCms. Where you can have the shortcuts of important features.
Access Control List (ACL)
An access control list (ACL) contains rules that grant or deny access to certain digital environments. A list of permissions associated with an object. The list specifies who or what is allowed to access the object and what operations are allowed to be performed on the object.