> For AI agents: [llms.txt](https://docs.trustedauth.com/llms.txt) provides a Markdown index of this documentation.

# Get Offline Token Responses

`POST /api/web/v1/self/tokens/offline`

Get Offline Token Responses

## Request Body

Required.

### application/json

Schema

```json
{
  "required": [
    "applicationId",
    "tokenProtectedOfflineParms",
    "tokenSerialNumber"
  ],
  "type": "object",
  "properties": {
    "applicationId": {
      "type": "string"
    },
    "tokenProtectedOfflineParms": {
      "type": "object",
      "properties": {
        "tokenProtectedOfflineOTPClientName": {
          "type": "string",
          "description": "The name sent by the client."
        },
        "tokenProtectedOfflineOTPClientSecret": {
          "type": "string",
          "description": "One or several secrets sent by the client concatenated to a single array.",
          "format": "byte"
        },
        "tokenProtectedOfflineOTPDoNotOptimize": {
          "type": "boolean",
          "description": "Flag indicating whether the number of OTPs being returned need to be optimized."
        },
        "tokenProtectedOfflineOTPGet": {
          "type": "string",
          "description": "The different levels of protection for offline tokens.",
          "enum": [
            "NONE",
            "MINOR",
            "MAJOR",
            "CUSTOM"
          ]
        },
        "tokenProtectedOfflineOTPSize": {
          "type": "integer",
          "description": "Request size (Units of hour or count).",
          "format": "int32"
        }
      },
      "description": "The model used to generate the offline token.",
      "title": "TokenProtectedOfflineParms"
    },
    "tokenSerialNumber": {
      "type": "string"
    }
  },
  "description": "Information used to get offline responses for a token assigned to a user.",
  "title": "GetOfflineTokenAuthenticateParms"
}
```

## Responses

### 200

Successful

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "firstMovingFactor": {
      "type": "integer",
      "description": "This is the moving factor index for the first hashed OTP returned. In the case of time-based tokens, it represents time step, otherwise it represents the value of the counter.",
      "format": "int64"
    },
    "iterations": {
      "type": "integer",
      "description": "The number of iterations of the hash function to be performed.",
      "format": "int32"
    },
    "maxSizeInUnits": {
      "type": "integer",
      "description": "This is the policy-configured maximum number (hours or counters)",
      "format": "int32"
    },
    "maxTimeSteps": {
      "type": "integer",
      "description": "This is the max number of time steps used to validate a token.",
      "format": "int32"
    },
    "minorSizeInUnits": {
      "type": "integer",
      "description": "This is the policy-configured recommended number (hours or counters)",
      "format": "int32"
    },
    "otps": {
      "type": "string",
      "description": "An array of all of the OTPs returned in the batch, each with its public component of the salt."
    },
    "privateSaltLength": {
      "type": "integer",
      "description": "The number of digits in the private part of the salt that the client must guess.",
      "format": "int32"
    },
    "resultOptimized": {
      "type": "boolean",
      "description": "Flag indicating if the set of OTP hashes returned was optimized so that OTPs which have already been downloaded in prior requests, but that have no yet expired, are not sent again."
    },
    "timeDrift": {
      "type": "integer",
      "description": "This is the token time drift in seconds. This applies only to time-based tokens.",
      "format": "int32"
    },
    "timeInterval": {
      "type": "integer",
      "description": "If this contains a positive value then this batch is for time-based tokens, otherwise it is for event based tokens.",
      "format": "int32"
    },
    "tokenSerialNumber": {
      "type": "string",
      "description": "The serial number of the token for which offline tokens are generated."
    },
    "useSecret": {
      "type": "string",
      "description": "The secret the client should use when requesting the next batch of protected offline OTPs.",
      "format": "byte"
    }
  },
  "description": "Used to return batches of protected OTPs for a given token",
  "title": "OfflineTokenAuthenticateResponse"
}
```

### 400

Bad Request

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 401

Access denied

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 403

Forbidden

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 404

Not Found

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```

### 409

Conflict

#### application/json

Schema

```json
{
  "type": "object",
  "properties": {
    "errorCode": {
      "type": "string",
      "description": "Error Codes specific to cause of failure.",
      "example": "invalid_user_response"
    },
    "errorMessage": {
      "type": "string",
      "description": "Additional Error Message describing the error.",
      "example": "Application id cannot be null"
    },
    "parameters": {
      "type": "array",
      "description": "Optional additional error information.",
      "items": {
        "type": "object",
        "description": "Optional additional error information."
      }
    }
  },
  "description": "Object containing information about errors reported by services.",
  "title": "ErrorInfo"
}
```
