< Back to API menu

New PPP survey

First, create the survey and the related rovers.

POST http://api.rinexlab.com/v1/ppp/surveys

The authentication token has to be included as a bearer token in the request headers.

The request body is JSON content with the survey and rovers details. The rovers list must be a list even if there is only one of them. Please note that rovers must be all created here. You can't add one to the survey afterwards.

{
    "token": <ppp_token>,
    "datum": <datum>,
    "name": <survey_name>,
    "rovers": [
        {
            "antenna_height": <antenna_height>,
            "data_format": <data_format>,
            "mode": <mode>,
            "name": <rover_name>
        },
		..., # up to 4 rover objects
    ]
}

With :

  • ppp_token (str) : the PPP token you subscribed. It must be valid and have some remaining credits ;
  • datum (str) : the survey datum. Accepted values are itrf2014etrf2000;
  • survey_name (str) : the name of the survey ; MUST be a unique value
  • antenna_height (float) : antenna height of the rover in meters ;
  • data_format (str) : format of the rover raw data. Accepted values are auto, ubx (Ublox / Emlid), lei (Leica Geosystems), tr (Trimble), sbf (Septentrio), rinex (RINEX) ;
  • mode (str) : positioning mode. Accepted values are kinematic, static ;
  • rover_name (str) : name of the rover.

The maximum number of rovers is 4 per survey.

The server response is expected to be a code 201 with the following JSON content.

{
    "created_at": <creation_datetime>,
    "datum": <datum>,
    "id": <survey_id>,
    "name": <survey_name>,
    "rovers": [
        {
            "antenna_height": <antenna_height>,
            "data_format": <data_format>,
            "file": <rover_file>,
            "id": <rover_id>,
            "mode": <mode>,
            "name": <rover_name>,
            "results": <rover_results>,
            "status": <rover_status>
        }
    ]
}

With :

  • creation_datetime (str) : time of creation, formatted in "%Y-%m-%d %H:%M:%S" ;
  • datum (str) : the survey datum ;
  • survey_id (int) : the unique ID of the survey ;
  • antenna_height (float) : antenna height of the rover in meters ;
  • data_format (str) : format of the rover raw data that is to be uploaded ;
  • file (str) : the URL of the raw data file - at this point it is empty because it has not been uploaded yet, see below ;
  • rover_id (int) : the unique ID of the rover ;
  • mode (str) : positioning mode ;
  • rover_name (str) : name of the rover ;
  • rover_results (str) : the URL of the results file - at this point it is empty because no process has been done yet ;
  • rover_status (int) : the status of the rover processing. Possible values are -1 (recorded without file yet), 0 (pending), 1 (processing), 2 (done), 3 (failed). 

Here is an example in Python 3.x

import requests

host = 'http://api.rinexlab.com'
version = 'v1'

auth_token = 'ey...Ugs' # token retrieved from the login process
ppp_token = 'jf8...12e' # PPP token you subscribed
datum = 'etrf2000'

r = requests.post(f'{host}/{version}/ppp/surveys',
	json={
		"token": ppp_token,
		"datum": datum,
		"name": "my new PPP survey",
		"rovers": [
			{
				"antenna_height": 0.0,
				"data_format": "auto",
				"mode": "kinematic",
				"name": "ROVER1"
			}
		]
	},
headers={'Authorization': f'Bearer {auth_token}'}
)
survey = r.json()
print(survey)

 

Add raw data files to the survey

At this point the survey object is created, but no process can be done. Upload the raw data file to each of the rover with a POST request. The data to upload have to be in the key called "file" in the form-data.

POST http://api.rinexlab.com/v1/ppp/surveys/<survey_id>/rovers/<rover_id>/file

The server response is expected to be a code 201 with the following JSON content. This is a rover object.

{
    "antenna_height": <antenna_height>,
    "data_format": <data_format>,
    "file": <rover_file>,
    "id": <rover_id>,
    "mode": <mode>,
    "name": <rover_name>,
    "results": <rover_results>,
    "status": 0
}

The file key is not empty anymore. It is a protected Amazon S3 URL. The process is started automatically as soon as a file has been uploaded for every rover of the same parent survey.

Here is an example of how to post a rover file in Python 3.x

import requests

host = 'http://api.rinexlab.com'
version = 'v1'

auth_token = 'ey...Ugs' # token retrieved from the login process

r = requests.post(f'{host}/{version}/ppp/surveys/<survey_id>/rovers/<rover_id>/file',
	files={
		'file': open('<file_name>', 'rb')
	},
headers={'Authorization': f'Bearer {auth_token}'}
)
rover = r.json()
print(rover)

Retrieve PPP surveys

GET http://api.rinexlab.com/v1/ppp/surveys

You can search a survey based on its name like this.

GET http://api.rinexlab.com/v1/ppp/surveys?search=<survey_name>

It's a matching search so you may input only the first characters of the survey name.

Here is a survey search example in Python 3.x.

import requests

host = 'http://api.rinexlab.com'
version = 'v1'

auth_token = 'ey...Ugs' # token retrieved from the login process

r = requests.get(f'{host}/{version}/ppp/surveys',
	params={
		"search": <survey_name>
	},
headers={'Authorization': f'Bearer {auth_token}'}
)

print(r.json())

Retrieve the details of a PPP survey

GET http://api.rinexlab.com/v1/ppp/surveys/<survey_id>

Retrieve the details of a rover

GET http://api.rinexlab.com/v1/ppp/surveys/<survey_id>/rovers/<rover_id>

Download the PPP results

GET http://api.rinexlab.com/v1/ppp/surveys/<survey_id>/rovers/<rover_id>/results

< Back to API menu