Resources

Resource API: /api/bw/v2/resource

API BW version 2 (Beta)

Allows you to add, update, clone or delete Resources in a Boldest platform account. Among many other things, it can also be used to categorize Resources and assign them to existing Maps.

Methods

POST: Create/Update Resource

  • POST json Data to import in JSON format according to Schema /api/bw/v2/resource/schema.json

Consult the Schema documentation for the structure of the JSON data.

RESULT:

HTTP 200 Skipped. The Resource exists and does not need to be updated

{
  "done": "Skip Resource TEST111",
  "id": "TEST111",
  "new": false,
  "update": false
}

HTTP 201 Created. The Resource did not exist, so it was created

{
  "done": "Create Resource TEST111",
  "id": "TEST111",
  "new": true,
  "update": true
}

HTTP 202 Accepted. The Resource existed, so it was updated

{
  "done": "Update Resource 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 Resource/s

  • /{ids} Id or Ids CSV format (Optional)

  • /mapId/{mapId} Only Resources in Map mapId (Optional) (Default:All)

  • /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 Success

    Resource 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 Resource/s

  • /{ids} Id or Ids CSV format

    RESULT:

    HTTP 202 Deleted

    {
      "done": "Deletion of 5 Resources done",
      "batchId": "22123112345678",
      "count": 5 // Number of Resources deleted
    }
    

    Partial deletion

    {
      "done": "Deletion of 3 Resources done",
      "batchId": "22123112345678",
      "count": 3, // Number of Resources deleted
      "fail": "Deletion of 2 Resources not done",
      "failed": ["TEST114", "TEST115"]
    }
    

    HTTP 400 Wrong request

    {
      "fail": "Wrong request"
    }
    

    HTTP 401 Unauthorized

    {
      "fail": "Unauthorized"
    }
    

    HTTP 404 Not found

    {
      "fail": "No Resources to delete"
    }
    

    HTTP 409 Conflict. The submitted contents are not valid

    {
      "fail": "Deletion of 5 Resources not done"
    }
    

POST: Request the Create/Update of a Resource group in a batch process

  • /batch Command

  • POST json Batch data to import in JSON format according to Schema (schema.multiple.json)

    RESULT:

    HTTP 201 Created. The Resource did not exist, it is created

    {
      "done": "Batch process created",
      "batchId": "22123112345678",
      "count": 123 // Number of Resources 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 Id

    RESULT

    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 Resource TEST111 to clone"
    }
    

POST/GET: Clone a Resource. Optionally can be added to a Map

  • /clone Command

  • /{id} Id (Optional) (Default: Resource “Base” is cloned)

  • /map/{id} Id of Map to be added to (Optional)

    RESULT:

    HTTP 201 Cloned

    {
      "done": "Cloned Resource TEST111 to Resource TEST111_8PtTXiU6mcw",
      "id": "TEST111_8PtTXiU6mcw"
    }
    

    HTTP 400 Wrong request

    {
      "fail": "Wrong request"
    }
    

    HTTP 401 Unauthorized

    {
      "fail": "Unauthorized"
    }
    

    HTTP 404 Error

    {
      "fail": "There is no Resource TEST111 to clone"
    }
    

    HTTP 409 Fail

    {
      "fail": "Not cloned Resource TEST111"
    }
    

GET: Get Schema JSON from the data structure of a Resource

  • /full Schema and data (Optinal)

  • /schema.json JSON schema for import

    RESULT:

    HTTP 200 Success

    JSON schema document

GET: Get Schema JSON schema of a group of Resources in a batch process

  • /full Schema and data (Optinal)

  • /schema.multiple.json Schema for batch import JSON

    RESULT:

    HTTP 200 Success

    JSON schema document

Resource 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 Resource


published Type: boolean

Visibility of the Resource


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 Resource


shortDescription Type: string (nullable). Size: (0, 160)

Snippet describing the Resource in brief


htmlDescription Type: string (nullable). Size: (0, 1000)

Summary paragraph describing the Resource executively (supports HTML)


htmlContent Type: string (nullable). Size: (0, 32000)

Full content describing the Resource (supports HTML)


image Type: uri (nullable)

Featured image representing the Resource (URL to jpg, png or webp)


multimedia Type: array(Type: uri) (nullable)

Sorted array of images for the multimedia gallery of the Resource (URLs to jpg, png or webp files)


multimediaTitle Type: string. Size: (0, 100)

Title of the multimedia gallery of the Resource


urlAlias Type: string. Size: (2, 500)

URL of the Resource (not full URL. Without protocol and domain. Starts with /)


canonicalUrl Type: uri (nullable). Size: (0, 500)

URL of equivalent external Resource


externalUrl Type: uri (nullable). Size: (0, 500)

URL to which the ‘learn more’ button of the Resource points


externalUrlLabel Type: string (nullable). Size: (0, 250)

Label of the ‘learn more’ button that points to externalUrl


redirectLoadTo Type: string (nullable)

Redirect when loading (clicking) a Resource to an external URL, to an internal Map, to a Landing page or do not redirect


locationLat Type: number (nullable). Size: (-90, 90)

Resource location: Latitude


locationLon Type: number (nullable). Size: (-180, 180)

Resource location: Longitude


locationZoom Type: integer (nullable). Size: (2, 25)

Zoom level to which the map can be adjusted when accessing the Resource information (Google Maps format)


mapIds Type: array(Type: string) (nullable)

Array with the ‘id’ of the Maps where this Resource will appear as PRIMARY (and will only appear in them)


mapIdsAdd Type: array(Type: string) (nullable)

Array with the ‘id’ of the Maps where this Resource will appear as PRIMARY (and will preserve existing Map assignments)


mapSecondaryIds Type: array(Type: string) (nullable)

Array with the ‘id’ of the Maps where this Resource will appear as SECONDARY (and will only appear in them)


mapSecondaryIdsAdd Type: array(Type: string) (nullable)

Array with the ‘id’ of the Maps where this Resource will appear as SECONDARY (and will preserve existing Map assignments)


poiResourceIds Type: array(Type: string) (nullable)

Sorted array with the ‘id’ of the Resources to be displayed as complementary POIs when accessing the Resource information (replace existing ones)


poiResourceIdsAdd Type: array(Type: string) (nullable)

Sorted array with the ‘id’ of the Resources to be displayed as complementary POIs when accessing the Resource information (add to existing ones)


hideInList Type: boolean. Default: False

Hide in widget list


resourceType Type: string

Type of Resource


resourceCategories Type: array(Type: string) (nullable)

Sorted array of ‘id’ of the Category terms assigned to the Resource. The first one will define the icon to be displayed over the marker on the Map


resourceRegions Type: array(Type: string) (nullable)

Array of ‘id’ of geographic areas assigned to the Resource


resourceStage Type: array(Type: string) (nullable)

Array of ‘id’ of labels assigned to the Resource. Used as a sticker to highlight Resources with labels for special offers, highlights, etc…


resourceMapLayerType Type: string

Type of geographic map layer to switch to when the Resource is accessed and the map is centered over it


mapLayerFile Type: uri (nullable)

GIS KML layer to overlay on the map when the Resource is accessed and the map is centered over it (URL to a KML or KMZ file up to 2MB)


contactAddress Type: string (nullable). Size: (0, 200)

Street address of the Resource (e.g. ‘25 Matchett St.’)


contactCity Type: string (nullable). Size: (0, 60)

City name where the Resource is located


contactPostalCode Type: string (nullable). Size: (0, 8)

Postal code where the Resource is located


contactProvince Type: string (nullable). Size: (0, 60)

Province / State / Region where the Resource is located


contactPhone Type: string (nullable). Size: (0, 40)

Contact Phone Number related to the Resource


contactEmail Type: email (nullable). Size: (0, 255)

Contact E-mail Address related to the Resource


contactUrl Type: uri (nullable). Size: (0, 2000)

Website URL related to the Resource. Should start with http:// or https://


openingTimes Type: string (nullable). Size: (0, 2000)

Opening times related to the Resource


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, 2000)

