Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide API to allow a new lead to be created #465

Closed
cbryanreapit opened this issue Feb 28, 2020 · 0 comments
Closed

Provide API to allow a new lead to be created #465

cbryanreapit opened this issue Feb 28, 2020 · 0 comments
Assignees
Labels
back-end Relates to back end issues feature New feature or request
Milestone

Comments

@cbryanreapit
Copy link
Contributor

cbryanreapit commented Feb 28, 2020

Overview

This endpoint will be responsible for providing ability to create a new lead.

Location

POST /enquiries (protected: yes)

Request

Payload

{
      "type": "salesApplicant/lettingsApplicant/salesValuation/lettingsValuation", 
      "message": "I would like to view this property",
      "propertyIds": [ "OXF200001" ],
      "officeId" : "OXF"
      "position" : "nothingToSell",
      "title": "Mr",
      "forename": "John",
      "surname": "Smith",
      "marketingConsent": "grant",
      "sourceName": "My Proptech",
      "homePhone": "01234 567890",
      "workPhone": null,
      "mobilePhone": "07890 123456",
      "email": "[email protected]",
      "address": {
        "buildingName": "",
        "buildingNumber": "15",
        "line1": "Example street",
        "line2": "Solihull",
        "line3": "West Midlands",
        "line4": "",
        "postcode": "B91 2XX",
        "countryId": "GB"
      },
}

Validations

  • title is required. Must be less than 15 characters.
  • forename is optional. If provided, must be less than 12 characters.
  • surname is required. If provided, must be less than 45 characters.
  • marketingConsent is required. Must be grant/deny/notAsked
  • sourceName is required. Must be less than 30 characters.
  • homePhone is optional. At least one home, work, mobile phone or email must be provided.
  • workPhone is optional. At least one home, work, mobile phone or email must be provided.
  • mobilePhone is optional. At least one home, work, mobile phone or email must be provided.
  • email is optional. At least one home, work, mobile phone or email must be provided.
  • address is optional.
  • leadType is required. Must be salesApplicant/lettingsApplicant/salesProperty/lettingsProperty
  • message is required.
  • propertyIds is optional. Collection must be comprised of valid property id format.
  • position is optional. Must be renting/instructedThisAgent/instructedOtherAgent/privateSale/notOnMarket
  • officeId is required and must be 3 characters.

Response

Success

201 Created

Failure

400 Bad Request
401 Authorised
403 Forbidden
422 Unprocessable Entity

@cbryanreapit cbryanreapit added feature New feature or request back-end Relates to back end issues labels Feb 28, 2020
@cbryanreapit cbryanreapit added this to the Leads API milestone Feb 28, 2020
@RWilcox-Reapit RWilcox-Reapit self-assigned this Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back-end Relates to back end issues feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants