# Class TwinfinityMapBoxApiClient

Api to access MapBox functionality in the Twinfinity backend.

#### Implements

- MapBoxApiClient

##### Index

### Constructors

constructor

### Methods

getAccessToken

## Constructors

### constructor

- new TwinfinityMapBoxApiClient(_baseUrl: URL): TwinfinityMapBoxApiClient

  #### Parameters

  - _baseUrl: URL

  #### Returns TwinfinityMapBoxApiClient

## Methods

### getAccessToken

- getAccessToken(hostname?: string): Promise<MapBoxAccessTokenResponse>

  Gets a MapBox access token for the specified hostname. The token can then be used in direct calls to the MapBox REST API. See MapBox documentation on how to use the token.

  #### Parameters

  - hostname: string = window.location.hostname

    The hostname to get the access token for. If not specified, `window.location.hostname` is used.

  #### Returns Promise<MapBoxAccessTokenResponse>

  A MapBox access token or a failure response. Use isFailure to check if the response is a failure.

  Implementation of MapBoxApiClient.getAccessToken