Add

Description

Register a new position. This may be an isolated position or the position of an existing track. Some dumb devices (recording devices) only can record positions using its ID and password, because they can not use more complex protocols for transmitting credentials.

URL

/VERSION/positions/add.FORMAT

Available Format

JSON

HTTP Method

GET

Accepted Version

1

Require

Authorization.

Headers

Parameters

Parameters required for applications (recommended)

  • access_token: (Required) access_token to user resources.

Parameters required for pre-registered dumb devices

  • usr: (Required) registered device identifier.
  • pwd: (Required) registered device password.

Parameters method 1

  • lat: (Required) latitude in decimal degrees of the new position.
  • lng: (Required) in decimal degrees length of the new position.
  • accuracy: (Optional) accuracy of the position (latitude, longitude).
  • vaccuracy: (Optional)accuracy of the elevation.
  • elevation: (Optional) elevation relative to sea level.
  • device: (Optional) pre-registered device id that captured the position. This is a required parameter when the application can handle the physical devices of a user, the default option is disabled.
  • timestamp: (Optional) local time with UTC offset conversion capture the position, according to the ISO 8601 standard.
    • datetime (AAAA-MM-DDThh:mm:sszzzzzz) en UTC
    • example: 1997-07-16T10:30:15.342+03:00
  • velocity: (Optional) movement speed at the instant that the position captured in meters per second
  • postype:(Optional)position type to register
    • 2: TRACK_END : end Track.
    • 3: POS: normal position.
    • 6: ALARM_INIT : alarm init.
    • 7: ALARM_END : alarm end.
    • 8 : GPS_OK : with GPS signal.
    • 9 : GPS_NO : without GPS signal.

The following types of position may be obtained by consulting the position by various methods, but can not be provided as a valid position to kind of record positions.

    • 1: TRACK_INIT: Track init
    • 5: GSM_NO: possible loss of GSM connection
    • 4: GSM_OK:GSM connection recovery
    • 10: TRACK_END_PASSIVE:Track order by session expiration.
  • bearing: (Optional) direction of movement (value between 0 and 360).
  • track: (Optional) Track identifier belonging to the position (except when TRACK_INIT).

Parameters method 2

  • device: (Optional) device that captured the position.
  • nmea:(Optional) GPRMC sentence.

Example

https://api.topoos.com/1/positions/add.json?access_token=62f5280d-c954-4ee7-a0a8-68ff9c2810d8&lat=40.953107&lng=-4.123233&accuracy=0&vaccuracy=0&elevation=0&timestamp=2012-12-05T13%3A11%3A13.198%2B0000&velocity=0&postype=3&bearing=0&track=12678

Reply

JSON example reply

{
    "id": 566814,
    "device": 1,
    "timestamp": "2012-12-05T13:11:13.198+00:00",
    "registerTime": "2012-12-05T13:17:37.136+00:00",
    "latitude": 40.953107,
    "longitude": -4.123233,
    "elevation": 0,
    "position_type": {
        "id": 3,
        "description": "POS"
    },
    "accuracy": 0,
    "vaccuracy": 0,
    "bearing": 0,
    "velocity": 0,
    "track_id": 12678
}