URL pointed to by the Resource 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


trackCircular Type: boolean (nullable)

Indicates whether the track is a loop route or not. Only for TRACK type Resources


trackEffortDataShow Type: boolean (nullable)

Display the effort information (distance, difficulty, time, elevation, elevation model…) Only fot TRACK type Resources


trackAltitudeShow Type: boolean (nullable)

Display the track elevation model graph. Only for TRACK resouce files with elevation data in the GPX/KML file


trackHoverShow Type: boolean (nullable)

True: the TRACK Resource is displayed on the map when hovering/tapping on a marker at the starting point of the path. False: the track is always displayed on the map.


trackDurationMinutes Type: integer (nullable). Size: (1, *)

Route duration (minutes). Only for TRACK resouces


trackTravelDistance Type: integer (nullable). Size: (1, *)

Route length (meters). Only for TRACK resouces


trackSlopeUp Type: integer (nullable). Size: (0, *)

Ascent gradient of the route (meters). Only for TRACK resouces


trackSlopeDown Type: integer (nullable). Size: (0, *)

Descent gradient of the route (meters). Only for TRACK resouces


trackDifficulty Type: integer (nullable). Enum: [None, 1, 2, 3, 4, 5]

Difficulty level of the route (1: very low - 5: extreme). Only for TRACK resouces


trackStart Type: string (nullable). Size: (0, 100)

Starting point of the route (name of the place). Only for TRACK resouces


trackEnd Type: string (nullable). Size: (0, 100)

Ending point of the route (name of the place). Only for TRACK resouces


trackFile Type: uri (nullable)

URL from which the track of the route can be imported (GPX or KML file). Only for TRACK resouces


Language information

This schema includes certain fields which have multiple languages support.

The following fields have multiple languages support:

  • title

  • shortDescription

  • htmlDescription

  • htmlContent

  • urlAlias

  • canonicalUrl

  • externalUrl

  • externalUrlLabel

  • ctaLabel

  • openingTimes

  • trackStart

  • trackEnd

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.