Db2 Warehouse on Cloud

Live

Db2 Warehouse on Cloud

+ Day(s) remaining in the trial

Overview

Use the Db2 Warehouse on Cloud API to access data, view and create database objects, administer and monitor your Db2 Warehouse on Cloud service. To view previous versions of the REST API documentation, click [V1](https://developer.ibm.com/static/site-id/85/api/dashdb-analytics/) or [V2](https://developer.ibm.com/static/site-id/85/api/db2whc/). ### Db2 Warehouse on Cloud Scaling REST API You can also use the Db2 Warehouse on Cloud Scaling REST API to schedule, delete or view the status of a scale operation of your Db2 Warehouse on Cloud instance. Requests require an IBM Cloud UAA token, the space ID of the instance, and the instance ID. The instance and space IDs are available in the URL of the instance on IBM Cloud. The user attempting to make these API calls must also have developer access to the system. See [Creating a UAA token](https://console.bluemix.net/docs/services/cloud-monitoring/security/auth_uaa.html). ### Security Every request must include the `Authorization` HTTP header with the value `Bearer [access_token]`. An access token can be obtained with the `/auth/tokens` endpoint, and it is used by Db2 Warehouse on Cloud to identify who you are. Db2 Warehouse on Cloud negotiates SSL connections using the TLS v1.2 protocol. If you are using the latest version of cURL, protocol negotiation will happen automatically using TLS v1.2. If you are using an older version of cURL, you will need to specify the `--tlsv1.2` option in your cURL commands.

Security

Keys

Pick a key to use with this API. Make sure you are logged in with your IBM id for your keys to be populated in the dropdown below. By selecting a key, it will be pre-filled for each endpoint in the Documentation section that can be used with the built-in testing. If you want to change which key to use for a particular endpoint, you can do so at the endpoint in the Documentation section.
You can manage your API keys in the <MyAPIs> section. API keys authenticate you to your subscription, so make sure to keep them secret. Do not share the X-IBM-Client-Secret portion of any API key in publicly accessible places such as GitHub, or client-side code.



Manage your keys
 

Documentation

Db2 Warehouse on Cloud:

Authentication

Creates a new authentication policy **ADMIN ONLY**
Creates a new authentication policy which can be used to control password parameters.

POST   /dbapi/v3/auth_policies

			https://db2woc.mybluemix.net/dbapi/v3/auth_policies
		
Keys
Request code
								
curl --request POST \ --url https://db2woc.mybluemix.net/dbapi/v3/auth_policies \ --header 'accept: application/json' \ --header 'authorization: REPLACE_KEY_VALUE' \ --data '{"failed_login_attempts":0,"id":"string","lockout_duration":0,"min_password_length":0,"name":"string","password_expiration":0,"password_history":0}'
Request model

id

STRING , required

Policy ID.

name

STRING , required

A display name for the policy.

password_history

INTEGER , required

Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.

password_expiration

INTEGER , required

Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.

failed_login_attempts

INTEGER , required

Number of failed logins before the user account is locked. If set to 0 the account is not locked and any number of consecutive invalid login attempts are allowed.

lockout_duration

INTEGER , required

Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. It must be a number greater than zero. This parameter has no effect if failed_login_attempts is set to zero.

min_password_length

INTEGER , required

Minimum number of characters for passwords

Request example
{
  "id": string,
  "name": string,
  "password_history": integer,
  "password_expiration": integer,
  "failed_login_attempts": integer,
  "lockout_duration": integer,
  "min_password_length": integer
}
Response model

201

Authentication policy created

Body

count

INTEGER , required

Number of elements

resources [AuthenticationPolicyOUT]

STRING , optional

id

STRING , optional

Policy ID.

name

STRING , optional

A display name for the policy.

password_history

INTEGER , optional

Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.

password_expiration

INTEGER , optional

Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.

failed_login_attempts

INTEGER , optional

Number of failed logins before the user account is locked. If set to 0 the account is not locked and any number of consecutive invalid login attempts are allowed.

lockout_duration

INTEGER , optional

Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. It must be a number greater than zero. This parameter has no effect if failed_login_attempts is set to zero.

min_password_length

INTEGER , optional

Minimum number of characters for passwords

metadata [ResourceMetadata]

STRING , optional

guid

STRING , required

The resource's ID

url

STRING , required

Path to the resource

created_at

STRING , required

Date and time when the resource was created

updated_at

STRING , required

Date and time when the resource was updated

403

Only administrators can execute this operation

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

default

Error payload

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

Response example

201

Authentication policy created

								{
  "count" : integer,
  "resources" : {
    "id" : string,
    "name" : string,
    "password_history" : integer,
    "password_expiration" : integer,
    "failed_login_attempts" : integer,
    "lockout_duration" : integer,
    "min_password_length" : integer,
    "metadata" : {
    "guid" : string,
    "url" : string,
    "created_at" : string,
    "updated_at" : string
  }
  }
}
							

403

Only administrators can execute this operation

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

default

Error payload

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							
Deletes an existing policy **ADMIN ONLY**
Deletes an existing policy. Only administratos can delete policies.

DELETE   /dbapi/v3/auth_policies/{id}

			https://db2woc.mybluemix.net/dbapi/v3/auth_policies/{id}
		
Keys
Path and Query parameters

id

URL , required

ID of the policy to be deleted.

Request code
								
curl --request DELETE \ --url https://db2woc.mybluemix.net/dbapi/v3/auth_policies/{id} \ --header 'accept: application/json' \ --header 'authorization: REPLACE_KEY_VALUE'
Response model

200

Policy deleted

403

Removal of this policy is not allowed

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

404

The policy does not exist

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

default

Error payload

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

Response example

200

Policy deleted

403

Removal of this policy is not allowed

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

404

The policy does not exist

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

default

Error payload

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							
Lists all authentication policies **ADMIN ONLY**
Returns a list of authentication policies.

GET   /dbapi/v3/auth_policies

			https://db2woc.mybluemix.net/dbapi/v3/auth_policies
		
Keys
Request code
								
curl --request GET \ --url https://db2woc.mybluemix.net/dbapi/v3/auth_policies \ --header 'accept: application/json' \ --header 'authorization: REPLACE_KEY_VALUE'
Response model

200

List of authentication policies

Body

id

STRING , optional

Policy ID.

name

STRING , optional

A display name for the policy.

password_history

INTEGER , optional

Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.

password_expiration

INTEGER , optional

Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.

failed_login_attempts

INTEGER , optional

Number of failed logins before the user account is locked. If set to 0 the account is not locked and any number of consecutive invalid login attempts are allowed.

lockout_duration

INTEGER , optional

Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. It must be a number greater than zero. This parameter has no effect if failed_login_attempts is set to zero.

min_password_length

INTEGER , optional

Minimum number of characters for passwords

metadata [ResourceMetadata]

STRING , optional

guid

STRING , required

The resource's ID

url

STRING , required

Path to the resource

created_at

STRING , required

Date and time when the resource was created

updated_at

STRING , required

Date and time when the resource was updated

403

Only administrators can execute this operation

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

default

Error payload

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

Response example

200

List of authentication policies

								[{
  "id" : string,
  "name" : string,
  "password_history" : integer,
  "password_expiration" : integer,
  "failed_login_attempts" : integer,
  "lockout_duration" : integer,
  "min_password_length" : integer,
  "metadata" : {
    "guid" : string,
    "url" : string,
    "created_at" : string,
    "updated_at" : string
  }
}]
							

403

Only administrators can execute this operation

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

default

Error payload

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							
Request a new access token
Authenticates the user credentials and returns an access token that can be used when invoking the operations.

POST   /dbapi/v3/auth/tokens

			https://db2woc.mybluemix.net/dbapi/v3/auth/tokens
		
Keys
Request code
								
curl --request POST \ --url https://db2woc.mybluemix.net/dbapi/v3/auth/tokens \ --header 'accept: application/json' \ --header 'authorization: REPLACE_KEY_VALUE' \ --data '{"password":"string","userid":"string"}'
Request model

userid

STRING , required

The user's ID

password

STRING , required

The user's password

Request example
{
  "userid": string,
  "password": string
}
Response model

200

Authentication token

Body

userid

STRING , required

User ID associated with the generated token.

token

STRING , required

Token string that can be used in subsequent requests that require authentication.

401

Invalid credentials

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

default

Error payload

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

Response example

200

Authentication token

								{
  "userid" : string,
  "token" : string
}
							

401

Invalid credentials

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

default

Error payload

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							
Requests a password reset based on user's email
An email is sent with the password reset link and code. To set a new password, the user can open the link on a web browser, or use the /auth/password endpoint providing the dswebToken. The dswebToken is valid for 12 hours.

POST   /dbapi/v3/auth/reset

			https://db2woc.mybluemix.net/dbapi/v3/auth/reset
		
Keys
Request code
								
curl --request POST \ --url https://db2woc.mybluemix.net/dbapi/v3/auth/reset \ --header 'accept: application/json' \ --header 'authorization: REPLACE_KEY_VALUE' \ --data '{"email":"string","userId":"string"}'
Request model

email

STRING , required

Email address that will receive the password reset instructions and dswebToken

userId

STRING , required

User ID

Request example
{
  "email": string,
  "userId": string
}
Response model

202

Request accepted

Body

400

Invalid or missing email address and userId

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

403

The user name and email address do not match.

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

default

Error payload

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

Response example

202

Request accepted

								
							

400

Invalid or missing email address and userId

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

403

The user name and email address do not match.

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

default

Error payload

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							
Returns an authentication policy **ADMIN ONLY**
Returns an authentication policy.

GET   /dbapi/v3/auth_policies/{id}

			https://db2woc.mybluemix.net/dbapi/v3/auth_policies/{id}
		
Keys
Path and Query parameters

id

URL , required

policy ID

Request code
								
curl --request GET \ --url https://db2woc.mybluemix.net/dbapi/v3/auth_policies/{id} \ --header 'accept: application/json' \ --header 'authorization: REPLACE_KEY_VALUE'
Response model

200

Authentication policy

Body

id

STRING , optional

Policy ID.

name

STRING , optional

A display name for the policy.

password_history

INTEGER , optional

Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.

password_expiration

INTEGER , optional

Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.

failed_login_attempts

INTEGER , optional

Number of failed logins before the user account is locked. If set to 0 the account is not locked and any number of consecutive invalid login attempts are allowed.

lockout_duration

INTEGER , optional

Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. It must be a number greater than zero. This parameter has no effect if failed_login_attempts is set to zero.

min_password_length

INTEGER , optional

Minimum number of characters for passwords

metadata [ResourceMetadata]

STRING , optional

guid

STRING , required

The resource's ID

url

STRING , required

Path to the resource

created_at

STRING , required

Date and time when the resource was created

updated_at

STRING , required

Date and time when the resource was updated

403

Only administrators can execute this operation

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

404

Policy not found

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

default

Error payload

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

Response example

200

Authentication policy

								{
  "id" : string,
  "name" : string,
  "password_history" : integer,
  "password_expiration" : integer,
  "failed_login_attempts" : integer,
  "lockout_duration" : integer,
  "min_password_length" : integer,
  "metadata" : {
    "guid" : string,
    "url" : string,
    "created_at" : string,
    "updated_at" : string
  }
}
							

403

Only administrators can execute this operation

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

404

Policy not found

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

default

Error payload

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							
Sets a new password using dswebToken
Sets a new password using the dswebToken obtained from /auth/reset.

PUT   /dbapi/v3/auth/password

			https://db2woc.mybluemix.net/dbapi/v3/auth/password
		
Keys
Request code
								
curl --request PUT \ --url https://db2woc.mybluemix.net/dbapi/v3/auth/password \ --header 'accept: application/json' \ --header 'authorization: REPLACE_KEY_VALUE' \ --data '{"dswebToken":"string","password":"string"}'
Request model

password

STRING , required

New password

dswebToken

STRING , required

dswebToken received by email

Request example
{
  "password": string,
  "dswebToken": string
}
Response model

200

Password changed

Body

400

Invalid or missing new password

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

403

If dswebToken is missing or invalid

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

default

Error payload

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

Response example

200

Password changed

								
							

400

Invalid or missing new password

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

403

If dswebToken is missing or invalid

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

default

Error payload

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							
Updates an authentication policy **ADMIN ONLY**
Updates an authentication policy.

PUT   /dbapi/v3/auth_policies/{id}

			https://db2woc.mybluemix.net/dbapi/v3/auth_policies/{id}
		
Keys
Path and Query parameters

id

URL , required

policy ID

Request code
								
curl --request PUT \ --url https://db2woc.mybluemix.net/dbapi/v3/auth_policies/{id} \ --header 'accept: application/json' \ --header 'authorization: REPLACE_KEY_VALUE' \ --data '{"failed_login_attempts":0,"id":"string","lockout_duration":0,"min_password_length":0,"name":"string","password_expiration":0,"password_history":0}'
Request model

id

STRING , required

Policy ID.

name

STRING , required

A display name for the policy.

password_history

INTEGER , required

Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.

password_expiration

INTEGER , required

Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.

failed_login_attempts

INTEGER , required

Number of failed logins before the user account is locked. If set to 0 the account is not locked and any number of consecutive invalid login attempts are allowed.

lockout_duration

INTEGER , required

Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. It must be a number greater than zero. This parameter has no effect if failed_login_attempts is set to zero.

min_password_length

INTEGER , required

Minimum number of characters for passwords

Request example
{
  "id": string,
  "name": string,
  "password_history": integer,
  "password_expiration": integer,
  "failed_login_attempts": integer,
  "lockout_duration": integer,
  "min_password_length": integer
}
Response model

200

Authentication policy

Body

id

STRING , optional

Policy ID.

name

STRING , optional

A display name for the policy.

password_history

INTEGER , optional

Number of previously used passwords kept in the history. When a user changes its password, the new password is rejected if it is found in the history. If set to 0 no password history is maintained.

password_expiration

INTEGER , optional

Number of days a password is valid for. After this period, login attempts will be rejected and the users will be required to change their password. If set to 0 passwords will never expire.

failed_login_attempts

INTEGER , optional

Number of failed logins before the user account is locked. If set to 0 the account is not locked and any number of consecutive invalid login attempts are allowed.

lockout_duration

INTEGER , optional

Number of minutes an account will be locked after too many failed login attempts. After this period the account will be automatically unlocked. It must be a number greater than zero. This parameter has no effect if failed_login_attempts is set to zero.

min_password_length

INTEGER , optional

Minimum number of characters for passwords

metadata [ResourceMetadata]

STRING , optional

guid

STRING , required

The resource's ID

url

STRING , required

Path to the resource

created_at

STRING , required

Date and time when the resource was created

updated_at

STRING , required

Date and time when the resource was updated

403

Only administrators can execute this operation

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

404

Policy not found

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

default

Error payload

Body

trace

STRING , required

Unique ID assigned by the server that identifies the request that generated the error

errors [ErrorModel]

STRING , optional

code

STRING , required

Error code succinctly identifying the problem

message

STRING , required

Explanation of the problem and possible solutions

target [ErrorTargetModel]

STRING , optional

more_info

STRING , optional

URL where more information about the error can be found (if available)

type

STRING , required

Field type

name

STRING , required

Name of the problematic field (with dot-syntax if necessary), query parameter, or header

Response example

200

Authentication policy

								{
  "id" : string,
  "name" : string,
  "password_history" : integer,
  "password_expiration" : integer,
  "failed_login_attempts" : integer,
  "lockout_duration" : integer,
  "min_password_length" : integer,
  "metadata" : {
    "guid" : string,
    "url" : string,
    "created_at" : string,
    "updated_at" : string
  }
}
							

403

Only administrators can execute this operation

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

404

Policy not found

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

default

Error payload

								{
  "trace" : string,
  "errors" : {
    "code" : [authentication_failure, database_error, forbidden, internal_server_error, invalid_authentication_token, invalid_content_type, invalid_api_endpoint, invalid_parameters, invalid_request_payload, not_found, resource_already_exists, session_expired, unavailable],
    "message" : string,
    "target" : {
    "type" : [field, parameter, header],
    "name" : string
  },
    "more_info" : string
  }
}
							

Loading content...

Resources