# API Response

[](https://help.qlik.com/talend/en-US/talend-data-catalog/Content/developer-guide/application-programming-interface-rest-api/api-response.htm)

All API methods with a few exceptions return a JSON

> ResponseObject

in the following format:

```
{
"result": "...",
"error": {
    "errorCode": "...",
    "message": "..."
    }
}
```

In general, if a GET method, or sometimes a POST method, is executed successfully, the

> result

property will contain the data it retrieved. If a PUT or DELETE method is executed successfully, the

> result

property will usually be an empty string.

If any API method failed during execution, the

> result

property will be an empty string and the

> error

property will contain an error code and an error message.

Following are a few common error codes:

* AUTHENTICATION\_ERROR

* OBJECT\_NOT\_FOUND

* INVALID\_REPOSITORY\_PATH

* REQUIRED\_PARAMETER\_NOT\_SPECIFIED

* INVALID\_PARAMETER

* OPERATION\_NOT\_SUPPORTED

* SERVER\_ERROR

* LICENSE\_ERROR

Some API methods may produce more than one content type. For example,

`POST /operations/repositoryImport/downloadModelAttachment`

produces content type `application/x-download` when an attachment file is downloaded successfully or application/json if there is an error. You need to set your request Accept header appropriately to receive the response.

If you get a Response Code 500 with such a function that may produce more than one media type, try to switch the media type from one to the other, for example, from `application/x-download` to `application/json`.