Skip to content

Commit

Permalink
Update api.md for new headers
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <[email protected]>
Signed-off-by: Benjamin Gaussorgues <[email protected]>
  • Loading branch information
artonge authored and Altahrim committed Aug 16, 2023
1 parent c2599cb commit f7b27f8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ A more general documentation how to use the API can be found [here](https://gith
- [Get public keys](#get-public-keys)
- [Delete public keys](#delete-public-keys)
- [Lock file](#lock-file)
- [Unlock file](#unlock-file)
- [Get meta-data file](#get-meta-data-file)
- [Update meta-data file](#update-meta-data-file)
- [Update filedrop property of meta-data file](#update-filedrop-property-of-meta-data-file)
Expand Down Expand Up @@ -345,11 +344,22 @@ e2e-token: if you re-try a previously failed upload, use the token from the firs

First try:

`curl -X POST https://<user>:<password>@<nextcloud>/ocs/v2.php/apps/end_to_end_encryption/api/v1/lock/<file-id> -H "OCS-APIRequest:true"`
````shell
curl https://<user>:<password>@<nextcloud>/ocs/v2.php/apps/end_to_end_encryption/api/v1/lock/10 \
-X POST \
-H "OCS-APIRequest:true" \
-H "X-NC-E2EE-COUNTER:<incremented-counter-from-the-metadata>
```
Retry:
`curl -X POST https://<user>:<password>@<nextcloud>/ocs/v2.php/apps/end_to_end_encryption/api/v1/lock/<file-id> -H "OCS-APIRequest:true"` -d e2e-token="<e2e-token-from-previous-try>"
curl https://<user>:<password>@<nextcloud>/ocs/v2.php/apps/end_to_end_encryption/api/v1/lock/10 \
-X POST \
-H "OCS-APIRequest:true" \
-d "e2e-token:<e2e-token-from-previous-try> \
-H "X-NC-E2EE-COUNTER:<incremented-counter-from-the-metadata>
```
## Unlock file
Expand Down Expand Up @@ -517,6 +527,7 @@ curl "https://<user>:<password>@<nextcloud>/ocs/v2.php/apps/end_to_end_encryptio
-X PUT \
-H "OCS-APIRequest:true" \
-H "e2e-token:<e2e-token-received-during-lock-operation>" \
-H "X-NC-E2EE-SIGNATURE:<metadata-signature>" \
-d metaData="<encrypted-meta-data>"
```
Expand Down

0 comments on commit f7b27f8

Please sign in to comment.