Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

MES Web API V3

Error Handling

The MES Web API returns HTTP status codes. The type of error messages returned by a Web API call depend on the type of method called.

Common Status Codes

The MES Web API returns the following common HTTP status codes in the response's header.

200 The call was successful. A valid endpoint was found.

204 The call was successful but no content was returned.

400 Bad Request. The endpoint had a parameter that is of the wrong type or out of range.

403 Forbidden. You do not have permission to make the request.

404 Not Found. The endpoint name is not valid or a required parameter was not provided. This error can also occur if the specified object, say an entity in a GetByKey call, does not exist in the database (the response body will contain the message The specified entity does not exist) or the caller does not have permission to execute the action (the response body will contain the message You do not have the appropriate privileges to access this entity).

405 Method Not Allowed. For example, a PUT on an endpoint was attempted that supports only a GET.

500 Internal server errors that don’t fit in one of the above categories. For example, if the System Management Server on which the AVEVA Identity Manager runs is offline and an authentication token cannot be obtained or verified, a 500 error is returned. Other than this example, a 500 error should be rare.

MES Business Logic Errors

If the call is successfully processed by the MES Web API, it might still encounter an error from the MES business logic. In this case, check the returned error message in the response body as it will contain the message from the MES database or middleware.

For example, the following MES database message was returned because the entity trying to be added using the api/v3/entity Post already exists in the database:

Violation of UNIQUE KEY constraint 'IX_ent'. Cannot insert duplicate key in object 'dbo.ent'. The duplicate key value is (Bagger, <NULL>). The statement has been terminated.

Note that if the error message string is a translatable string, the translated version is returned based on the locale setting of the client making the call.

Log Flags

For a complete list of the flags that can be set to log MES Web API diagnostic information, see "Log Flags for MES Web API Diagnostics" in the MES Middleware User Guide.

In This Topic
TitleResults for “How to create a CRG?”Also Available in