julien-nc / cospend-nc

💰 💲hared budget manager Nextcloud app
GNU Affero General Public License v3.0
213 stars 29 forks source link

In API payedFor returns an error #265

Closed Pfeiffenrohr closed 3 months ago

Pfeiffenrohr commented 3 months ago

Since the new version I always get an error when I send a Post request to create a new bill. This worked for me until I updated to version 1.6.1.

The error is: { "ocs": { "meta": { "status": "failure", "statuscode": 400, "message": "" }, "data": { "error": { "payed_for": "Ungültiger Wert" } } } } I attached my request from Postman postman

Pfeiffenrohr commented 3 months ago

I have the same issue with curl: curl --basic -u myname:* -X POST /ocs/v2.php/apps/cospend/api/v1/projects/test2/bills --header 'Accept: application/json, text/plain' --header 'OCS-APIRequest: true' -d "date=2024-03-23&what=raclette&payer=58&payed_for=9&amount=200&repeat=n" 80 {"ocs":{"meta":{"status":"failure","statuscode":400,"message":""},"data":{"error":{"payed_for":"Ung\u00fcltiger Wert"}}}

julien-nc commented 3 months ago

Hi, you were a bit too fast to switch to the new OCS API. payed_for changed to payedFor in the bill creation endpoints in v1.6.1.

You can install the ocs_api_viewer app to browse the Cospend API doc.

Pfeiffenrohr commented 3 months ago

Oh, thanks for this fast answer. I will fix it by me