loading

Enquiries

Create Enquiry

Creates a new enquiry record in your account.

  • Method: POST

  • Endpoint: /enquiries

  • Content-Type: application/json

Required Fields:

  • firstname (string): Contact's first name

  • lastname (string): Contact's last name

Optional Fields:

  • companyName (string): Company name

  • phone (string): Phone number

  • mobile (string): Mobile phone number

  • email (string): Email address

  • address1 (string): First line of contact address

  • address2 (string): Second line of contact address

  • town (string): Town or city

  • county (string): County or state

  • postcode (string): Postal code or ZIP code

  • locationAddress1 (string): First line of job/service location address

  • locationAddress2 (string): Second line of job/service location address

  • locationTown (string): Job/service location town or city

  • locationCounty (string): Job/service location county or state

  • locationPostcode (string): Job/service location postal code or ZIP code

  • enquiryDetails (string): Detailed description of the enquiry (max 2000 characters)

  • archived (boolean): Whether the enquiry is archived (default: false)

  • clientGuid (guid): The Guid of the client the enquiry is assigned to

Success Response:

  • Status: 200 OK

  • Body: Complete enquiry object including generated GUID and enquiry number

Get Enquiry

Retrieves a specific enquiry by its unique identifier.

  • Method: GET

  • Endpoint: /enquiries/{guid}

Parameters:

  • guid (required): The enquiry's unique identifier in GUID format

Success Response:

  • Status: 200 OK

  • Body: Complete enquiry object

Error Response:

  • Status: 404 Not Found

  • Body: "Enquiry not found"

Get All Enquiries

Retrieves all enquiries in your account with pagination support.

  • Method: GET

  • Endpoint: /enquiries

Query Parameters (Optional):

  • page (integer): Page number starting from 1 (default: 1)

  • pageSize (integer): Number of enquiries per page, between 1-100 (default: 100)

  • archived (boolean): Filter by archived status - true for archived enquiries, false for non-archived enquiries

  • includeArchived (boolean): When true, returns all enquiries regardless of archived status

Archive Filtering:
By default, the API returns only non-archived (active) enquiries. You can modify this behavior using the filtering parameters:

  • Default behavior: Shows only active enquiries (archived=false)

  • Show archived enquiries only: Use ?archived=true

  • Show all enquiries: Use ?includeArchived=true

Example URLs:

  • /enquiries - Returns first 100 active enquiries (default)

  • /enquiries?page=2 - Returns second page of 100 active enquiries

  • /enquiries?page=1&pageSize=50 - Returns first 50 active enquiries

  • /enquiries?archived=true - Returns archived enquiries only

  • /enquiries?archived=false - Returns active enquiries only (explicit)

  • /enquiries?includeArchived=true - Returns all enquiries (both active and archived)

  • /enquiries?page=2&pageSize=50&archived=true - Returns second page of 50 archived enquiries

  • /enquiries?page=1&includeArchived=true - Returns first page of all enquiries

Success Response:

  • Status: 200 OK

  • Body: Paginated response with enquiries array and pagination metadata

Response Structure:

{
  "enquiries": [
    {
      "guid": "123e4567-e89b-12d3-a456-426614174000",
      "id": 1001,
      "enquiryNo": 1,
      "companyId": 123,
      "dateAdded": "2024-01-15T10:30:00Z",
      "firstname": "John",
      "lastname": "Smith",
      "companyName": "Smith Construction",
      "email": "john@smithconstruction.com",
      "phone": "555-0123",
      "mobile": "555-0124",
      "address1": "123 Main St",
      "address2": "Suite 100",
      "town": "Anytown",
      "county": "State",
      "postcode": "12345",
      "locationAddress1": "456 Project Site",
      "locationAddress2": "",
      "locationTown": "Birmingham",
      "locationCounty": "West Midlands",
      "locationPostcode": "B1 1AA",
      "enquiryDetails": "Need quote for kitchen renovation including cabinets and appliances",
      "archived": false,
      "clientGuid": "123e4567-e89b-12d3-a456-426614174000"
    }
  ],
  "pagination": {
    "currentPage": 1,
    "pageSize": 100,
    "totalItems": 150,
    "totalPages": 2,
    "hasNextPage": true,
    "hasPreviousPage": false
  }
}

Pagination Fields:

  • currentPage: The current page number

  • pageSize: Number of items per page

  • totalItems: Total number of enquiries in your account

  • totalPages: Total number of pages available

  • hasNextPage: Boolean indicating if there are more pages

  • hasPreviousPage: Boolean indicating if there are previous pages

Error Responses:

  • Status: 400 Bad Request

  • Body: "Page must be a positive integer" (if page < 1)

  • Body: "PageSize must be between 1 and 100" (if pageSize is invalid)

Update Enquiry

Updates an existing enquiry record. Supports partial updates - only include fields you want to change.

  • Method: PUT

  • Endpoint: /enquiries/{guid}

  • Content-Type: application/json

Parameters:

  • guid (required): The enquiry's unique identifier in GUID format

Updatable Fields:
Any of the fields from the Create Enquiry endpoint can be updated except dateAdded, and enquiryNo. You only need to include the fields you want to change.

Field Validation:

  • firstname: Cannot be empty if provided

  • lastname: Cannot be empty if provided

  • enquiryDetails: Maximum 4000 characters

Success Response:

  • Status: 200 OK

  • Body: Updated enquiry object

Error Response:

  • Status: 404 Not Found

  • Body: "Enquiry not found"