Back to top

NGS_CSP V0.4

Notes

All dates used in requests are UTC+00 dates, and formatted in ISO YYYY-MM-DDTHH:mm:ssZ.

Authentication

In order to access the API, you need an authentication token. Each time a User signs-in, a token is generated. You must send it with each subsequent request. Tokens are invalidated when a User signs-out or when a User signs-in again.

The token is featured in the response, in the field authentication_token.

Sign-in

Get a token
POST/users/sign_in

Get an authentication token using a Username, a Password and a NGS identifier.

Request
HideShow
Headers
Content-Type: application/json
Accept: application/json
Body
{
  "user": {
    "email": "nicolas.prat@helileo.com",
    "password": "bobleponge",
    "ngs_id": "NGS_SIMU_2016_1"
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "user_id": "57c6a4c22a227616f229a848",
  "email": "nicolas.prat@helileo.com",
  "status": "ok",
  "authentication_token": "5xZy936CKphiqo5-RFnz",
  "current_ngs_id": "NGS_SIMU_2016_1",
  "current_lis_id": null
}

Sign-out

Release a token
DELETE/users/sign_out

Release an authentication token.

Request
HideShow
Headers
Content-Type: application/json
Accept: application/json
X-User-Email: nicolas.prat@helileo.com
X-User-Token: 5xZy936CKphiqo5-RFnz
Response  200
HideShow
Headers
Content-Type: application/json

Location

Location

Location
POST/location

This request posts an update of the location of the NGS device. The response is the current status of the NGS device.

Parameters
HideShow
lat
string (required) 

the latitude expressed in decimal degree : dd,ddddddd positive means NORTH, negative means SOUTH.

lon
string (required) 

the longitude expressed in decimal degree : dd,dddddd positive means EAST, negative means WEST.

time
string (required) 

the time expressed in ISO 7801 format like 2016-04-26T12:01:02Z in UTC + 0.

alt
string (optional) 

the altitude expressed in MSL Mean Sea Level.

Request
HideShow
Headers
Content-Type: application/json
Accept: application/json
X-User-Email: nicolas.prat@helileo.com
X-User-Token: 5xZy936CKphiqo5-RFnz
Body
{
  "lat": "48.8589507",
  "lon": "2.2775177",
  "time": "2016-07-12T08:36:37.234Z",
  "alt": "7.05"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "NGS_SIMU_2016_1",
  "alt": 7.05,
  "location": [
    2.2775177,
    48.8589507
  ],
  "time": "2016-07-12T08:36:37.234Z"
}

Item

Reason type

Name Description
AWAY The recipient was not present
DOOR_CLOSED The door was closed
OTHER Other reason. A comment is needed.

Pickup an item

Pickup an item
POST/items/{id}/pickup

Pickup an item. The response is the current status of the NGS device.

Parameters
HideShow
id
string (required) 

the identifier of the item

Request
HideShow
Headers
Content-Type: application/json
Accept: application/json
X-User-Email: nicolas.prat@helileo.com
X-User-Token: 5xZy936CKphiqo5-RFnz
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "NGS_SIMU_2016_1",
  "alt": 7.05,
  "location": [
    2.2775177,
    48.8589507
  ],
  "time": "2016-07-12T08:36:37.234Z"
}

Release an item

Release an item
POST/items/{id}/release

Release an item. The response is the current status of the NGS device.

See Reasons.

Parameters
HideShow
id
string (required) 

the identifier of the item

Request
HideShow
Headers
Content-Type: application/json
Accept: application/json
X-User-Email: nicolas.prat@helileo.com
X-User-Token: 5xZy936CKphiqo5-RFnz
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "NGS_SIMU_2016_1",
  "alt": 7.05,
  "location": [
    2.2775177,
    48.8589507
  ],
  "time": "2016-07-12T08:36:37.234Z"
}

Cannot pickup item

Cannot pickup item
POST/items/{id}/cannotPickup

Cannot pickup an item for a specific reason. The response is the current status of the NGS device.

Parameters
HideShow
id
string (required) 

the identifier of the item

reason
string (required) Example: AWAY

the reason why the item cannot be picked up. See the reason table.

comment
string (optional) 

an optional comment from the NGS holder on the reason why the item cannot be picked up

Request
HideShow
Headers
Content-Type: application/json
Accept: application/json
X-User-Email: nicolas.prat@helileo.com
X-User-Token: 5xZy936CKphiqo5-RFnz
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "NGS_SIMU_2016_1",
  "alt": 7.05,
  "location": [
    2.2775177,
    48.8589507
  ],
  "time": "2016-07-12T08:36:37.234Z"
}

Cannot release an item

Cannot release an item
POST/items/{id}/cannotRelease

Cannot release an item for a specific reason. The response is the current status of the NGS device.

Parameters
HideShow
id
string (required) 

the identifier of the item

reason
string (required) 

the reason why the item cannot be delivered. See the reason table.

comment
string (optional) 

an optional comment from the NGS holder on the reason why the item cannot be delivered

Request
HideShow
Headers
Content-Type: application/json
Accept: application/json
X-User-Email: nicolas.prat@helileo.com
X-User-Token: 5xZy936CKphiqo5-RFnz
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "_id": "NGS_SIMU_2016_1",
  "alt": 7.05,
  "location": [
    2.2775177,
    48.8589507
  ],
  "time": "2016-07-12T08:36:37.234Z"
}

Generated by aglio on 13 Sep 2016