BoxstiLet’s talk

CRM & API integration

From website inquiry
to CRM contact.

Follow five fictional form submissions through a working API. An inquiry creates a contact, a duplicate keeps its original ID, and a correction updates the same record.

Test environment: a Boxsti-built local CRM sandbox using SQLite and HTTP. All names and submissions are fictional.

What happened to each inquiry?

Open a row to compare the original form, the fields sent to the API, and the response it returned.

First inquiryCreatedHTTP 201

Maya’s form fields become a contact in the demo CRM.

Website inquiry

{
  "contact_email": "Maya@north.example",
  "name": "Maya Chen",
  "company": "North Supply"
}

Mapped API request

{
  "email": "Maya@north.example",
  "full_name": "Maya Chen",
  "organization": "North Supply"
}

CRM response

{
  "outcome": "created",
  "contact_id": 1
}
Same inquiry delivered againUnchangedHTTP 200

The same email arrives with different spacing and capitalization. The original contact ID is returned.

Website inquiry

{
  "contact_email": " maya@north.example ",
  "name": "Maya Chen",
  "company": "North Supply"
}

Mapped API request

{
  "email": " maya@north.example ",
  "full_name": "Maya Chen",
  "organization": "North Supply"
}

CRM response

{
  "outcome": "unchanged",
  "contact_id": 1
}
Company name correctedUpdatedHTTP 200

A new company name is saved on Maya’s existing contact.

Website inquiry

{
  "contact_email": "Maya@north.example",
  "name": "Maya Chen",
  "company": "North Supply Co."
}

Mapped API request

{
  "email": "Maya@north.example",
  "full_name": "Maya Chen",
  "organization": "North Supply Co."
}

CRM response

{
  "outcome": "updated",
  "contact_id": 1
}
Inquiry missing an emailRejectedHTTP 422

The API returns a validation error. The request creates no contact.

Website inquiry

{
  "name": "Sam Lee",
  "company": "Cedar Parts"
}

Mapped API request

{
  "email": null,
  "full_name": "Sam Lee",
  "organization": "Cedar Parts"
}

CRM response

{
  "outcome": "rejected",
  "reason": "Email, name and organization are required"
}
Second valid inquiryCreatedHTTP 201

A different email creates the second contact.

Website inquiry

{
  "contact_email": "sam@cedar.example",
  "name": "Sam Lee",
  "company": "Cedar Parts"
}

Mapped API request

{
  "email": "sam@cedar.example",
  "full_name": "Sam Lee",
  "organization": "Cedar Parts"
}

CRM response

{
  "outcome": "created",
  "contact_id": 2
}

The two contacts on file

After the five submissions, a separate GET /contacts request read back these records. Maya’s corrected company name appears under her original ID.

IDNameCompanyEmail
1Maya ChenNorth Supply Co.maya@north.example
2Sam LeeCedar Partssam@cedar.example

Reproduce the result

Download the Python script and run python3 replay.py with Python 3.9 or newer. It starts a local-only test server, sends the five requests, verifies the final records, and prints the results. The test database exists only during the run.