OfficeGest
Entities/Contacts

Create new contact

Creates a new general contact. Automatically creates entity contacts for email, phone and mobile.

POST
/entities/contacts
AuthorizationBearer <token>

In: header

namestring

Contact full name. Minimum 4 characters.

Length4 <= length
address?string | null
city?string | null
zipcode?string | null
country?string | null

Country code (max 3 chars).

Lengthlength <= 3
phone1?string | null

Phone number in format +XXX.XXXXXXXXX.

Match/^\+[0-9]+\.[0-9]+$/
phone2?string | null
Match/^\+[0-9]+\.[0-9]+$/
mobilephone?string | null

Mobile phone in format +XXX.XXXXXXXXX.

Match/^\+[0-9]+\.[0-9]+$/
email?string | null

Primary email address.

Formatemail
email2?string | null
Formatemail
email3?string | null
Formatemail
taxid?string | null
Lengthlength <= 20
profession_id?string | null
Lengthlength <= 8
rgdp_allow_mailing?boolean

Response Body

curl -X POST "https://og-tenant1.test:8003/api/v2/entities/contacts" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Joao Silva"
  }'
{
  "data": {
    "id": 1,
    "name": "Joao Silva",
    "address": "Rua das Flores 123",
    "city": "Lisboa",
    "zipcode": "1000-001",
    "country": "PT",
    "phone1": "+351.912345678",
    "phone2": "+351.912345679",
    "mobilephone": "+351.961234567",
    "email": "joao@exemplo.pt",
    "email2": "string",
    "email3": "string",
    "taxid": "123456789",
    "profession_id": "1",
    "rgdp_allow_mailing": true,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}
{
  "data": {
    "code": "VALIDATION_FAILED",
    "message": "The given data was invalid.",
    "errors": {
      "email": [
        "The email field is required."
      ]
    }
  },
  "meta": {
    "trace_id": "9f86d081884c7d659a2feaa0c55ad01568f3a1c2b4d5e"
  }
}