This is the structure that clients need to follow to send and receive data from backend. In the future we will have swagger documentation, but for now you can check this contract rules. The capitalization to use is camel case.
Always the payload must include a wrapper object called data
{ data: "Object || Array" }
Always the http code will be 2xx. Pagination object is included only when apply.
{ success: true, data: "Object || Array", pagination?: { totalRecords: "number", totalPages: "number", page: "number", take: "number", skip: "number" } }
When the response contains an error, the http code will be 4xx or 5xx
json { success: false, error: "String", details: { "[key]": "String", errorSource: "Internal error type", } }
Pagination params will be used in GET requests if apply.
json { page?: "number", take?: "number", }
Frontend needs to get the token using auth.currentUser.getIdToken()
. It will be send in the request's headers for all dashboard request.
json { headers: { "Authorization": "Bearer FIREBASE_ID_TOKEN", "Client": "Dasboard", } }