Branches

Branches are the sites of a company — stores, offices or factories. Contacts and tickets can be tied to a specific branch.

The Branch Model

A site of a company: a store, an office, a factory.

Scheme

  • Name
    id
    Type
    integer
    Description
    Unique identifier
  • Name
    companyId
    Type
    integer required
    Description
    The company the branch belongs to. Cannot be changed
  • Name
    name
    Type
    string required
    Description
    Branch name
  • Name
    uniqueId
    Type
    string
    Description
    External reference
  • Name
    disabled
    Type
    boolean
    Description
    Whether the branch is switched off
  • Name
    attributes
    Type
    object
    Description
    Address, location, zone and the like. A _zone_ attribute is what the ticket statistics group branches by

GET/branches

Fetch a list of Branches

Branches (stores, offices, factories) of the companies the user can see, sorted by name. Access follows the 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
    keyword
    Type
    string
    Description
    Search keyword filter (name and uniqueId)
  • 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
    Branch
  • 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
/branches
curl --location 'https://gw.onemap8.com/api/branches?companyId=<integer>&keyword=<string>&limit=<integer>&offset=<integer>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

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

POST/branches

Create a Branch

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 branch belongs to. Cannot be changed
  • Name
    name
    Type
    string required
    Description
    Branch name
  • Name
    uniqueId
    Type
    string
    Description
    External reference
  • Name
    disabled
    Type
    boolean
    Description
    Whether the branch is switched off
  • Name
    attributes
    Type
    object
    Description
    Address, location, zone and the like. A _zone_ attribute is what the ticket statistics group branches by

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Branch
  • 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
/branches
curl --location --request POST 'https://gw.onemap8.com/api/branches' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": 0,
"companyId": 0,
"name": "<string>",
"uniqueId": "<string>",
"disabled": true,
"attributes": {}
}'

Response

{
"id": 0,
"companyId": 0,
"name": "<string>",
"uniqueId": "<string>",
"disabled": true,
"attributes": {}
}

GET/branches/{id}

Fetch a Branch

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
    Branch
  • 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
/branches/{id}
curl --location 'https://gw.onemap8.com/api/branches/<integer>' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}'

Response

{
"id": 0,
"companyId": 0,
"name": "<string>",
"uniqueId": "<string>",
"disabled": true,
"attributes": {}
}

PUT/branches/{id}

Update a Branch

The id in the body must be the id in the path. A branch cannot be moved to another 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 branch belongs to. Cannot be changed
  • Name
    name
    Type
    string required
    Description
    Branch name
  • Name
    uniqueId
    Type
    string
    Description
    External reference
  • Name
    disabled
    Type
    boolean
    Description
    Whether the branch is switched off
  • Name
    attributes
    Type
    object
    Description
    Address, location, zone and the like. A _zone_ attribute is what the ticket statistics group branches by

Response schema

  • Name
    application/json
    Type
    schema
    Description

Responses

  • Name
    200
    Type
    success
    Description
    Branch
  • 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
/branches/{id}
curl --location --request PUT 'https://gw.onemap8.com/api/branches/<integer>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {your_access_token}' \
--data '{
"id": 0,
"companyId": 0,
"name": "<string>",
"uniqueId": "<string>",
"disabled": true,
"attributes": {}
}'

Response

{
"id": 0,
"companyId": 0,
"name": "<string>",
"uniqueId": "<string>",
"disabled": true,
"attributes": {}
}

DELETE/branches/{id}

Delete a Branch

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

Response

No content