Teams

Use the Bringg Dispatcher SDK Teams methods to integrate Bringg teams management into your own systems.

Overview

Use the Bringg Dispatcher SDK teams functionality to:

📘

Exception Handling

The Bringg Dispatcher SDK Teams methods use a promise pattern and a decorator factory for error exception handling. You can chain your method callback using then and catch to customize error handling for your own application. You can also delegate the Bringg Dispatcher SDK Logger to various log levels and implement your own functionality. For more information, see Exception Handling.

Syntax

bringgDashboardSDK.teams.

Example

The following examples include three types of implementation:

  • web
  • node.js
  • TypeScript

This code snippet demonstrates the teams.getAll() method.

<!doctype html>
<html lang="en">
<head>
  <!-- ... -->
  <script src="/bringg-dashboard-sdk.js"></script>
</head>
<body>
<!-- ... -->
<script>
BringgDashboardSDK.initWithAuthToken(region, authToken).then(bringgDashboardSDK => {
  bringgDashboardSDK.teams.getAll().then(console.log).catch(console.error);
});
</script> 
</body>
</html>
const BringgDashboardSDK = require("bringg-dashboard-sdk");

BringgDashboardSDK.initWithAuthToken(region, authToken).then(bringgDashboardSDK => {
  bringgDashboardSDK.teams.getAll().then(console.log).catch(console.error);
});
import BringgDashboardSDK = require("bringg-dashboard-sdk");

async function runAwait() {
  
  try {
      const bringgDashboardSDK = await BringgDashboardSDK.initWithAuthToken(region, authToken);
      console.log(await bringgDashboardSDK.teams.getAll());
    } catch (e) {
      console.error(e); 
    }
  }

runAwait();

Methods

teams.get(:teamId)

Gets detailed information for the specified team Id.

Input Parameters

teamId

number

REQUIRED

The Id of the team whose detailed information is returned.

Response

Team

Object

A Team object containing detailed team information.

teams.getAll()

Gets detailed information for all teams.

Input Parameters

None.

Response

Team

Array of Objects

An array of Team objects containing detailed team information for all teams.

teams.update()

Updates an existing team's detailed information.

Input Parameters

teamId

number

REQUIRED

The Id of the team whose detailed information is returned.

address

string

The address of this team.

contact_phone

string

The contact phone number for this team.

country_code

string

The country code of this team. The maximum length is 255 characters.

description

string

The description of this team.

distance_pay_per_km

number

The distance pay per kilometer for this team.

external_id

string

The Id of this team in your own system.

home_area

string

lat

number

The geoposition latitude of this team's address.

lng

number

The geoposition longititude of this team's address.

name

string

The name of this team.

parent_team_id

number

The Id of the team to which this team is member.

printer_type

string

The type of printer used to print receipts. 

service_boroughs

Array of Strings

An array of boroughs serviced by this team.

service_cities

Array of Strings

An array of cities serviced by this team.

service_zipcodes

Array of Strings

An array of ZIP Codes serviced by this team.

time_zone

string

The time zone of this team.

zipcode

string

The ZIP code of this team.

Response

teamId

number

The Id of the team updated.

Team

Object

A Team object containing the modified team information.