Upload Access Tokens for Geo Charts

Geo charts (Pushpins) use a map provider as a source for maps visualizations.

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.

Configure Your Access Token

You can upload the map access token by updating the organization or workspace settings via API, or rely on the automatically provided token.

Token expiration

Verify regularly that your access token is valid. If your token expires, upload a new token.

Organizations

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

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": "<map_access_token_value>"
      },
      "type": "MAP_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": "<map_access_token_value>"
        },
        "type": "MAP_TOKEN"
      },
      "id": "<some_id>",
      "type": "organizationSetting"
    }
}' | ConvertTo-Json

Add the Mapbox token to apiGw.extraEnvVars. We recommend using a Kubernetes Secret:

apiGw:
  extraEnvVars:
    - name: MAPBOX_TOKEN
      valueFrom:
        secretKeyRef:
          name: map-provider-credentials
          key: token

After upgrade, the token is used by the API Gateway to render maps; it is not exposed in the browser.

Workspaces (Cloud)

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

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": "<map_access_token_value>"
      },
      "type": "MAP_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": "<map_access_token_value>"
        },
        "type": "MAP_TOKEN"
      },
      "id": "<some_id>",
      "type": "workspaceSetting"
    }
}' | ConvertTo-Json