Fixing broken link, adding notes to Integrating IODC

master
Auke Sytsma 2020-04-24 11:50:38 +02:00
parent 8f63248a6a
commit 9a289b3683
3 changed files with 22 additions and 16 deletions

View File

@ -4,7 +4,8 @@ This page provides an index of the available documentation for the FarmMaps plat
## Getting started
The main starting point for Farmmaps API access is the REST API.
To get started, follow the steps below. The workflow and high-level architecture FarmMaps are documented on the [Farmmaps Workflow](/wiki/Workflow) and [FarmMaps Main Components](/wiki/Main-components) pages.
To get started, follow the steps below.
The workflow and high-level architecture FarmMaps are documented on the [Farmmaps Workflow](/wiki/Workflow) and [FarmMaps Main Components](/wiki/Main-components) pages.
### Environments

View File

@ -15,9 +15,13 @@ To configure your library with the right settings, you'll need the Farmmaps Open
* https://accounts.farmmaps.awtest.nl/.well-known/openid-configuration
#### Note
* *At the moment, FarmMaps does not support dynamic client registration.
* At the moment FarmMaps only supports the OpenID Connect **"explicit" flow type**.
More about flow types can be found [here](https://www.scottbrady91.com/OpenID-Connect/OpenID-Connect-Flows).
* At the moment, FarmMaps does not support dynamic client registration.
Please request a client id from one of our developers when you need one for your application.
In the meantime, it is recommended to simply [generate an access token]() to explore the REST API.*
In the meantime, it is recommended to simply [generate an access token]() to explore the REST API.

View File

@ -17,7 +17,7 @@ We'll first retrieve this parentcode using a GET request.
**Request**
Replace `<acces token>` with your actual token.
```
```http
GET https://farmmaps.awacc.nl/api/v1/folders/my_drive? HTTP/1.1
Host: farmmaps.awacc.nl
Accept: application/json
@ -27,7 +27,7 @@ Authorization: Bearer <access token>
**Response**
The response will be something similar to:
```
```http
HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 21 Apr 2020 09:57:07 GMT
@ -52,13 +52,13 @@ Vary: Accept-Encoding
}
```
So the `parentcode` we need is: **f25d8765a1cd407cb235961c73c268cf:USER_FILES**
So the `parentcode` we need is **"f25d8765a1cd407cb235961c73c268cf:USER_FILES"**
We can now register the file. In the request to register the upload, we specify its parent (`parentCode`),
the filename (`name`), and the size in bytes (`size`) in the body.
**Request**
```
```http
POST /api/v1/file HTTP/1.1
Accept: application/json
Authorization: Bearer <access token>
@ -78,7 +78,7 @@ Content-Length: 115
**Response**
If all went well, we should recieve a response with status code 201, indicating that a new file was registered.
```
```http
HTTP/1.1 201 Created
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 21 Apr 2020 10:08:56 GMT
@ -102,7 +102,7 @@ Vary: Accept-Encoding
}
```
For files larger than 2 MB we also need to specify the chunksize (`chunkSize`):
```
```http
POST /api/v1/file HTTP/1.1
Accept: application/json
Authorization: Bearer <access token>
@ -112,6 +112,7 @@ Host: farmmaps.awacc.nl
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Content-Length: 147
{
"parentCode": "f25d8765a1cd407cb235961c73c268cf:USER_FILES",
"name": "sampledata2.csv",
@ -121,8 +122,8 @@ Content-Length: 147
```
**Response**
The response now shows the amount of chunks that we'll need to send (`"chunks":7").
```
The response now shows the amount of chunks that we'll need to send ("chunks":7).
```http
HTTP/1.1 201 Created
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 21 Apr 2020 14:27:05 GMT
@ -152,7 +153,7 @@ The body of the request contains the data of the chunk. For uploading the first
Subsequent chunks can be uploaded by increading the chunk number at the end and adding the next chunk in the body.
**Request**
```
```http
POST /api/v1/file/9c27d92fd44e43cf975275a2bec5c5f5/chunk/1 HTTP/1.1
Accept: application/json
Authorization: Bearer <access token>
@ -171,7 +172,7 @@ Content-Disposition: form-data; name="Chunk"; filename="sampledata2_1.csv"
**Response**
The response should show a 200 status code, confirming that the chunk was recieved succesfully:
```
```http
HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 21 Apr 2020 15:07:19 GMT
@ -184,7 +185,7 @@ Pragma: no-cache
When uploading the final chunk of the file a 201 status code should be returned.
This indicates all chunks have been uploaded. The file will now be ready for further processing.
```
```http
HTTP/1.1 201 Created
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 21 Apr 2020 15:21:01 GMT
@ -201,7 +202,7 @@ Vary: Accept-Encoding
### Downloading the uploaded file
To verify that your file was uploaded and re-assembled correctly you can download the file using a simple GET request.
```
```http
GET /api/v1/items/9c27d92fd44e43cf975275a2bec5c5f5/data HTTP/1.1
Accept: application/json
Authorization: Bearer <acces token>
@ -211,7 +212,7 @@ Accept-Encoding: gzip, deflate, br
Connection: keep-alive
```
This will return the file as an attachment:
```
```http
HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 21 Apr 2020 16:05:25 GMT