# Status Request APIs for C and C++

Status Request APIs are used to retrieve the status of an API requested to the server, and to get the error number and a string containing the error details in case there is a request failure.

This page contains information about the Status Request APIs for C and C++, including the description and syntax, and the input, input types, input description, and input return values.

## na_results_status

Prototype

int na_results_status(na_elem_t* elt);

Description

Gets the result status of an API invoked either by na_server_invoke() or na_server_invoke_elem().

Input | Type | Description
elt | na_elem_t * | The pointer to the input output element, which is returned by either na_server_invoke() or na_server_invoke_elem().

Return value

- NA_OK on success

- NA_FAILED on failure

[top]

## na_results_errno

Prototype

int na_results_errno(na_elem_t* elt);

Description

Gets the error number if an API invocation using either na_server_invoke() or na_server_invoke_elem() has failed.

This API is used to determine the error number when the status of API invocation is NA_FAILED.

Input | Type | Description
elt | na_elem_t * | The pointer to the input output element, which is returned by either na_server_invoke() or na_server_invoke_elem().

Return value

- -1 if an API invocation using either na_server_invoke() or na_server_invoke_elem() is successful

- The error number of the failure if an API invocation has failed

[top]

## na_results_reason

Prototype

const char* na_results_reason(na_elem_t* elt);

Description

Gets the reason for failure in a string if an API invocation using either na_server_invoke()or na_server_invoke_elem() has failed.

This API is used to find the reason of the error when the status of API invocation is NA_FAILED.

Input | Type | Description
elt | na_elem_t * | The pointer to the input output element.

Return value

- NULL if an API invocation using either na_server_invoke() or na_server_invoke_elem() is successful

- The error string of the failure if an API invocation has failed

- "Unknown" if an API invocation has failed but the error string is not set