Businesses
GET
Businesses retrieved successfully
GET /businesses HTTP/1.1
Host:
Accept: */*
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"
}
}
]
}
The search term to use for finding businesses.
Business Name
Businesses retrieved successfully
Too many requests
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"
}
}
]
Archived businesses retrieved successfully
GET /businesses/archived HTTP/1.1
Host:
Accept: */*
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"
}
}
]
}
Members retrieved successfully
GET /businesses/members-without-business HTTP/1.1
Host:
Accept: */*
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"
}
]
}
Business retrieved successfully
Invalid ID
Business not found
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"
}
}
Comments retrieved successfully
Invalid business ID
Access denied
Business not found
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"
}
]
}
Logs retrieved successfully
Access denied
Business not found
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"
}
]
}
Logs and comments retrieved successfully
Invalid business ID
Access denied
Business not found
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
Business Name
business@example.com
Business description
photo.jpg
["123-456-7890"]
1
Business created successfully
Phones must be unique
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"
}
}
1
Photo uploaded successfully
formatted_file_name.jpg
Invalid file
POST /businesses/upload-photo HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 25
{
"id": 1,
"photo": "binary"
}
formatted_file_name.jpg
This is a comment.
Comment added successfully
Invalid business ID
Access denied
Business not found
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
[1,2,3]
Businesses archived successfully
One or more businesses not found
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"
}
}
]
[1,2,3]
Businesses restored successfully
One or more businesses not found
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
Business Name
business@example.com
Business description
photo.jpg
["123-456-7890"]
1
Business updated successfully
Invalid ID
Business not found
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"
}
}
This is an edited comment.
Comment edited successfully
Invalid comment ID
Access denied
Comment not found
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
[1,2,3]
Businesses deleted successfully
One or more businesses not found
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"
}
}
]
Photo deleted successfully
{"message":"Photo deleted successfully","description":"The photo has been deleted successfully."}
Photo not found
DELETE /businesses/delete-photo/{fileName} HTTP/1.1
Host:
Accept: */*
{
"message": "Photo deleted successfully",
"description": "The photo has been deleted successfully."
}
Comment deleted successfully
{"message":"Comment deleted successfully","description":"The comment has been deleted successfully."}
Invalid comment ID
Access denied
DELETE /businesses/comments/{id} HTTP/1.1
Host:
Accept: */*
{
"message": "Comment deleted successfully",
"description": "The comment has been deleted successfully."
}
Last updated