Uploading File to Server

GeoCrew

The GeoView Server REST API enables uploading recorded photo and video files onto server. Please note that each uploaded file gets stored to custom server location, enabling further classification. Accessing this method requires Write permissions.


Transferring files takes following requests sent to REST API:


  1. Obtaining a transfer identifier from server
  2. Uploading a file to server using obtained transfer identifier
  3. Closing transfer session


Request API method URI definitions:


HTTP POST http://api.geoview.be/geoservice/v1/transfers

HTTP POST http://api.geoview.be/geoservice/v1/transfers/<id>

HTTP POST http://api.geoview.be/geoservice/v1/transfers/<id>/close


Obtaining a Transfer Identifier


This API method creates a transfer session on server side, signaling possible collisions (i.e. duplicate files names within single transfer session) and such.


Request API method URI definition:


HTTP POST http://api.geoview.be/geoservice/v1/transfers


Request HTTP URI parameters:


Parameter

Description

token

Access token (returned by this API method).


Request Body structure in JSON format:


Parameter

Type

Description

name

String

File name with extension being uploaded (URL-escaped). This value is mandatory.

cameraid

String

Device/camera ID used to record this file (returned by this API method). This value is optional. If omitted, server will try to recognize device based on recording meta-data.

location

String

Location/address where recording was taken. This value is optional. If omitted, server will try to reverse geo-code location based on recording meta-data.

description

String

Arbitrary description related to this recording. This value is optional.

transport

Integer

Method of transportation used while recording. This value is optional.

weather

Integer

Weather conditions during recording. This value is optional.

daytime

Integer

Time of day at the time of recording. This value is optional.

recording

Array

Array of property IDs and values (whose meta-data were acquired using this API method).


Example HTTP request URI:


HTTP POST http://api.geoview.be/geoservice/v1/transfers?token=3dc718f2-ab20-4f41-86e1-72abcc1810c1


Response JSON structure if API call succeeded:


Field

Description

id

Transfer identifier.

status

Current status of the transfer.


Possible resulting HTTP status codes:


Value

Description

200

API request succeeded and result(s) were returned.

400

API request failed due to wrong parameter value(s).

401

Supplied API request access token not valid.

500

API request failed due to server error.


Uploading File Using Obtained Transfer Identifier


This API method actually uploads a file to the server, using previously acquired transfer session identifier.


Request API method URI definition:


HTTP POST http://api.geoview.be/geoservice/v1/transfers/<id>


Request HTTP URI parameters:


Parameter

Description

token

Access token (returned by this API method).

id

Transfer identifier obtained during previous step (see above).


Few important notes on uploading a file:



Example HTTP request URI:


HTTP POST http://api.geoview.be/geoservice/v1/transfers/95ec2d02-09c5-fd6a-d20a-88df019ac56b?token=3dc718f2-ab20-4f41-86e1-72abcc1810c1


Possible resulting HTTP status codes:


Value

Description

200

API request succeeded and result(s) were returned.

400

API request failed due to wrong parameter value(s).

401

Supplied API request access token not valid.

500

API request failed due to server error.


Acceptable upload file formats:



Closing Transfer Session


This API method closes previously acquired transfer session. Closing a transfer session automatically triggers sending a transfer report e-mail to the user who initiated upload.


Request API method URI definition:


HTTP POST http://api.geoview.be/geoservice/v1/transfers/<id>/close


Request HTTP URI parameters:


Parameter

Description

token

Access token (returned by this API method).

id

Transfer identifier obtained during previous step (see above).


Example HTTP request URI:


HTTP POST http://api.geoview.be/geoservice/v1/transfers/95ec2d02-09c5-fd6a-d20a-88df019ac56b/close?token=3dc718f2-ab20-4f41-86e1-72abcc1810c1


Possible resulting HTTP status codes:


Value

Description

200

API request succeeded and session successfully closed.

400

API request failed due to wrong parameter value(s).

401

Supplied API request access token not valid.

500

API request failed due to server error.


Photo and video recordings uploaded onto server do not immediately show up in queries. GeoView Server performs timed data processing routine which "harvests" newly uploaded files and processes them further. After processing is being done, any valid recordings will get displayed in spatial queries.