Contacts

Contacts are the people at a company or one of its branches. Tickets are raised by contacts.

The Contact Model

A person at a company, with no platform login.

Scheme

  • Name
    id
    Type
    integer
    Description
    Unique identifier
  • Name
    companyId
    Type
    integer required
    Description
    The company the contact belongs to. Cannot be changed
  • Name
    branchId
    Type
    integer
    Description
    The one branch of the company the contact belongs to, or 0 for the whole company
  • Name
    name
    Type
    string required
    Description
    Contact name
  • Name
    email
    Type
    string
    Description
    Email address
  • Name
    phone
    Type
    string
    Description
    Phone number
  • Name
    disabled
    Type
    boolean
    Description
    Whether the contact is switched off
  • Name
    attributes
    Type
    object
    Description
    Position, a messaging chat id and other details

GET/contacts

Fetch a list of Contacts

Contacts of the companies the user can see, sorted by name. A contact with branchId 0 belongs to the whole company.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Query Parameters

  • Name
    companyId
    Type
    integer
    Description
    Only records of this company
  • Name
    branchId
    Type
    integer
    Description
    Contacts of this branch. Use 0 for the company-wide contacts only
  • Name
    keyword
    Type
    string
    Description
    Search keyword filter (name, email and phone)
  • Name
    limit
    Type
    integer
    Description
    Limit the number of returned results
  • Name
    offset
    Type
    integer
    Description
    Offset for pagination

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Contact
  • Name
    400
    Type
    error
    Description
    Bad request. Invalid input, or the user has no access to the company (the server answers 400 with a text message)
  • Name
    401
    Type
    error
    Description
    Unauthorized

Request

GET
/contacts
curl --location 'https://gw.onemap8.com/api/contacts?companyId=<integer>&branchId=<integer>&keyword=<string>&limit=<integer>&offset=<integer>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

[
{
  "id": 0,
  "companyId": 0,
  "branchId": 0,
  "name": "<string>",
  "email": "<string>",
  "phone": "<string>",
  "disabled": true,
  "attributes": {}
}
]

POST/contacts

Create a Contact

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Request body schema

  • Name
    application/json
    Type
    schema
    Description

Body schema

  • Name
    id
    Type
    integer
    Description
    Unique identifier
  • Name
    companyId
    Type
    integer required
    Description
    The company the contact belongs to. Cannot be changed
  • Name
    branchId
    Type
    integer
    Description
    The one branch of the company the contact belongs to, or 0 for the whole company
  • Name
    name
    Type
    string required
    Description
    Contact name
  • Name
    email
    Type
    string
    Description
    Email address
  • Name
    phone
    Type
    string
    Description
    Phone number
  • Name
    disabled
    Type
    boolean
    Description
    Whether the contact is switched off
  • Name
    attributes
    Type
    object
    Description
    Position, a messaging chat id and other details

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Contact
  • Name
    400
    Type
    error
    Description
    Bad request. Invalid input, or the user has no access to the company (the server answers 400 with a text message)
  • Name
    401
    Type
    error
    Description
    Unauthorized

Request

POST
/contacts
curl --location --request POST 'https://gw.onemap8.com/api/contacts' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": 0,
"companyId": 0,
"branchId": 0,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"disabled": true,
"attributes": {}
}'

Response

{
"id": 0,
"companyId": 0,
"branchId": 0,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"disabled": true,
"attributes": {}
}

GET/contacts/{id}

Fetch a Contact

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    id
    Type
    integer required
    Description

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Contact
  • Name
    400
    Type
    error
    Description
    Bad request. Invalid input, or the user has no access to the company (the server answers 400 with a text message)
  • Name
    401
    Type
    error
    Description
    Unauthorized
  • Name
    404
    Type
    error
    Description
    Not found

Request

GET
/contacts/{id}
curl --location 'https://gw.onemap8.com/api/contacts/<integer>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

{
"id": 0,
"companyId": 0,
"branchId": 0,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"disabled": true,
"attributes": {}
}

PUT/contacts/{id}

Update a Contact

The id in the body must be the id in the path. A contact cannot be moved to another company, and its branch must belong to the same company.

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    id
    Type
    integer required
    Description

Request body schema

  • Name
    application/json
    Type
    schema
    Description

Body schema

  • Name
    id
    Type
    integer
    Description
    Unique identifier
  • Name
    companyId
    Type
    integer required
    Description
    The company the contact belongs to. Cannot be changed
  • Name
    branchId
    Type
    integer
    Description
    The one branch of the company the contact belongs to, or 0 for the whole company
  • Name
    name
    Type
    string required
    Description
    Contact name
  • Name
    email
    Type
    string
    Description
    Email address
  • Name
    phone
    Type
    string
    Description
    Phone number
  • Name
    disabled
    Type
    boolean
    Description
    Whether the contact is switched off
  • Name
    attributes
    Type
    object
    Description
    Position, a messaging chat id and other details

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Contact
  • Name
    400
    Type
    error
    Description
    Bad request. Invalid input, or the user has no access to the company (the server answers 400 with a text message)
  • Name
    401
    Type
    error
    Description
    Unauthorized

Request

PUT
/contacts/{id}
curl --location --request PUT 'https://gw.onemap8.com/api/contacts/<integer>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": 0,
"companyId": 0,
"branchId": 0,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"disabled": true,
"attributes": {}
}'

Response

{
"id": 0,
"companyId": 0,
"branchId": 0,
"name": "<string>",
"email": "<string>",
"phone": "<string>",
"disabled": true,
"attributes": {}
}

DELETE/contacts/{id}

Delete a Contact

Authorizations

BasicAuth or ApiKey

  • Name
    BasicAuth
    Type
    scheme
    Description
    HTTP Authorization Scheme: basic
  • Name
    ApiKey
    Type
    scheme
    Description
    HTTP Authorization Scheme: bearer

Path parameters

  • Name
    id
    Type
    integer required
    Description

Responses

  • Name
    204
    Type
    success
    Description
    No content
  • Name
    400
    Type
    error
    Description
    Bad request. Invalid input, or the user has no access to the company (the server answers 400 with a text message)
  • Name
    401
    Type
    error
    Description
    Unauthorized
  • Name
    404
    Type
    error
    Description
    Not found

Request

DELETE
/contacts/{id}
curl --location --request DELETE 'https://gw.onemap8.com/api/contacts/<integer>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

No content