Debugging

Learn how to debug if you are not obtaining the expected results from the API Response.

Not retrieving the records?

Try to the following debugging steps.


1. check the output in Terminal

If the output returned in your Terminal starts with {"error": ... , then your request is not correct and Morph API returned an error message as a response.

The error subCode, message and detail will give you some indications on what is wrong or is missing in your request.

For example, if you delete the content of the data in the body parameters, the output in your Terminal will display the following error.


Example of wrong request

curl --X POST "https://42d54rt5-d389-845a-6lkq-34z563gtu872.api.morphdb.io/v0/record/dw5g1h89-2637-253k-452b-7803j4x7e3vi/employee/query" \
--header "Content-Type: application/json" \
--header "client-type: widget" \
--header "x-api-key: ms5sCDEOVNuIw92MNA3qLKih4xzY25D9PQY6D7Az2" \
--data "{}
"

Response with error message

Error displayed in your Terminal:

{
  "error":"request_error",
  "subCode":4,
  "message":"Invalid request body",
  "detail":[
    {
      "code":"invalid_type",
      "expected":"array",
      "received":"undefined",
      "path":[
        "select"
      ],
      "message":"Required"
    }
  ]
}

2. Correct your cURL and try again

Try to correct your request using the error message as guidance, and run the cURL command again in your Terminal.


3. Review the tutorial steps

If you're stuck again, we invite you to check that you have followed the tutorial steps correctly. And then try again to run the cuRL command in your Terminal.


4. Still stuck?

If you're still experiencing an issue, then feel free to ask for help in Morph community on Discord. The Morph Team or some community members will be there to help.

You can also contact our sales support team via the contact form on the homepage: https://www.morphdb.io.