Update README.md with API documentation and examples

This commit is contained in:
2024-10-08 23:46:04 +02:00
parent 0c88635169
commit 6d8718b057

View File

@@ -1,3 +1,50 @@
# nextcloud_forms_api_testing # nextcloud_forms_api_testing
--created with create_repo.py ich probiere hier ein wenig mit der API von Nextcloud Forms rum.
## Generals
copied from [APIDokumentation][APIDocs]
- Base URL for all calls to the forms API is `<nextcloud_base_url>/ocs/v2.php/apps/forms`
- All Requests need to provide some authentication information.
- Cookies?
- Headers?
- All Requests to OCS-Endpoints require the Header `OCS-APIRequest: true`
- Unless otherwise specified, all parameters are mandatory.
- By default, the API returns data formatted as _xml_. If formatting as _json_ is desired, the request should contain the header `Accept: application/json`. For simple representation, the output presented in this document is all formatted as _json_.
- The OCS-Endpoint _always returns_ an object called `ocs`. This contains an object `meta` holding some meta-data, as well as an object `data` holding the actual data. In this document, the response-blocks only show the `data`, if not explicitely stated different.
```json
"ocs": {
"meta": {
"status": "ok",
"statuscode": 200,
"message": "OK"
},
"data": <Actual data>
}
```
## Header
hier sammle ich, was alles in den Header muss/soll
```plaintext
OCS-APIRequest: true
Accept: application/json
```
## Beispiele
```bash
GET cloud.pfadfindenby.de/ocs/v2.php/apps/forms/api/v3/forms[?type=owned]
```
## Referenzen
[API Dokumentation][APIDocs]
[APIDocs]: https://github.com/nextcloud/forms/blob/main/docs/API_v3.md