Maps
Map API: /api/bw/v2/map
API BW version 2 (Beta)
Allows you to add, update, clone or delete Maps in a Boldest platform account. Among many other things, it can also be used to assign Resources to Maps.
Methods
POST: Create/Update Map
POST
json
Data to import in JSON format according to Schema /api/bw/v2/map/schema.json
Consult the Schema documentation
for the structure of the JSON data.
RESULT:
HTTP 200
Skipped. The Map exists and does not need to be updated
{
"done": "Skip Map TEST111",
"id": "TEST111",
"new": false,
"update": false
}
HTTP 201
Created. The Map did not exist and was therefore created
{
"done": "Create Map TEST111",
"id": "TEST111",
"new": true,
"update": true
}
HTTP 202
Accepted. The Map existed and was therefore updated
{
"done": "Update Map TEST111",
"id": "TEST111",
"new": false,
"update": true
}
HTTP 400
Wrong request
{
"fail": "Wrong request"
}
HTTP 401
Unauthorized
{
"fail": "Unauthorized"
}
HTTP 409
Conflict. The submitted contents are not valid
{
"fail": "Explanation of the problems encountered"
}
GET: Get Map/s
/{ids}
Id or Ids CSV format (Optional)/published/{1|0|*}
Published (Optional) (Default:1)/fields/{fields}
Only these fields (Optional) (Default:All)/ignoreFields/{fields}
Ignore these fields (Optional) (Default:None)/excludeFiles
Ignore file fields (Optional) (Default:No)RESULT:
HTTP 200
SuccessMap data in JSON format according to Schema (schema.json or schema.multiple.json)
HTTP 400
Wrong request{ "fail": "Wrong request" }
HTTP 401
Unauthorized{ "fail": "Unauthorized" }
HTTP 404
Not found{ "fail": "ERROR: Export fail" }
DELETE: Delete Map/s
/{ids}
Id or Ids CSV formatRESULT:
HTTP 202
Deleted{ "done": "Deletion of 5 Maps done", "batchId": "22123112345678", "count": 5 // Number of Maps deleted }
Partial deletion
{ "done": "Deletion of 3 Maps done", "batchId": "22123112345678", "count": 3, // Number of Maps deleted "fail": "Deletion of 2 Maps not done", "failed": ["TEST114", "TEST115"] }
HTTP 400
Wrong request{ "fail": "Wrong request" }
HTTP 401
Unauthorized{ "fail": "Unauthorized" }
HTTP 404
Not found{ "fail": "No Maps to delete" }
HTTP 409
Conflict. The submitted contents are not valid{ "fail": "Deletion of 5 Maps not done" }
POST: Request the Create/Update of a Map group in a batch process
/batch
CommandPOST
json
Batch data to import in JSON format according to Schema (schema.multiple.json)RESULT:
HTTP 201
Created. The Map did not exist, it is created{ "done": "Batch process created", "batchId": "22123112345678", "count": 123 // Number of Maps to be processed }
HTTP 400
Wrong request{ "fail": "Wrong request" }
HTTP 401
Unauthorized{ "fail": "Unauthorized" }
HTTP 409
Conflict. The submitted contents are not valid{ "fail": "Explanation of the problems encountered" }
GET: Query the status of a batch process
/batch
Command/{id}
Batch process IdRESULT
HTTP 200
Success{ "done": "Batch process status", "status": "waiting", // "waiting", "processing", "done", "error" "dateStatus": "2022-12-31 12:34:56", "dateRequest": "2022-12-31 12:34:56", "count": 123 }
HTTP 400
Wrong request{ "fail": "Wrong request" }
HTTP 401
Unauthorized{ "fail": "Unauthorized" }
HTTP 404
Error{ "fail": "There is no Map TEST111 to clone" }
POST/GET: Clone a Map. Optionally can be added to a Map
/clone
Command/{id}
Id (Optional) (Default: Map “Base” is cloned)RESULT:
HTTP 201
Cloned{ "done": "Cloned Map TEST111 to Map TEST111_8PtTXiU6mcw", "id": "TEST111_8PtTXiU6mcw" }
HTTP 400
Wrong request{ "fail": "Wrong request" }
HTTP 401
Unauthorized{ "fail": "Unauthorized" }
HTTP 404
Error{ "fail": "There is no Map TEST111 to clone" }
HTTP 409
Fail{ "fail": "Not cloned Map TEST111" }
GET: Get Schema JSON from the data structure of a Map
/full
Schema and data (Optinal)/schema.json
JSON schema for importRESULT:
HTTP 200
SuccessJSON schema document
GET: Get Schema JSON schema of a group of Maps in a batch process
/full
Schema and data (Optinal)/schema.multiple.json
Schema for batch import JSONRESULT:
HTTP 200
SuccessJSON schema document
Map schema documentation
Properties:
These are the fields used in the JSON for the map creation and update API.
id (required) Type: string. Size: (3, 80)
Unique key that identifies the Map
published Type: boolean
Map visibility for non-authenticated users
timeLastUpdate Type: string. Size: 19
Last update date and time (YYYY-MM-DD HH:MM:SS)
title Type: string. Size: (0, 100)
Title of the Map
shortDescription Type: string (nullable). Size: (0, 160)
Snippet describing the Map in brief
image Type: uri (nullable)
Featured image representing the Map (URL to jpg, png or webp)
urlAlias Type: string. Size: (2, 500)
URL of the Map (not full URL. Without protocol and domain. Starts with /)
canonicalUrl Type: uri (nullable). Size: (0, 500)
URL of equivalent external Resource
locationLat Type: number (nullable). Size: (-90, 90)
Map centering point at initialization: Latitude
locationLon Type: number (nullable). Size: (-180, 180)
Map centering point at initialization: Longitude
locationZoom Type: integer (nullable). Size: (2, 25)
Map zoom level at initialization. Google Maps zoom level format
mapLayerFile Type: uri (nullable)
Layer to overlay on the map with GIS information in KML format. (URL to a KML or KMZ file up to 2MB)
ctaOnMap Type: boolean (nullable)
Activate the floating CTA button on the map.
ctaOnImage Type: boolean (nullable)
Activate the floating CTA button on the image.
ctaUrl Type: uri (nullable). Size: (0, 1500)
URL pointed to by the Map CTA button
ctaLabel Type: string (nullable). Size: (0, 20)
CTA button: text label
ctaValuePrefix Type: string (nullable). Size: (0, 20)
CTA introduction text or pricing: Prefix
ctaValue Type: string (nullable). Size: (0, 20)
CTA introduction text or pricing: label
ctaValueSufix Type: string (nullable). Size: (0, 20)
CTA introduction text or pricing: Sufix
resourceIds Type: array(Type: string) (nullable)
Sorted array with the ‘id’ of the PRIMARY Resources that compose the Map (option to replace all the existing ones)
resourceIdsAdd Type: array(Type: string) (nullable)
Sorted array with the ‘id’ of the PRIMARY Resources that compose the Map (option to add Resources to the existing ones)
tourMultiday Type: array(Type: object)
See below schema of properties of tourMultiday items
Array with information of the different days of a multi-day tour map
secondaryResourceIds Type: array(Type: string) (nullable)
Sorted array with the ‘id’ of the SECONDARY Resources that compose the Map (option to replace all the existing ones)
secondaryResourceIdsAdd Type: array(Type: string) (nullable)
Sorted array with the ‘id’ of the SECONDARY Resources that compose the Map (option to add to the existing ones)
poiResourceIds Type: array(Type: string) (nullable)
Sorted array with the ‘id’ of the Resources that complements the Map as POIs (option to replace all the existing ones)
poiResourceIdsAdd Type: array(Type: string) (nullable)
Sorted array with the ‘id’ of the Resources that complements the Map as POIs (option to add to the existing ones)
brandedPoiIds Type: array(Type: string) (nullable)
Sorted array with the ‘id’ of the Resources that acts as branded POIs of the Map (option to replace all the existing ones)
trackResourceId Type: string (nullable)
‘id’ of the Resource of type TRACK that contains information of the route to be shown on the map
mapClusterize Type: boolean (nullable)
Enable clustering of map markers
mapLabel Type: string (nullable). Size: (0, 40)
Map short title-label
customFilterFile Type: uri (nullable)
Custom filter icon (URL to jpg, png or webp file)
customHeaderFile Type: uri (nullable)
Custom header image (URL to jpg, png or webp file)
customBrandedPoiFile Type: uri (nullable)
Custom branded POI icon for its marker (URL to jpg, png or webp file)
customLoaderFile Type: uri (nullable)
Custom loader bouncing image (URL to jpg, png or webp file)
mapLayerType Type: string
Type of geographic map layer to display when the map is initialized
mapMaxAutozoom Type: integer (nullable). Size: (2, 25)
Maximum zoom level applied in the auto-zoom process after applying a filter (Google Maps zoom standard)
mapIsTour Type: boolean (nullable)
Enable tour mode on the Map
trackResourceShowEffort Type: boolean (nullable)
Display the effort information (distance, difficulty, time, elevation, elevation model…) in case there is a TRACK type Resource displayed on the map base (trackResourceId)
mapShowFilter Type: boolean (nullable)
Enable filter controls
mapFilterType Type: string
Filter control configuration
mapFilterCategorySwitch Type: boolean (nullable)
Enable filter controls by Category
mapFilterDifficultySwitch Type: boolean (nullable)
Enable filter controls by difficulty
mapFilterDistanceSwitch Type: boolean (nullable)
Enable filter controls by distance
mapFilterCircularSwitch Type: boolean (nullable)
Enable filter controls by circular
mapFilterCategories Type: array(Type: string) (nullable)
Sorted array of the ‘id’ of the Categories that compose the map filter control. If not specified, the filter is autogenerated with all available Categories in the map content
mapShowList Type: boolean (nullable)
Enables or disables the map Resource gallery
Schema tourMultiday item
dayLabels Type: array(Type: string)
Array of labels indicating the day within the multi-day tour (format: “D1”, “D2”, …)
title Type: string (nullable). Size: (0, 100)
Title of a particular day description in a multi-day tour map
shortDescription Type: string (nullable). Size: (0, 160)
Intro text of a particular day description in a multi-day tour map
htmlContent Type: string (nullable). Size: (0, 32000)
Complete HTML text of a particular day description in a multi-day tour map
image Type: uri (nullable)
Descriptive image of the gallery (URL to jpg, png or webp)
resources Type: array(Type: string) (nullable)
Sorted array with the ‘id’ of the Resources that are visited on a particular day in a multi-day tour map
Language information
This schema includes certain fields which have multiple languages support.
The following fields have multiple languages support:
title
shortDescription
urlAlias
ctaValuePrefix
ctaValue
ctaValueSufix
ctaLabel
mapLabel
tourMultiday.title
tourMultiday.shortDescription
tourMultiday.htmlContent
When you use the name of this fields without the suffix with language you are referring to the field in the default language.
If you want to use a field in a different language, you must add to the field name the language code separated by an underscore (_).
For example, if the proyect have English language and
you want to use the field title
in English language,
you must add the language code en
to the field name as title_en
.