> ## Documentation Index
> Fetch the complete documentation index at: https://developers.authlete.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Handling Responses from Authlete API

> Handling responses from Authlete API and the importance of processing based on the action parameter rather than the resultCode value.

Most of Authlete APIs make a response that includes "action" parameter. On implementing an authorization server with Authlete, there is a principle of processing; making a request to one of Authlete's APIs, parsing a response from the API, checking a value of "action" in the response and processing in accordance with the value.

> You **NEVER** use a value of resultCode as condition of processing.

For example, an response from [/auth/authorization](/api-reference/authorization-endpoint/process-authorization-request) API includes either the following values in "action" field:

* BAD\_REQUEST
* FORM
* INTERACTION
* INTERNAL\_SERVER\_ERROR
* LOCATION
* NO\_INTERACTION

**action=INTERACTION** indicates that an authorization request is valid. Your authorization server is expected to generate a webpage (HTML) to authenticate a user and ask his/her consent, send the webpage to the user's Web browser,  and do some interaction with him/her. Once the auth process is done successfully, your authorization server will make a request to [/auth/authorization/issue](/api-reference/authorization-endpoint/issue-authorization-response) API. if unsuccessful (e.g. the user cancelled the process), the server will do a request to [/auth/authorization/fail](/api-reference/authorization-endpoint/fail-authorization-request) API instead. (cf. [Ticket Parameter in Authorization Endpoint](/configuration-reference/endpoints/ticket-parameter-in-authorization-endpoint) ）

**action=BAD\_REQUEST** indicates that an authorization request is invalid and your authorization server should make a "400 Bad Request" response to Web browser. The response will be like this:

```
HTTP/1.1 400 Bad Request
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache

(Add responseContent value here)
```

**action=LOCATION** indicates that your authorization server is expected to make a "302 Found" response to Web browser. The response will be like this:

```
HTTP/1.1 302 Found
Location: (Add responseContent value here)
Cache-Control: no-store
Pragma: no-cache
```
