Fixing broken link, adding notes to Integrating IODC

This commit is contained in:
auke
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 ## Getting started
The main starting point for Farmmaps API access is the REST API. 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 ### 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 * https://accounts.farmmaps.awtest.nl/.well-known/openid-configuration
#### Note #### 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. 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** **Request**
Replace `<acces token>` with your actual token. Replace `<acces token>` with your actual token.
``` ```http
GET https://farmmaps.awacc.nl/api/v1/folders/my_drive? HTTP/1.1 GET https://farmmaps.awacc.nl/api/v1/folders/my_drive? HTTP/1.1
Host: farmmaps.awacc.nl Host: farmmaps.awacc.nl
Accept: application/json Accept: application/json
@@ -27,7 +27,7 @@ Authorization: Bearer <access token>
**Response** **Response**
The response will be something similar to: The response will be something similar to:
``` ```http
HTTP/1.1 200 OK HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu) Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 21 Apr 2020 09:57:07 GMT Date: Tue, 21 Apr 2020 09:57:07 GMT
@@ -52,13 +52,13 @@ Vary: Accept-Encoding
Accept: application/json Accept: application/json
Authorization: Bearer <access token> Authorization: Bearer <access token>
Content-Type: application/json Content-Type: application/json
So the `parentcode` we need is: **f25d8765a1cd407cb235961c73c268cf:USER_FILES** Cache-Control: no-cache
Host: farmmaps.awacc.nl Host: farmmaps.awacc.nl
Accept-Encoding: gzip, deflate, br Accept-Encoding: gzip, deflate, br
Connection: keep-alive Connection: keep-alive
Content-Length: 115 Content-Length: 115
``` ```
**Response** **Response**
If all went well, we should recieve a response with status code 201, indicating that a new file was registered. If all went well, we should recieve a response with status code 201, indicating that a new file was registered.
@@ -78,7 +78,7 @@ Content-Length: 115
``` ```
For files larger than 2 MB we also need to specify the chunksize (`chunkSize`): For files larger than 2 MB we also need to specify the chunksize (`chunkSize`):
```http ```http
``` POST /api/v1/file HTTP/1.1
Accept: application/json Accept: application/json
Authorization: Bearer <access token> Authorization: Bearer <access token>
Content-Type: application/json Content-Type: application/json
@@ -102,7 +102,7 @@ Vary: Accept-Encoding
Cache-Control: no-store,no-cache Cache-Control: no-store,no-cache
Pragma: no-cache Pragma: no-cache
Content-Encoding: br Content-Encoding: br
``` Location: /api/v1/file/f319e9c6bfe3493cba1a888f6292f00a
Vary: Accept-Encoding Vary: Accept-Encoding
``` ```
@@ -112,6 +112,7 @@ Host: farmmaps.awacc.nl
The body of the request contains the data of the chunk. For uploading the first chunk, we can use the request below. The body of the request contains the data of the chunk. For uploading the first chunk, we can use the request below.
Subsequent chunks can be uploaded by increading the chunk number at the end and adding the next chunk in the body. Subsequent chunks can be uploaded by increading the chunk number at the end and adding the next chunk in the body.
**Request**
```http ```http
POST /api/v1/file/9c27d92fd44e43cf975275a2bec5c5f5/chunk/1 HTTP/1.1 POST /api/v1/file/9c27d92fd44e43cf975275a2bec5c5f5/chunk/1 HTTP/1.1
Accept: application/json Accept: application/json
@@ -121,8 +122,8 @@ Content-Length: 147
Accept-Encoding: gzip, deflate, br Accept-Encoding: gzip, deflate, br
Connection: keep-alive Connection: keep-alive
Content-Type: multipart/form-data; boundary=--------------------------272838473781934324854095 Content-Type: multipart/form-data; boundary=--------------------------272838473781934324854095
The response now shows the amount of chunks that we'll need to send (`"chunks":7"). Content-Length: 1048788
``` ----------------------------272838473781934324854095
Content-Disposition: form-data; name="Chunk"; filename="sampledata2_1.csv" Content-Disposition: form-data; name="Chunk"; filename="sampledata2_1.csv"
<sampledata2_1.csv> <sampledata2_1.csv>
@@ -152,7 +153,7 @@ The body of the request contains the data of the chunk. For uploading the first
Transfer-Encoding: chunked Transfer-Encoding: chunked
Connection: keep-alive Connection: keep-alive
Cache-Control: no-store,no-cache Cache-Control: no-store,no-cache
``` Pragma: no-cache
Content-Encoding: br Content-Encoding: br
Location: /api/v1/item/9c27d92fd44e43cf975275a2bec5c5f5 Location: /api/v1/item/9c27d92fd44e43cf975275a2bec5c5f5
Vary: Accept-Encoding Vary: Accept-Encoding
@@ -171,7 +172,7 @@ Content-Disposition: form-data; name="Chunk"; filename="sampledata2_1.csv"
Connection: keep-alive Connection: keep-alive
``` ```
This will return the file as an attachment: This will return the file as an attachment:
``` ```http
HTTP/1.1 200 OK HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu) Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 21 Apr 2020 16:05:25 GMT Date: Tue, 21 Apr 2020 16:05:25 GMT
@@ -184,7 +185,7 @@ Pragma: no-cache
``` ```
**Troubleshooting** **Troubleshooting**
``` |Status code|Description|
|---|---| |---|---|
|200|Chunk was uploaded| |200|Chunk was uploaded|
|201|All chunks from file have been uploaded| |201|All chunks from file have been uploaded|
@@ -201,7 +202,7 @@ Vary: Accept-Encoding
### Downloading the uploaded file ### 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. 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 GET /api/v1/items/9c27d92fd44e43cf975275a2bec5c5f5/data HTTP/1.1
Accept: application/json Accept: application/json
Authorization: Bearer <acces token> Authorization: Bearer <acces token>
@@ -211,7 +212,7 @@ Accept-Encoding: gzip, deflate, br
Connection: keep-alive Connection: keep-alive
``` ```
This will return the file as an attachment: This will return the file as an attachment:
``` ```http
HTTP/1.1 200 OK HTTP/1.1 200 OK
Server: nginx/1.14.0 (Ubuntu) Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 21 Apr 2020 16:05:25 GMT Date: Tue, 21 Apr 2020 16:05:25 GMT