Create Secret Key

post

/oaa/runtime/totp/key/v1/

Use this API to create a TOTP secret key for a user.

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/xml ()
Root Schema : schema
Type: object
Details for creating a secret key for a user.
Show Source
Request Body - application/json ()
Root Schema : schema
Type: object
Details for creating a secret key for a user.
Show Source
Back to Top

Response

Supported Media Types

201 Response

Secret key has been created.
Body ()
Root Schema : SecretKey
Type: object
A user's secret key.
Show Source

400 Response

Bad Request

401 Response

Unauthorized

403 Response

Could not register secret key
Body ()
Root Schema : SecretKeyAPIResponse
Type: object
Show Source

422 Response

Requested user information not found
Body ()
Root Schema : SecretKeyAPIResponse
Type: object
Show Source

500 Response

Internal server error
Body ()
Root Schema : SecretKeyAPIResponse
Type: object
Show Source

503 Response

Service Unavailable
Body ()
Root Schema : SecretKeyAPIResponse
Type: object
Show Source
Back to Top

Examples

The following example shows a sample request and response for creating a Time-based One Time Password (TOTP) secret key for a user.

cURL Command to Create a TOTP in JSON Format

curl --location --request POST '<OAAService>/oaa/runtime/totp/key/v1/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \
--data '{
    "groupName": "testfinanceapp4",
    "userName": "testuser4",
    "deviceName": "secretKeyApiTest"
}'

Sample Response in JSON Format

{"secret_key": "4Z5CQ6ET3KB22YV2"}

cURL Command to Create a TOTP in XML Format

curl --location --request POST '<OAAService>/oaa/runtime/totp/key/v1/' \
--header 'Content-Type: application/xml' \
--header 'Accept: application/xml' \
--header 'Authorization: Basic <Base64Encoded(<username>:<password>)>' \
--data '<?xml version="1.0" encoding="UTF-8" ?>
 <CreateSecretKeyRequest>
     <groupName>testfinanceapp4</groupName>
     <userName>testuser4</userName>
     <deviceName>secretKeyApiTest</deviceName>
 </CreateSecretKeyRequest>'

Sample Response in XML Format

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <SecretKey>
     <secret_key>4Z5CQ6ET3KB22YV2</secret_key>
 </SecretKey>
Back to Top