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
+14 -13
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