HTTP Error 400 on CreateDocument.ino example #23
-
I was trying out this library using the CreateDocument.ino to create a document in my Firestore but i keep getting HTTP error 400 as a response even though i've already used the right email, password and API key, and also allowed email sign in in my project. Could it be caused by this library or did i do something wrong in my firebase console? `#include <Arduino.h> #include <FirebaseClient.h> #define WIFI_SSID "WIFI_AP" // The API key can be obtained from Firebase console > Project Overview > Project settings. // User Email and password that already registerd or added in your project. #define FIREBASE_PROJECT_ID "PROJECT_ID" void asyncCB(AsyncResult &aResult); void printResult(AsyncResult &aResult); DefaultNetwork network; // initilize with boolean parameter to enable/disable network reconnection UserAuth user_auth(API_KEY, USER_EMAIL, USER_PASSWORD); FirebaseApp app; #if defined(ESP32) || defined(ESP8266) || defined(PICO_RP2040) using AsyncClient = AsyncClientClass; AsyncClient aClient(ssl_client, getNetwork(network)); Firestore::Documents Docs; AsyncResult aResult_no_callback; bool taskCompleted = false; int cnt = 0; void setup()
#if defined(ESP32) || defined(ESP8266) || defined(PICO_RP2040)
} void loop()
} void asyncCB(AsyncResult &aResult)
} void printResult(AsyncResult &aResult)
}` |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
I test with the code above and it works fine. In case of error, the detail of error is already shown, and you have to check. You should update the library to v1.0.12 and try again. if you still get the error, you have to post the full error here. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
You should consult the Firestore REST API documentation instead of asking here. The library provided the classes represent the JSON representation request body and query parameters. For your question, it's a parent resource which obtained from the
|
Beta Was this translation helpful? Give feedback.
You should consult the Firestore REST API documentation instead of asking here.
The library provided the classes represent the JSON representation request body and query parameters.
For your question, it's a parent resource which obtained from the
Parent
class which is under theFirestore
namespace as shown in all library's Firestore examples.Firestore::Parent