/gwc/gwc-api/secto/external

Web services used to inject data into GTM.

/getBaseLayers

Retrieves the types of polygonal administrative entities available for a country

This is a GET rest service. The country parameter is the ISO-2 country code of the country you want to work on. This request is useful when working on geographical areas such as postal areas, city areas, etc.

Request example:

/gwc/gwc-api/secto/external/getBaseLayers?country=IN&token=<your temporary execution token>

Response example:

{
        "message": null,
        "status": "OK",
        "result":{
                "baseLayers":[{
                        "id": "IN_2021_PB",
                        "name": "POSTAL AREAS 2021",
                        "listable": true,
                        "order": 297,
                        "rights": null
                }]
        }
}

/batchInjectPointSectoStart/v2

This request is the starting request for injection.

The payload is a JSON Object.

It will contain the following fields:

  • columns: the list of the columns used in the data item WS. The list of predefined column names are:

    • ID: the unique identifier of an item
    • NAME: the name of an item
    • SECTOR_CODE: the sector code
    • SECTOR_NAME: the sector name
    • LON: the longitude of the point (optional in case of meshes sectorization)
    • LAT: the latitude of the point (optional in case of meshes sectorization)
  • indicators: the list of columns used as indicators with

    • valueType: The associated type. Currently the usable types are:

      • "NUMBER", "STRING", "DATE", "DATE_MMDDYY", "DATE_DDMMYY", "DURATION"
    • visible: Boolean to indicate whether the indicator should be visible in the indicator table
    • format: the display format to use in the indicator table. Available display formats are:

      • "INT", "DOUBLE1", "DOUBLE2", "DOUBLE3", "DOUBLE4", "DURATION_HH_MM_SS", "DURATION_HH_MM", "DURATION_DD_HH_MM"

It will return the batch injection context as a JSON object.

Request body example:

{
        "columns": [
                {"name": "ID"},
                {"name": "NAME"},
                {"name": "SECTOR_CODE"},
                {"name": "SECTOR_NAME"},
                {"name": "LON"},
                {"name": "LAT"},
                {"name": "NB CONTRATS"},
                {"name": "CA"},
                {"name": "Visit duration"}
        ],
        "indicators": [
                {"indicator": "CA", "valueType": "NUMBER", "format": "INT"},
                {"indicator": "NB CONTRATS", "valueType": "NUMBER", "format": "INT"},
                {"indicator":"Visit duration","valueType":"NUMBER","visible":true, "format": "DURATION_HH_MM"}
        ]
}

The response is a batch injection context as a JSON object. It will contain the following fields:

  • status: the status (OK or ERROR)
  • message: the error message in case of ERROR.
  • result: the real service result with the following fields:

    • batchImportId: the batch injection session identifier
    • clientId: an optional client identifier, managed by the caller.

Response example:

