/gwc/gwc-api/secto/external

Web services used to inject data into GTM.

/batchInjectPointSectoStart/v2

This query is the start query for injection.

The payload is a JSON Object.

It will contains 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 the associated type. Currently the usable types are:

    • NUMBER for a number
    • STRING for a string

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

Query request body example:

{
        "columns": [
                {"name": "ID"},
                {"name": "NAME"},
                {"name": "SECTOR_CODE"},
                {"name": "SECTOR_NAME"},
                {"name": "LON"},
                {"name": "LAT"},
                {"name": "NB CONTRATS"},
                {"name": "CA"}
        ],
        "indicators": [
                {"indicator": "CA", "valueType": "NUMBER" },
                {"indicator": "NB CONTRATS", "valueType": "NUMBER"}
        ]
}

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.

Query Response example:

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

/batchInjectPointSectoItems

This query inject point or meshes in the sectorization context. This WS is mandatory. It can be call several times, so the caller can cut its data list into several parts.

The payload is a JSON Object.

It will contains 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.

Query 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 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.

Query Response example:

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

/batchInjectSectors

This query inject sectors in 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.

Query 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.

Query Response example :

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

/batchInjectSites

This query inject sites in 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 contains 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.

Query 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 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.

Query Response example :

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

/batchInjectCustomPointsStart

This query start an injection of custom points in the sectorization context. This WS is optional. This service allow an injection of points 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 contains 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

Query 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 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.

Query Response example :

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

/batchInjectCustomPointsItems

This query inject custom points in the sectorization context. This WS is optional. It can be call several times, so the caller can cut its data list into several parts.

The payload is a JSON Object.

It will contains 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.

Query 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 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.

Query Response example:

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

/batchInjectConfiguration

This query inject the configuration in the sectorization context. This WS is optional.

The payload is a JSON Object.

It will contains the following fields:

  • configuration: the configuration object containing the following fields:

    • baseLayerId: name of the base layer to use (only for polygon sectorization). Available layers in 2022:

      • WEUR_2022_PB (Western Europe 2022 - postal boundaries)
      • WEUR_2022_ORDER8 (Western Europe 2022 - communes/cities or districts depending on the country)
      • WEUR_2022_ORDER2 (Western Europe 2022 - states)
      • WEUR_2022_ORDER1 (Western Europe 2022 - regions)
      • WEUR_2021_PB (Western Europe 2021 - postal boundaries)
      • WEUR_2021_ORDER8 (Western Europe 2021 - communes/cities or districts depending on the country)
      • WEUR_2021_ORDER2 (Western Europe 2021 - states)
      • WEUR_2021_ORDER1 (Western Europe 2021 - regions)
      • FR_2020_IRIS (France 2020 - Iris boundaries)
      • FR_2019_IRIS (France 2019 - Iris boundaries)
      • FR__UGA (France - Unités d’Analyse Géographique)
      • NAME_2021_PB (North America 2021 - postal boundaries)
      • NAME_2021_ORDER1 (North America 2021 - states)
      • NAME_2019_PB (North America 2019 - postal boundaries)
      • NAME_2019_ORDER1 (North America 2019 - states)
      • IN_2021_PB (India 2021 - postal boundaries)
    • 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:

      • 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.
  • batchImportedSecto: the batch injection context. The object returned by the start WS can be reused directly.

Query request body example:

{
        "configuration":{
                "baseLayerId":"WEUR_2022_ORDER8",
                "heatMapMode":false,
                "nbSectorsForAutomaticSectorization":0,
                "sectorColorForSingleSector":"#3399cc",
                "displaySectorIds":false,
                "displayMeshIds":false,
                "displayCustomPointIds":false,
                "customPointsStyle":{
                        "strokeColor":"#FFFFFF",
                        "pointRadius":16,
                        "strokeWidth":3,
                        "fill":true,
                        "graphicName":"star",
                        "fillColor":"#0779BF",
                        "fillOpacity":66
                },
                "skins":[
                        {"url":"combo?skins/default.css"}
                ],
                "defaultCountry":"FR"
        },
        "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.

Query Response example:

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

/batchInjectPointSectoEnd

This query end the injection. This WS is mandatory.

The payload is a JSON Object.

It will contains the following field:

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

Query 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 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:

    • 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.

Query 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
                }
        }
}