GuidesAPI Reference
Guides

How to contribute measurements to fix invalid GNSS info

📘

Note

HERE Network Positioning API v1 is in maintenance and is not actively developed. Use HERE Network Positioning API v2 to get the latest features and updates. To learn more, see the HERE Network Positioning API v2 Developer Guide.

User Story

The user wants to improve the responses for requests to the locate resource by contributing cellular measurements from a device that is inside a car moving fast on a highway. This example has a contribute request with GSM information together with an invalid gnss location. The response demonstrates the importance of validating measurements on the client side and of providing only curated quality measurements. For additional tips on how to enhance accuracy, see Tips for Optimizing Data Accuracy.

Request

The code block below demonstrates a POST request to contribute the GSM and GNSS information in the POST body.

https://pos.ls.hereapi.com/positioning/v1/contribute?apiKey={YOUR_API_KEY}

You need to set request content type in the HTTP headers:

Content-Type: application/json

This POST request requires the following POST body.

{
  "client":{
    "manufacturer":"maker-of-the-device",
    "platform":"platform-of-the-device",
    "name":"client-name",
    "version":"1.1.10107",
    "model":"XYZ-123",
    "firmware": "1.2.3",
    "homenetwork": [
      {
        "mcc": 262,
        "mnc": 501
      }
    ]
  },
  "contributions":[
    {
      "gsm":[
        {
          "mcc":262,
          "mnc":501,
          "lac":29589,
          "cid":19373,
          "timestamp":"2016-06-30T14:10:34Z"
        },
        {
          "mcc":262,
          "mnc":501,
          "lac":29589,
          "cid":19323,
          "timestamp":"2016-06-30T14:10:33Z"
        }
      ],
      "position":{
        "type":"gnss",
        "lat":52.501608,
        "lng":13.403481,
        "accuracy":13,
        "alt":68,
        "altaccuracy":95,
        "speed": 125,
        "course": 40,
        "satellitecount": 9,
        "timestamp":"2016-06-30T14:10:32Z"
      }
    }
  ]
}

Response

The response to the request includes the error code and a detailed description of why the request was rejected.

{
  "error": {
    "code": 400,
    "message": "Bad Request",
    "description": "'speed' must be less than or equal to 60"
  }
}

Related Information