Upload Access Tokens for Geo Charts

Geo charts (Pushpins) use Mapbox as a source for maps in visualizations. A special Mapbox access token is required to enable the geo charts in Analytical Designer.

**GoodData Cloud** users are provided with access tokens automatically and do not have to worry about the token validity. However, they can also upload their own access tokens for an organization or workspace as well.

Upload Your Access Token

You can upload the Mapbox access token by:

  • Updating the helm chart for all organizations, or
  • Via API for a whole organization or individual workspaces.

Organizations

To upload the access token for organizations, use the following API call:

API (Bash)
API (Powershell)
Helm Chart
curl $HOST_URL/api/v1/entities/organizationSettings \
-H "Content-Type: application/vnd.gooddata.api+json" \
-H "Accept: application/vnd.gooddata.api+json" \
-H "Authorization: Bearer $API_TOKEN" \
-X POST \
-d '{
  "data": {
    "attributes": {
      "content": {
        "value": "<mapbox_access_token_value>"
      },
      "type": "MAPBOX_TOKEN"
    },
    "id": "<some_id>",
    "type": "organizationSetting"
  }
}'|jq .
Invoke-RestMethod -Method Post -Uri "$HOST_URL/api/v1/entities/organizationSettings"`
-ContentType "application/vnd.gooddata.api+json" `
-H @{ 
    'Accept' = "application/vnd.gooddata.api+json"
    'Authorization' = "Bearer $API_TOKEN" 
} `
-Body '{
    "data": {
      "attributes": {
        "content": {
          "value": "<mapbox_access_token_value>"
        },
        "type": "MAPBOX_TOKEN"
      },
      "id": "<some_id>",
      "type": "organizationSetting"
    }
}' | ConvertTo-Json

Only available with GoodData.CN

If you add the access token to the helm chart on the deployment level, all organizations will automatically share this token.

  1. Add the GDCN_SETTING_MAPBOX_TOKEN value to the metadataApi.extraEnvVars in your helm chart options.

    metadataApi:
        extraEnvVars:
        - name: GDCN_SETTING_MAPBOX_TOKEN
          value: '{"value": "<mapbox_access_token_value>"}'
    
  2. Upgrade your helm chart.

    helm upgrade
    

Your token is uploaded and you can start using geo charts.

Workspaces

To upload the access token for individual workspaces, use the following API call:

API (Bash)
API (Powershell)
curl $HOST_URL/api/v1/entities/workspaces/$WORKSPACE_ID/workspaceSettings \
-H "Content-Type: application/vnd.gooddata.api+json" \
-H "Accept: application/vnd.gooddata.api+json" \
-H "Authorization: Bearer $API_TOKEN" \
-X POST \
-d '{
  "data": {
    "attributes": {
      "content": {
        "value": "<mapbox_access_token_value>"
      },
      "type": "MAPBOX_TOKEN"
    },
    "id": "<some_id>",
    "type": "workspaceSetting"
  }
}'|jq .
Invoke-RestMethod -Method Post -Uri "$HOST_URL/api/v1/entities/workspaces/$WORKSPACE_ID/workspaceSettings"`
-ContentType "application/vnd.gooddata.api+json" `
-H @{ 
    'Accept' = "application/vnd.gooddata.api+json"
    'Authorization' = "Bearer $API_TOKEN" 
} `
-Body '{
    "data": {
      "attributes": {
        "content": {
          "value": "<mapbox_access_token_value>"
        },
        "type": "MAPBOX_TOKEN"
      },
      "id": "<some_id>",
      "type": "workspaceSetting"
    }
}' | ConvertTo-Json