Back

[SOLVED] Raw use of document update API

  • 1
  • Databases
  • Cloud
Ivan
10 Aug, 2023, 14:09

I have issue with PATCH request (using the native http library for esp32.) Going trought postman I get the same error.. I constantly get: {"message":"The document payload is missing.","code":400,"type":"document_missing_payload","version":"0.10.51"}

TL;DR
Issue: The user is facing an issue with a PATCH request using the native http library for esp32. They are getting an error message saying "The document payload is missing." Solution: The issue was that the payload should have the data inside a 'data' object. The user should update their code to include the data object in the payload, as shown in the example provided: ```c++ String payload "{\"data\": {\"state\":\""+ stateValue +"\"} }" ``` Reference: [API Documentation](https://appwrite.io/docs/client/databases?sdk=rest-default#databasesUpdateDocument)
Binyamin
10 Aug, 2023, 14:16

The payload should have the data inside a data object, something like this:

TypeScript
String payload "{\"data\": {\"state\":\""+ stateValue +"\"} }"

https://appwrite.io/docs/client/databases?sdk=rest-default#databasesUpdateDocument

Ivan
10 Aug, 2023, 14:20

Thank you again Binyamin!

Ivan
10 Aug, 2023, 14:20

that was the issue πŸ€¦β€β™‚οΈ

Ivan
10 Aug, 2023, 14:21

[SOLVED] Raw use of document update API

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more