API

API for developers

get
Get Folders

https://your-site.com/wp-json/njt-fbv/public/v1/folders
This endpoint allows you to get folders
Request
Response
Request
Headers
Authorization
required
string
Bearer Token
Response
200: OK
{
"success": true,
"data": {
"folders": [
{
"id": 1087,
"text": "Bird",
"children": [],
"li_attr": {
"data-count": 1,
"data-parent": 0
},
"count": 19
},
{
"id": 1088,
"text": "Cat",
"children": [],
"li_attr": {
"data-count": 1,
"data-parent": 0
},
"count": 14
},
{
"id": 1089,
"text": "Dog",
"children": [],
"li_attr": {
"data-count": 1,
"data-parent": 0
},
"count": 23
}
]
}
}
401: Unauthorized
{
"code": "rest_forbidden",
"message": "Sorry, you are not allowed to do that.",
"data": {
"status": 401
}
}

post
Create New Folder

https://your-site.com/wp-json/njt-fbv/public/v1/folders
This endpoint allows you to create new folder.
Request
Response
Request
Headers
Authorization
required
string
Bearer Token
Form Data Parameters
name
required
string
Your folder name.
parent_id
required
integer
The parent id of your folder. 0 for parent.
Response
200: OK
{
"success": true,
"data": {
"id": 40
}
}
401: Unauthorized
{
"code": "rest_forbidden",
"message": "Sorry, you are not allowed to do that.",
"data": {
"status": 401
}
}

get
Get Attachment Ids by Folder Id

https://your-site.com/wp-json/njt-fbv/public/v1/attachment-id/?folder_id=
This endpoint allows you to get Attachment IDs by folder_id
Request
Response
Request
Headers
Authorization
required
string
Bearer Token
Query Parameters
folder_id
required
integer
Your Folder Id
Response
200: OK
{
"success": true,
"data": {
"attachment_ids": [
"8",
"30"
]
}
}
401: Unauthorized
{
"code": "rest_forbidden",
"message": "Sorry, you are not allowed to do that.",
"data": {
"status": 401
}
}

post
Add attachment(s) to folder

https://your-site.com/wp-json/njt-fbv/public/v1/folder/set-attachment
Request
Response
Request
Headers
Authorization
required
string
Bearer Token
Form Data Parameters
folder
required
number
The folder id
ids
required
number
The attachment ID, it could be a number or an array
Response
200: OK
{
"success": true
}
401: Unauthorized
{
"code": "rest_forbidden",
"message": "Sorry, you are not allowed to do that.",
"data": {
"status": 401
}
}

‚Äč