Businesses
GET
Responses
200
Businesses retrieved successfully
application/json
get
GET /businesses HTTP/1.1
Host:
Accept: */*
200
Businesses retrieved successfully
{
"count": 10,
"businesses": [
{
"id": 1,
"name": "Business Name",
"phones": [
"123-456-7890"
],
"email": "business@example.com",
"contactPerson": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"photo": "https://example.com/photo.jpg"
},
"team": {
"id": "team_id"
}
}
]
}
Query parameters
searchstringRequiredExample:
The search term to use for finding businesses.
Business Name
Responses
200
Businesses retrieved successfully
application/json
429
Too many requests
application/json
get
GET /businesses/search?search=Business+Name HTTP/1.1
Host:
Accept: */*
[
{
"id": 1,
"name": "Business Name",
"phones": [
"123-456-7890"
],
"email": "business@example.com",
"contactPerson": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"photo": "https://example.com/photo.jpg"
},
"team": {
"id": "team_id"
}
}
]
Responses
200
Archived businesses retrieved successfully
application/json
get
GET /businesses/archived HTTP/1.1
Host:
Accept: */*
200
Archived businesses retrieved successfully
{
"count": 5,
"businesses": [
{
"id": 1,
"name": "Business Name",
"phones": [
"123-456-7890"
],
"email": "business@example.com",
"contactPerson": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"photo": "https://example.com/photo.jpg"
},
"team": {
"id": "team_id"
}
}
]
}
Responses
200
Members retrieved successfully
application/json
get
GET /businesses/members-without-business HTTP/1.1
Host:
Accept: */*
200
Members retrieved successfully
{
"count": 5,
"users": [
{
"id": 1,
"firstName": "John",
"lastName": "Doe",
"phoneNumber": "123-456-7890",
"email": "user@example.com",
"teamRole": "Member",
"membershipId": 1,
"isActive": true,
"isDeleted": false,
"deletedAt": "2023-01-01T00:00:00Z"
}
]
}
Path parameters
idstringRequired
Responses
200
Business retrieved successfully
application/json
400
Invalid ID
application/json
404
Business not found
application/json
get
GET /businesses/{id} HTTP/1.1
Host:
Accept: */*
{
"id": 1,
"name": "Business Name",
"phones": [
"123-456-7890"
],
"email": "business@example.com",
"contactPerson": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"photo": "https://example.com/photo.jpg"
},
"team": {
"id": "team_id"
}
}
Path parameters
idnumberRequired
Responses
200
Comments retrieved successfully
application/json
400
Invalid business ID
application/json
403
Access denied
application/json
404
Business not found
application/json
get
GET /businesses/comments/{id} HTTP/1.1
Host:
Accept: */*
{
"count": 5,
"comments": [
{
"id": 1,
"content": "This is a comment.",
"user": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"email": "user@example.com"
},
"createdAt": "2023-01-01T00:00:00Z"
}
]
}
Path parameters
idnumberRequired
Responses
200
Logs retrieved successfully
application/json
403
Access denied
application/json
404
Business not found
application/json
get
GET /businesses/logs/{id} HTTP/1.1
Host:
Accept: */*
{
"count": 5,
"logs": [
{
"id": 1,
"action": "CreateBusiness",
"entityType": "Business",
"user": {
"id": 1,
"email": "user@example.com"
},
"createdAt": "2023-01-01T00:00:00Z"
}
]
}
Path parameters
idnumberRequired
Responses
200
Logs and comments retrieved successfully
application/json
400
Invalid business ID
application/json
403
Access denied
application/json
404
Business not found
application/json
get
GET /businesses/logs-and-comments/{id} HTTP/1.1
Host:
Accept: */*
{
"logsAndComments": [
{
"id": 1,
"action": "CreateBusiness",
"entityType": "Business",
"user": {
"id": 1,
"email": "user@example.com"
},
"content": "This is a comment.",
"createdAt": "2023-01-01T00:00:00Z"
}
],
"logsCount": 5,
"commentsCount": 5
}
POST
Body
namestringRequiredExample:
Business Name
emailstringRequiredExample:
business@example.com
descriptionstringRequiredExample:
Business description
photostringRequiredExample:
photo.jpg
phonesstring[]RequiredExample:
["123-456-7890"]
contactPersonnumberRequiredExample:
1
Responses
201
Business created successfully
application/json
400
Phones must be unique
application/json
post
POST /businesses HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 438
{
"name": "Business Name",
"address": {
"addressOne": "123 Main St",
"addressTwo": "Suite 100",
"city": "Anytown",
"country": "USA",
"state": "CA",
"zipCode": "12345"
},
"email": "business@example.com",
"description": "Business description",
"photo": "photo.jpg",
"phones": [
"123-456-7890"
],
"contactPerson": 1,
"socialMedia": {
"youtube": "youtube.com/business",
"facebook": "facebook.com/business",
"instagram": "instagram.com/business",
"twitter": "twitter.com/business"
}
}
{
"id": 1,
"name": "Business Name",
"phones": [
"123-456-7890"
],
"email": "business@example.com",
"contactPerson": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"photo": "https://example.com/photo.jpg"
},
"team": {
"id": "team_id"
}
}
Body
idnumberOptionalExample:
1
photostring · binaryOptional
Responses
200
Photo uploaded successfully
application/json
ResponsestringExample:
formatted_file_name.jpg
400
Invalid file
application/json
post
POST /businesses/upload-photo HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 25
{
"id": 1,
"photo": "binary"
}
formatted_file_name.jpg
Path parameters
idnumberRequired
Body
contentstringOptionalExample:
This is a comment.
Responses
201
Comment added successfully
application/json
400
Invalid business ID
application/json
403
Access denied
application/json
404
Business not found
application/json
post
POST /businesses/comments/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 32
{
"content": "This is a comment."
}
{
"id": 1,
"content": "This is a comment.",
"user": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"email": "user@example.com"
},
"createdAt": "2023-01-01T00:00:00Z"
}
PATCH
Body
idsnumber[]RequiredExample:
[1,2,3]
Responses
200
Businesses archived successfully
application/json
400
One or more businesses not found
application/json
patch
PATCH /businesses/archive HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 15
{
"ids": [
1,
2,
3
]
}
[
{
"id": 1,
"name": "Business Name",
"phones": [
"123-456-7890"
],
"email": "business@example.com",
"contactPerson": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"photo": "https://example.com/photo.jpg"
},
"team": {
"id": "team_id"
}
}
]
Body
idsnumber[]RequiredExample:
[1,2,3]
Responses
200
Businesses restored successfully
application/json
400
One or more businesses not found
application/json
patch
PATCH /businesses/restore HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 15
{
"ids": [
1,
2,
3
]
}
[
{
"id": 1,
"name": "Business Name",
"phones": [
"123-456-7890"
],
"email": "business@example.com",
"contactPerson": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"photo": "https://example.com/photo.jpg"
},
"team": {
"id": "team_id"
}
}
]
PUT
Path parameters
idstringRequired
Body
namestringRequiredExample:
Business Name
emailstringRequiredExample:
business@example.com
descriptionstringRequiredExample:
Business description
photostringRequiredExample:
photo.jpg
phonesstring[]RequiredExample:
["123-456-7890"]
contactPersonnumberRequiredExample:
1
Responses
200
Business updated successfully
application/json
400
Invalid ID
application/json
404
Business not found
application/json
put
PUT /businesses/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 438
{
"name": "Business Name",
"address": {
"addressOne": "123 Main St",
"addressTwo": "Suite 100",
"city": "Anytown",
"country": "USA",
"state": "CA",
"zipCode": "12345"
},
"email": "business@example.com",
"description": "Business description",
"photo": "photo.jpg",
"phones": [
"123-456-7890"
],
"contactPerson": 1,
"socialMedia": {
"youtube": "youtube.com/business",
"facebook": "facebook.com/business",
"instagram": "instagram.com/business",
"twitter": "twitter.com/business"
}
}
{
"id": 1,
"name": "Updated Business Name",
"phones": [
"123-456-7890"
],
"email": "updated.business@example.com",
"contactPerson": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"photo": "https://example.com/photo.jpg"
},
"team": {
"id": "team_id"
}
}
Path parameters
idnumberRequired
Body
contentstringOptionalExample:
This is an edited comment.
Responses
200
Comment edited successfully
application/json
400
Invalid comment ID
application/json
403
Access denied
application/json
404
Comment not found
application/json
put
PUT /businesses/comments/{id} HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 40
{
"content": "This is an edited comment."
}
{
"id": 1,
"content": "This is an edited comment.",
"user": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"email": "user@example.com"
},
"createdAt": "2023-01-01T00:00:00Z"
}
DELETE
Body
idsnumber[]RequiredExample:
[1,2,3]
Responses
200
Businesses deleted successfully
application/json
400
One or more businesses not found
application/json
delete
DELETE /businesses HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 15
{
"ids": [
1,
2,
3
]
}
[
{
"id": 1,
"name": "Business Name",
"phones": [
"123-456-7890"
],
"email": "business@example.com",
"contactPerson": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"photo": "https://example.com/photo.jpg"
},
"team": {
"id": "team_id"
}
}
]
Path parameters
fileNamestringRequired
Responses
200
Photo deleted successfully
application/json
ResponseanyExample:
{"message":"Photo deleted successfully","description":"The photo has been deleted successfully."}
404
Photo not found
application/json
delete
DELETE /businesses/delete-photo/{fileName} HTTP/1.1
Host:
Accept: */*
{
"message": "Photo deleted successfully",
"description": "The photo has been deleted successfully."
}
Path parameters
idnumberRequired
Responses
200
Comment deleted successfully
application/json
ResponseanyExample:
{"message":"Comment deleted successfully","description":"The comment has been deleted successfully."}
400
Invalid comment ID
application/json
403
Access denied
application/json
delete
DELETE /businesses/comments/{id} HTTP/1.1
Host:
Accept: */*
{
"message": "Comment deleted successfully",
"description": "The comment has been deleted successfully."
}
Last updated