{
        "message":null,
        "status":"OK",
        "result":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

/batchInjectPointSectoItems

This request injects points or meshes into the sectorization context. This WS is mandatory. It can be called several times, so the caller can cut its data list into several parts.

The payload is a JSON Object.

It will contain the following fields:

  • rows: the rows as an array of indicator object. Each object must have a values field, which contains an array of data, in the same order than the column declaration in the start WS.
  • batchImportedSecto: the batch injection context. The object returned by the start WS can be reused directly.

Request body example:

{
        "rows":[
                {"values":["70","INFOMA","Sector0","PERPIGNAN","2.217761539167103","43.053657468042346","8","4568"]},
                {"values":["694","BSM","Sector0","PERPIGNAN","2.622657102449725","42.67228687522445","8","9043"]},
                {"values":["743","CERN","Sector0","PERPIGNAN","1.9781492901639994","42.4177907105206","12","3328"]},
                ...
        ],
        "batchImportedSecto":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

The response is a batch injection context as a JSON object. It will contain the following fields:

  • status: the status (OK or ERROR)
  • message: the error message in case of ERROR.
  • result: the real service result with the following fields:

    • batchImportId: the batch injection session identifier
    • clientId: an optional client identifier, managed by the caller.

Response example:

{
        "message":null,
        "status":"OK",
        "result":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

/batchInjectSectors

This request injects sectors into the sectorization context. This WS is optional. Using only the batchInjectPointSectoItems WS, all sectors declared (code and name) in the item list will be created. Using this WS, you can create sectors even if no items are assigned to them.

The payload is a JSON Object.

It will contains the following fields:

  • sectors: the sector list as an array of sector items. Each item must have the following fields:

    • sectorId: the sector identifier.
    • sectorName: the sector name.
  • batchImportedSecto: the batch injection context. The object returned by the start WS can be reused directly.

Request body example:

{
        "sectors":[
                {"sectorId":"Sector0","sectorName":"Sector #0"},
                {"sectorId":"Sector1","sectorName":"Sector #1"},
                {"sectorId":"Sector2","sectorName":"Sector #2"},
                {"sectorId":"Sector3","sectorName":"Sector #3"},
                {"sectorId":"Sector4","sectorName":"Sector #4"},
                {"sectorId":"Sector5","sectorName":"Sector #5"},
                {"sectorId":"Sector6","sectorName":"Sector #6"}
        ],
        "batchImportedSecto":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

The response is a batch injection context as a JSON object. It will contains the following fields:

  • status: the status (OK or ERROR)
  • message: the error message in case of ERROR.
  • result: the real service result with the following fields:

    • batchImportId: the batch injection session identifier
    • clientId: an optional client identifier, managed by the caller.

Response example:

{
        "message":null,
        "status":"OK",
        "result":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

/batchInjectSites

This request injects sites into the sectorization context. This WS is optional. This service is only usefull on point sectorization if sites should be managed. In GTM sites are linked with sectors. Only one site by sector can be managed. The site identifier must be the same as its linked sector.

The payload is a JSON Object.

It will contain the following fields:

  • sites: the sites list as an array of site items. Each item must have the following fields:

    • sectorId: the site identifier (same as its linked sector)
    • lon: the longitude of the site point
    • lat: the latitude of the site point
  • batchImportedSecto: the batch injection context. The object returned by the start WS can be reused directly.

Request body example:

{
        "sites":[
                {"sectorId":"Sector0","lon":2.88743,"lat":42.69812},
                {"sectorId":"Sector1","lon":2.3584,"lat":43.21183},
                {"sectorId":"Sector2","lon":3.2161,"lat":43.34423},
                {"sectorId":"Sector3","lon":3.49451,"lat":44.51806},
                {"sectorId":"Sector4","lon":3.873611,"lat":43.611008},
                {"sectorId":"Sector5","lon":4.35611,"lat":43.83002}
        ],
        "batchImportedSecto":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

The response is a batch injection context as a JSON object.

It will contain the following fields:

  • status: the status (OK or ERROR)
  • message: the error message in case of ERROR.
  • result: the real service result with the following fields:

    • batchImportId: the batch injection session identifier
    • clientId: an optional client identifier, managed by the caller.

Response example:

{
        "message":null,
        "status":"OK",
        "result":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

/batchInjectCustomPointsStart

This request starts an injection of custom points into the sectorization context. This WS is optional. This service is used for an injection of points used only for display.

As the injection start WS, this service is available to configure the schema of the custom points data.

The payload is a JSON Object.

It will contain the following fields:

  • columns: the list of the columns used in the data item WS. The list of predefined column names are:

    • ID: the unique identifier of an item
    • NAME: the name of an item
    • LON: the longitude of the point
    • LAT: the latitude of the point
  • indicators: the list of columns used as indicators with the associated type. Currently, the usable types are:

    • NUMBER for a number
    • STRING for a string

Request body example:

{
        "columns":[
                {"name":"ID"},
                {"name":"NAME"},
                {"name":"Postal code"},
                {"name":"Population"},
                {"name":"Mayor"},
                {"name":"LON"},
                {"name":"LAT"}
        ],
        "indicators":[
                {"indicator":"Postal code","valueType":"STRING"},
                {"indicator":"Population","valueType":"NUMBER"},
                {"indicator":"Mayor","valueType":"STRING"}
        ],
        "batchImportedSecto":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

The response is a batch injection context as a JSON object. It will contain the following fields:

  • status: the status (OK or ERROR)
  • message: the error message in case of ERROR.
  • result: the real service result with the following fields:

    • batchImportId: the batch injection session identifier
    • clientId: an optional client identifier, managed by the caller.

Response example:

{
        "message":null,
        "status":"OK",
        "result":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

/batchInjectCustomPointsItems

This request injects custom points into the sectorization context. This WS is optional. It can be called several times, so the caller can cut its data list into several parts.

The payload is a JSON Object.

It will contain the following fields:

  • rows : the rows as an array of indicator object. Each object must have a values field, which contains an array of data, in the same order than the column declaration in the start WS.
  • batchImportedSecto : the batch injection context. The object returned by the start WS can be reused directly.

Request body example :

{
        "rows":[
                {"values":["12202","Rodez","12000",86373,"Christian Teyssèdre",2.569682,44.357216]},
                {"values":["13055","Marseille","13000",861635,"Jean-Claude Gaudin",5.376804,43.302321]}
        ],
        "batchImportedSecto":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

The response is a batch injection context as a JSON object. It will contain the following fields:

  • status: the status (OK or ERROR)
  • message: the error message in case of ERROR.
  • result: the real service result with the following fields:

    • batchImportId: the batch injection session identifier
    • clientId: an optional client identifier, managed by the caller.

Response example:

{
        "message":null,
        "status":"OK",
        "result":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

/batchInjectConfiguration/v2

This request injects the configuration into the sectorization context. This WS is optional.

The payload is a JSON Object.

It will contain the following fields:

  • configuration: the configuration object containing the following fields:

    • baseLayerId: name of the base layer to use (only for polygon sectorization). In order to check which values are available for your country, please use the getBaseLayers call beforehand.
    • heatMapMode: choose if the default visibility is the heat map or points on map.
    • nbSectorsForAutomaticSectorization: Default number of sectors to generate in the automatic sectorization form. This parameter has no effect in case of sectorization with sites
    • sectorColorForSingleSector: Select the color of the unique sector in case of the injection manage only one sector.
    • displaySectorIds: display the sectors identifiers in tables
    • displayMeshIds: display the meshes identifiers in tables
    • displayCustomPointIds: display the custom points identifiers
    • customPointsStyle: style for custom points. The style contains the following fields:
    • displayThematicId: display by default the thematic identified by the provided id

      • strokeColor: the stroke color (#RRGGBB hexadecimal format)
      • pointRadius: the point radius (integer)
      • strokeWidth: the stroke width (integer)
      • fill: fill the geometry (boolean)
      • graphicName: the graphic geometry,
      • fillColor: the fill color (#RRGGBB hexadecimal format)
      • fillOpacity: the fill opacity (integer between 0 and 100, 100 is opaque)
    • skins: an array of css URL, used to reskin the interface.
    • defaultCountry: the default country used for meshes sectorization.
  • thematics: Description of one or more thematics to create and show over the map. The array of properties to set are:

    • id: thematic ID (used for displayThematicId for example)
    • name: String to name the thematic in the thematic editor
    • params: JSON string defining the thematic, with the following structure:

      • indicatorId: Field ID (as string) of the indicator the thematic is based on
      • name: String to name the thematic in the thematic editor
      • layerOpacity: Opacity in percent of the thematic layer when drawn over the map (only for studies on geographical areas)
      • legendVariableSize: Boolean indicating whether the thematic’s legend should show graphics with variable sizes depending on sizes set, or always of the same size
      • defaultStyle: Set of style properties defining how to show the appearance of points for the default category

        • values: Array of string values for which the style should apply for string type indicators. Always empty ([]) for the default style. Set it to empty ([]) if the indicator is numeric
        • valuesBounds: optional property which should only be set when the indicator is numeric. Array of properties defining a range of values of the numeric indicator for which the style should apply:

          • includeMin: boolean indicating whether the min value is included or not in the range
          • <min value>: numeric value indicating the minimum of the range
          • includeMax: boolean indicating whether the max value is included or not in the range
          • <max value>: numeric value indicating the maximum of the range
        • graphic: Symbol to use for point representation (image files cannot be used, as no user-specific images cannot be loaded in API mode)

          • graphicName: Symbol shape name. Can be CIRCLE, SQUARE, TRIANGLE, TRIANGLE_INVERTED, STAR, STAR4, STAR6, RECTANGLE, RECTANGLE_INVERTED, DIAMOND2, DIAMOND2_INVERTED, ELLIPSE or ELLIPSE_INVERTED.
          • fillColor: HTML-coded color to use for drawing the symbol (studies on points) or for drawing the geographical areas (studies on areas)
          • sizePercent: Size in percents to use for drawing the symbol (betwwen 0 and 700)
        • styles: Array of style properties defining for each range of values the point drawing style
  • batchImportedSecto: the batch injection context. The object returned by the start WS can be reused directly.

Request body example for a point sectorization:

{
        "configuration":{
                "heatMapMode":false,
                "nbSectorsForAutomaticSectorization":0,
                "sectorColorForSingleSector":"#3399cc",
                "displaySectorIds":false,
                "displayMeshIds":false,
                "displayCustomPointIds":false,
                "displayThematicId":"them1",
                "customPointsStyle":{
                        "strokeColor":"#FFFFFF",
                        "pointRadius":16,
                        "strokeWidth":3,
                        "fill":true,
                        "graphicName":"star",
                        "fillColor":"#0779BF",
                        "fillOpacity":66
                },
                "onlineGuideUrl":"https://cdn.walkme.com/users/681fb1035b334767b6e5db4ae8b68ef9/test/walkme_681fb1035b334767b6e5db4ae8b68ef9_https.js",
                "skins":[
                        {"url":"combo?skins/default.css"}
                ],
                "defaultCountry":"FR",
        },
        "thematics":[{
                "id":"them1",
                "name":"Thematic 1-string indicator",
                "params":"{\"indicatorId\":\"IND_1\",\"name\":\"Thematic 1\",\"layerOpacity\":100,\"legendVariableSize\":false,\"defaultStyle\":{\"values\":[],\"graphic\":{\"graphicName\":\"CIRCLE\",\"fillColor\":\"#888888\",\"sizePercent\":10}},\"styles\":[{\"values\":[\"Value1\"],\"graphic\":{\"graphicName\":\"STAR\",\"fillColor\":\"#ff0000\",\"sizePercent\":100}},{\"values\":[\"Value2\"],\"graphic\":{\"graphicName\":\"SQUARE\",\"fillColor\":\"#000000\",\"sizePercent\":100}}]}"
        },
        {
                "id":"them2",
                "name":"Thematic 2-numeric indicator",
                "params":"{\"indicatorId\":\"IND_2\",\"name\":\"Thematic 2\",\"layerOpacity\":100,\"legendVariableSize\":false,\"defaultStyle\":{\"values\":[],\"graphic\":{\"graphicName\":\"STAR6\",\"fillColor\":\"#888888\",\"sizePercent\":10}},\"styles\":[{\"values\":[],\"graphic\":{\"graphicName\":\"STAR\",\"fillColor\":\"#ff0000\",\"sizePercent\":50},"valuesBounds":{"includeMin":true,"min":0,"includeMax":false,"max":294}},{\"values\":[],\"graphic\":{\"graphicName\":\"STAR6\",\"fillColor\":\"#ff0000\",\"sizePercent\":150},"valuesBounds":{"includeMin":true,"min":294,"includeMax":true,"max":754}}]}"
        }],
        "batchImportedSecto": {
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

Request body example for point aggregation mode (using postal areas layers as the target geographical area layer):

{
        "configuration":{
                "heatMapMode":false,
                "nbSectorsForAutomaticSectorization":0,
                "sectorColorForSingleSector":"#3399cc",
                "displaySectorIds":false,
                "displayMeshIds":false,
                "displayCustomPointIds":false,
                "displayThematicId":false,
                "customPointsStyle":{},
                "onlineGuideUrl":"https://cdn.walkme.com/users/681fb1035b334767b6e5db4ae8b68ef9/test/walkme_681fb1035b334767b6e5db4ae8b68ef9_https.js",
                "skins":[
                        {"url":"combo?skins/default.css"}
                ],
                "defaultCountry":"FR",
        },
        "thematics":[],
        "pointToPolygonAggrSettings":{
                "baseLayerId": "WEUR_2024_PB",
                "polygonIdColumn": "...",
                "useCoordinatesToAssign": true,
                "visitsDurationColumn": "...",
                "visitsFrequencyColumn": "..."
        },
        "batchImportedSecto": {
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

The response is a batch injection context as a JSON object. It will contain the following fields:

  • status: the status (OK or ERROR)
  • message: the error message in case of ERROR.
  • result: the real service result with the following fields:

    • batchImportId: the batch injection session identifier
    • clientId: an optional client identifier, managed by the caller.

Response example:

{
        "message":null,
        "status":"OK",
        "result":{
                "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
                "clientId":null
        }
}

/batchInjectPointSectoEnd

This request ends the injection. This WS is mandatory.

The payload is a JSON Object.

It will contain the following field:

  • batchImportedSecto: the batch injection context. The object returned by the start WS can be reused directly.

Request body example:

{
        "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
        "clientId":null
}

The response is a set of data of the created sectorization context. It will contain the following fields:

  • status: the status (OK or ERROR)
  • message: the error message in case of ERROR.
  • result: the real service result with the following fields:

    • layer: the layer used by the sectorization
    • token: the temporary session token used for IFrame injection.
    • sectoDataId: the sectorization data identifier,
    • sectoId: the sectorization identifier
    • lineErrors: an array of errors found in the point/meshes injection
    • stats: statistics about the injection. This is a statistic JSON object with the following fields :

      • sectorCount: number of injected sectors
      • meshCount: number of injected point/meshes
      • hasSite: does the sectorization have sites or not.
      • siteCount: the number of injected sites
      • hasFatal: check if there’s at least a fatal error.

Response example:

{
        "message":null,
        "status":"OK",
        "result":{
                "layer":null,
                "token":"6fb3b611-1803-4ab4-8814-87de1c0979fc",
                "sectoDataId":"16",
                "sectoId":"3b3487ea-d6b4-402c-8967-d3171b2833e4",
                "lineErrors":[],
                "stats":{
                        "sectorCount":7,
                        "meshCount":1436,
                        "hasSite":true,
                        "siteCount":6,
                        "hasFatal":false
                }
        }
}

TODO

/batchImportAsynSectoEnd

/batchImportAsynSectoEnd

Same as batchInjectPointSectoEnd but runs the process in asynchronous mode.

The POST payload is a JSON Object.

It will contain the following field:

  • batchImportedSecto: the batch injection context. The object returned by the start WS can be reused directly.

Request body example:

{
        "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
        "clientId":null
}

The response is a set of data of the created sectorization context.

Response example:

{
        "message": null,
        "status": "OK",
        "result":{
                "layer": null,
                "token": null,
                "sectoDataId": null,
                "sectoId": null,
                "lineErrors": null,
                "stats": null,
                "executeId": "0f02bf55-1555-4e9a-9d6a-893c4bac8dcc",
                "state": "RUNNING",
                "totalToProcess": 0,
                "processed": 0
        }
}

/batchImportAsynSectoEndStatus

Retrieves the status of the asynchronous injection process

The POST payload is a JSON Object.

It will contain the following field:

  • batchImportedSecto: the batch injection context. The object returned by the start WS can be reused directly.

Request body example:

{
        "batchImportId":"9733e237-8aad-4d2a-9e18-efbccc78bc85",
        "clientId":null
}

The response will indicate if the injection process is running, or over. Once the process is over ("OK" status response), you can call the /gtmintegrationauth web service to display the results in an IFrame.

Response example:

{
"message": null,
"status": "OK",
"result": null
}