Introduction

Use the Db2 Warehouse on Cloud API to access data, view and create database objects, administer, and monitor your Db2 Warehouse on Cloud service.

Root URL

The context root for the Db2 Warehouse on Cloud API is /dbapi/v4/.

Error handling

This API uses standard HTTP response codes to indicate whether a method completed successfully. A 200 response indicates success. A 400 type response is some sort of failure.

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.

Some api methods (for example: /schemas and /sql_jobs) also support direct access to the database using HTTP headers.

For example:

X-DB-Userid:[database_user],
X-DB-Password:[database_password],
X-DB-URL:jdbc:db2://[host]:[port]/[database]:[property] for Db2 data sources
add dataservertype (DB2LUW, DB2Z) in property, if dataservertype key
for Db2 data source is not specified, the default is DB2LUW.

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.

Methods

Request a new access token

Authenticates the user credentials and returns an access token that can be used when invoking the operations.

POST /auth/tokens

Request

User credentials

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth/tokens"
    
    	payload := strings.NewReader("{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth/tokens")
      .post(body)
      .addHeader("content-type", "application/json")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth/tokens",
      "headers": {
        "content-type": "application/json"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({userid: '<ADD STRING VALUE>', password: '<ADD STRING VALUE>'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"userid\":\"<ADD STRING VALUE>\",\"password\":\"<ADD STRING VALUE>\"}"
    
    headers = { 'content-type': "application/json" }
    
    conn.request("POST", "/dbapi/v4/auth/tokens", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/auth/tokens   -H 'content-type: application/json'   -d '{"userid":"<ADD STRING VALUE>","password":"<ADD STRING VALUE>"}'

Response

Token generated after successful authentication.

Status Code

  • Authentication token

  • Invalid credentials

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns public key of Json Web Token

Returns public key of Json Web Token.

GET /auth/token/publickey

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth/token/publickey"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth/token/publickey")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth/token/publickey",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/auth/token/publickey", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/auth/token/publickey   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Public key of token.

Status Code

  • Token public key and key id.

No Sample Response

This method does not specify any sample responses.

Perform logout operation for a token

Perform logout operation for a token.

DELETE /auth/token/logout

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth/token/logout"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth/token/logout")
      .delete(null)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth/token/logout",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/auth/token/logout", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/auth/token/logout   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Logout successfully.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Creates a new authentication policy **ADMIN ONLY**

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

POST /auth_policies

Request

Authentication policy

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth_policies"
    
    	payload := strings.NewReader("{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth_policies")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth_policies",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      id: 'this_id_is_ignored',
      name: 'test_policy',
      password_history: 5,
      password_expiration: 30,
      failed_login_attempts: 6,
      lockout_duration: 30,
      min_password_length: 15
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/auth_policies", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/auth_policies   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"id":"this_id_is_ignored","name":"test_policy","password_history":5,"password_expiration":30,"failed_login_attempts":6,"lockout_duration":30,"min_password_length":15}'

Response

Collection of authentication policies

Status Code

  • Authentication policy created

  • Only administrators can execute this operation

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists all authentication policies **ADMIN ONLY**

Returns a list of authentication policies.

GET /auth_policies

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth_policies"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth_policies")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth_policies",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/auth_policies", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/auth_policies   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Policy defining user's password rules.

Status Code

  • List of authentication policies

  • Only administrators can execute this operation

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns an authentication policy **ADMIN ONLY**

Returns an authentication policy.

GET /auth_policies/{id}

Request

Path Parameters

  • policy ID

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth_policies/Default"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth_policies/Default")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth_policies/Default",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/auth_policies/Default", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/auth_policies/Default   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Policy defining user's password rules.

Status Code

  • Authentication policy

  • Only administrators can execute this operation

  • Policy not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Updates an authentication policy **ADMIN ONLY**

Updates an authentication policy.

PUT /auth_policies/{id}

Request

Path Parameters

  • policy ID

Authentication policy

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth_policies/{id}"
    
    	payload := strings.NewReader("{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth_policies/{id}")
      .put(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth_policies/{id}",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      id: 'this_id_is_ignored',
      name: 'test_policy',
      password_history: 5,
      password_expiration: 30,
      failed_login_attempts: 6,
      lockout_duration: 30,
      min_password_length: 15
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"id\":\"this_id_is_ignored\",\"name\":\"test_policy\",\"password_history\":5,\"password_expiration\":30,\"failed_login_attempts\":6,\"lockout_duration\":30,\"min_password_length\":15}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("PUT", "/dbapi/v4/auth_policies/{id}", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/auth_policies/{id}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"id":"this_id_is_ignored","name":"test_policy","password_history":5,"password_expiration":30,"failed_login_attempts":6,"lockout_duration":30,"min_password_length":15}'

Response

Policy defining user's password rules.

Status Code

  • Authentication policy

  • Only administrators can execute this operation

  • Policy not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Deletes an existing policy **ADMIN ONLY**

Deletes an existing policy.

Only administratos can delete policies.

DELETE /auth_policies/{id}

Request

Path Parameters

  • ID of the policy to be deleted.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth_policies/{id}"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth_policies/{id}")
      .delete(null)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth_policies/{id}",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/auth_policies/{id}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/auth_policies/{id}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Policy deleted

  • Removal of this policy is not allowed

  • The policy does not exist

  • Error payload

No Sample Response

This method does not specify any sample responses.

Sets a new password using dswebToken

Sets a new password using the dswebToken obtained from /auth/reset.

PUT /auth/password

Request

New password and dswebToken

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth/password"
    
    	payload := strings.NewReader("{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth/password")
      .put(body)
      .addHeader("content-type", "application/json")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth/password",
      "headers": {
        "content-type": "application/json"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({password: '<ADD STRING VALUE>', dswebToken: '<ADD STRING VALUE>'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"password\":\"<ADD STRING VALUE>\",\"dswebToken\":\"<ADD STRING VALUE>\"}"
    
    headers = { 'content-type': "application/json" }
    
    conn.request("PUT", "/dbapi/v4/auth/password", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/auth/password   -H 'content-type: application/json'   -d '{"password":"<ADD STRING VALUE>","dswebToken":"<ADD STRING VALUE>"}'

Response

Status Code

  • Password changed

  • Invalid or missing new password

  • If dswebToken is missing or invalid

  • Error payload

No Sample Response

This method does not specify any sample responses.

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 /auth/reset

Request

User's email address and ID

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/auth/reset"
    
    	payload := strings.NewReader("{\"email\":\"<ADD STRING VALUE>\",\"userId\":\"<ADD STRING VALUE>\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"email\":\"<ADD STRING VALUE>\",\"userId\":\"<ADD STRING VALUE>\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/auth/reset")
      .post(body)
      .addHeader("content-type", "application/json")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/auth/reset",
      "headers": {
        "content-type": "application/json"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({email: '<ADD STRING VALUE>', userId: '<ADD STRING VALUE>'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"email\":\"<ADD STRING VALUE>\",\"userId\":\"<ADD STRING VALUE>\"}"
    
    headers = { 'content-type': "application/json" }
    
    conn.request("POST", "/dbapi/v4/auth/reset", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/auth/reset   -H 'content-type: application/json'   -d '{"email":"<ADD STRING VALUE>","userId":"<ADD STRING VALUE>"}'

Response

Status Code

  • Request accepted

  • Invalid or missing email address and userId

  • The user name and email address do not match.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get a list of backups

Get a list of backups from current instance.

GET /backups

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups")
      .get()
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/backups", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/backups   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • The list of backups

  • Bad request

  • Unauthorized

  • Internal server error

No Sample Response

This method does not specify any sample responses.

Restore

Restore to a particular backup.

POST /backups/restore

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups/restore"
    
    	payload := strings.NewReader("{\"backup_id\":\"202010050805\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"backup_id\":\"202010050805\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups/restore")
      .post(body)
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups/restore",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({backup_id: '202010050805'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"backup_id\":\"202010050805\"}"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/backups/restore", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/backups/restore   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"backup_id":"202010050805"}'

Response

Status Code

  • Task detail of the restore job

  • Bad request

  • Unauthorized

  • Internal server error

No Sample Response

This method does not specify any sample responses.

Create a backup

Create a backup

POST /backups/backup

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups/backup"
    
    	req, _ := http.NewRequest("POST", url, nil)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups/backup")
      .post(null)
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups/backup",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/backups/backup", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/backups/backup   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Delete a backup

Delete a backup

DELETE /backups/{id}

Request

Path Parameters

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups/2020100508051122"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups/2020100508051122")
      .delete(null)
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups/2020100508051122",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/backups/2020100508051122", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/backups/2020100508051122   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Get backup setting

Get backup setting for scheduled time and retention policy

GET /backups/setting

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups/setting"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups/setting")
      .get()
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups/setting",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/backups/setting", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/backups/setting   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Update backup setting

update backup setting for scheduled backup time or retention policy

POST /backups/setting

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/backups/setting"
    
    	payload := strings.NewReader("{\"backup_time\":\"08:05\",\"retention\":7}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("accept", "application/json")
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"backup_time\":\"08:05\",\"retention\":7}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/backups/setting")
      .post(body)
      .addHeader("accept", "application/json")
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/backups/setting",
      "headers": {
        "accept": "application/json",
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({backup_time: '08:05', retention: 7}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"backup_time\":\"08:05\",\"retention\":7}"
    
    headers = {
        'accept': "application/json",
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/backups/setting", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/backups/setting   -H 'accept: application/json'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"backup_time":"08:05","retention":7}'

Response

Status Code

  • OK

  • Bad request

  • Unauthorized

  • Unexpected error

No Sample Response

This method does not specify any sample responses.

Creates a data load job, load uses external table technology

Creates a data load job

POST /load_jobs_ET

Request

Data load job details

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs_ET"
    
    	payload := strings.NewReader("{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"cloud_source\":{\"endpoint\":\"<ADD STRING VALUE>\",\"path\":\"<ADD STRING VALUE>\",\"auth_id\":\"<ADD STRING VALUE>\",\"auth_secret\":\"<ADD STRING VALUE>\"},\"server_source\":{\"file_path\":\"<ADD STRING VALUE>\"},\"file_options\":{\"encoding\":\"<ADD STRING VALUE>\",\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"string_delimiter\":\"DOUBLE\",\"date_style\":\"<ADD STRING VALUE>\",\"time_style\":\"<ADD STRING VALUE>\",\"date_delimiter\":\"<ADD STRING VALUE>\",\"date_format\":\"<ADD STRING VALUE>\",\"time_format\":\"<ADD STRING VALUE>\",\"timestamp_format\":\"<ADD STRING VALUE>\",\"bool_style\":\"1_0 (this is the default)\",\"ignore_zero\":true,\"require_quotes\":\"<ADD STRING VALUE>\",\"ctrl_chars\":\"<ADD STRING VALUE>\",\"escape_char\":\"<ADD STRING VALUE>\"}}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"cloud_source\":{\"endpoint\":\"<ADD STRING VALUE>\",\"path\":\"<ADD STRING VALUE>\",\"auth_id\":\"<ADD STRING VALUE>\",\"auth_secret\":\"<ADD STRING VALUE>\"},\"server_source\":{\"file_path\":\"<ADD STRING VALUE>\"},\"file_options\":{\"encoding\":\"<ADD STRING VALUE>\",\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"string_delimiter\":\"DOUBLE\",\"date_style\":\"<ADD STRING VALUE>\",\"time_style\":\"<ADD STRING VALUE>\",\"date_delimiter\":\"<ADD STRING VALUE>\",\"date_format\":\"<ADD STRING VALUE>\",\"time_format\":\"<ADD STRING VALUE>\",\"timestamp_format\":\"<ADD STRING VALUE>\",\"bool_style\":\"1_0 (this is the default)\",\"ignore_zero\":true,\"require_quotes\":\"<ADD STRING VALUE>\",\"ctrl_chars\":\"<ADD STRING VALUE>\",\"escape_char\":\"<ADD STRING VALUE>\"}}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs_ET")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs_ET",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      load_source: 'SERVER',
      load_action: 'INSERT',
      schema: '<ADD STRING VALUE>',
      table: '<ADD STRING VALUE>',
      max_row_count: 0,
      max_warning_count: 1000,
      auto_create_table: {execute: 'yes', column_names: ['<ADD STRING VALUE>']},
      cloud_source: {
        endpoint: '<ADD STRING VALUE>',
        path: '<ADD STRING VALUE>',
        auth_id: '<ADD STRING VALUE>',
        auth_secret: '<ADD STRING VALUE>'
      },
      server_source: {file_path: '<ADD STRING VALUE>'},
      file_options: {
        encoding: '<ADD STRING VALUE>',
        code_page: '<ADD STRING VALUE>',
        has_header_row: 'no',
        column_delimiter: ',',
        string_delimiter: 'DOUBLE',
        date_style: '<ADD STRING VALUE>',
        time_style: '<ADD STRING VALUE>',
        date_delimiter: '<ADD STRING VALUE>',
        date_format: '<ADD STRING VALUE>',
        time_format: '<ADD STRING VALUE>',
        timestamp_format: '<ADD STRING VALUE>',
        bool_style: '1_0 (this is the default)',
        ignore_zero: true,
        require_quotes: '<ADD STRING VALUE>',
        ctrl_chars: '<ADD STRING VALUE>',
        escape_char: '<ADD STRING VALUE>'
      }
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"cloud_source\":{\"endpoint\":\"<ADD STRING VALUE>\",\"path\":\"<ADD STRING VALUE>\",\"auth_id\":\"<ADD STRING VALUE>\",\"auth_secret\":\"<ADD STRING VALUE>\"},\"server_source\":{\"file_path\":\"<ADD STRING VALUE>\"},\"file_options\":{\"encoding\":\"<ADD STRING VALUE>\",\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"string_delimiter\":\"DOUBLE\",\"date_style\":\"<ADD STRING VALUE>\",\"time_style\":\"<ADD STRING VALUE>\",\"date_delimiter\":\"<ADD STRING VALUE>\",\"date_format\":\"<ADD STRING VALUE>\",\"time_format\":\"<ADD STRING VALUE>\",\"timestamp_format\":\"<ADD STRING VALUE>\",\"bool_style\":\"1_0 (this is the default)\",\"ignore_zero\":true,\"require_quotes\":\"<ADD STRING VALUE>\",\"ctrl_chars\":\"<ADD STRING VALUE>\",\"escape_char\":\"<ADD STRING VALUE>\"}}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/load_jobs_ET", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/load_jobs_ET   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"load_source":"SERVER","load_action":"INSERT","schema":"<ADD STRING VALUE>","table":"<ADD STRING VALUE>","max_row_count":0,"max_warning_count":1000,"auto_create_table":{"execute":"yes","column_names":["<ADD STRING VALUE>"]},"cloud_source":{"endpoint":"<ADD STRING VALUE>","path":"<ADD STRING VALUE>","auth_id":"<ADD STRING VALUE>","auth_secret":"<ADD STRING VALUE>"},"server_source":{"file_path":"<ADD STRING VALUE>"},"file_options":{"encoding":"<ADD STRING VALUE>","code_page":"<ADD STRING VALUE>","has_header_row":"no","column_delimiter":",","string_delimiter":"DOUBLE","date_style":"<ADD STRING VALUE>","time_style":"<ADD STRING VALUE>","date_delimiter":"<ADD STRING VALUE>","date_format":"<ADD STRING VALUE>","time_format":"<ADD STRING VALUE>","timestamp_format":"<ADD STRING VALUE>","bool_style":"1_0 (this is the default)","ignore_zero":true,"require_quotes":"<ADD STRING VALUE>","ctrl_chars":"<ADD STRING VALUE>","escape_char":"<ADD STRING VALUE>"}}'

Response

Confirmation of load job created

Status Code

  • load jobs.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists all data load jobs, load uses Db2 load utility technology

Lists all data load jobs for the user.

GET /load_jobs

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/load_jobs", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/load_jobs   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Information about a data load job

Status Code

  • Data load jobs

  • Error payload

No Sample Response

This method does not specify any sample responses.

Creates a data load job

Creates a data load job

POST /load_jobs

Request

Data load job details

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs"
    
    	payload := strings.NewReader("{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"cloud_source\":{\"endpoint\":\"<ADD STRING VALUE>\",\"path\":\"<ADD STRING VALUE>\",\"auth_id\":\"<ADD STRING VALUE>\",\"auth_secret\":\"<ADD STRING VALUE>\"},\"server_source\":{\"file_path\":\"<ADD STRING VALUE>\"},\"file_options\":{\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"date_format\":\"YYYY-MM-DD\",\"time_format\":\"HH:MM:SS\",\"timestamp_format\":\"YYYY-MM-DD HH:MM:SS\"}}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"cloud_source\":{\"endpoint\":\"<ADD STRING VALUE>\",\"path\":\"<ADD STRING VALUE>\",\"auth_id\":\"<ADD STRING VALUE>\",\"auth_secret\":\"<ADD STRING VALUE>\"},\"server_source\":{\"file_path\":\"<ADD STRING VALUE>\"},\"file_options\":{\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"date_format\":\"YYYY-MM-DD\",\"time_format\":\"HH:MM:SS\",\"timestamp_format\":\"YYYY-MM-DD HH:MM:SS\"}}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      load_source: 'SERVER',
      load_action: 'INSERT',
      schema: '<ADD STRING VALUE>',
      table: '<ADD STRING VALUE>',
      max_row_count: 0,
      max_warning_count: 1000,
      auto_create_table: {execute: 'yes', column_names: ['<ADD STRING VALUE>']},
      cloud_source: {
        endpoint: '<ADD STRING VALUE>',
        path: '<ADD STRING VALUE>',
        auth_id: '<ADD STRING VALUE>',
        auth_secret: '<ADD STRING VALUE>'
      },
      server_source: {file_path: '<ADD STRING VALUE>'},
      file_options: {
        code_page: '<ADD STRING VALUE>',
        has_header_row: 'no',
        column_delimiter: ',',
        date_format: 'YYYY-MM-DD',
        time_format: 'HH:MM:SS',
        timestamp_format: 'YYYY-MM-DD HH:MM:SS'
      }
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"load_source\":\"SERVER\",\"load_action\":\"INSERT\",\"schema\":\"<ADD STRING VALUE>\",\"table\":\"<ADD STRING VALUE>\",\"max_row_count\":0,\"max_warning_count\":1000,\"auto_create_table\":{\"execute\":\"yes\",\"column_names\":[\"<ADD STRING VALUE>\"]},\"cloud_source\":{\"endpoint\":\"<ADD STRING VALUE>\",\"path\":\"<ADD STRING VALUE>\",\"auth_id\":\"<ADD STRING VALUE>\",\"auth_secret\":\"<ADD STRING VALUE>\"},\"server_source\":{\"file_path\":\"<ADD STRING VALUE>\"},\"file_options\":{\"code_page\":\"<ADD STRING VALUE>\",\"has_header_row\":\"no\",\"column_delimiter\":\",\",\"date_format\":\"YYYY-MM-DD\",\"time_format\":\"HH:MM:SS\",\"timestamp_format\":\"YYYY-MM-DD HH:MM:SS\"}}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/load_jobs", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/load_jobs   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"load_source":"SERVER","load_action":"INSERT","schema":"<ADD STRING VALUE>","table":"<ADD STRING VALUE>","max_row_count":0,"max_warning_count":1000,"auto_create_table":{"execute":"yes","column_names":["<ADD STRING VALUE>"]},"cloud_source":{"endpoint":"<ADD STRING VALUE>","path":"<ADD STRING VALUE>","auth_id":"<ADD STRING VALUE>","auth_secret":"<ADD STRING VALUE>"},"server_source":{"file_path":"<ADD STRING VALUE>"},"file_options":{"code_page":"<ADD STRING VALUE>","has_header_row":"no","column_delimiter":",","date_format":"YYYY-MM-DD","time_format":"HH:MM:SS","timestamp_format":"YYYY-MM-DD HH:MM:SS"}}'

Response

Confirmation of load job created

Status Code

  • load jobs.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns details about a load job including its progress

Returns details about a load job including its progress.

GET /load_jobs/{id}

Request

Path Parameters

  • Load job ID

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs/{id}"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs/{id}")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs/{id}",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/load_jobs/{id}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/load_jobs/{id}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Information about a data load job

Status Code

  • Data load job

  • Not authorized to access load job

  • Job not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Removes load job from history

Removes a data load job from history. This operation has no effect on the data already loaded. In-progress jobs cannot be deleted.

DELETE /load_jobs/{id}

Request

Path Parameters

  • Load job ID

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs/{id}"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs/{id}")
      .delete(null)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs/{id}",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/load_jobs/{id}", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/load_jobs/{id}   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Load job deleted

  • Not authorized to delete load job

  • Job not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Dowloads log file for a data load job

Downloads log file for a data load job

GET /load_jobs/{id}/log

Request

Path Parameters

  • Load job ID

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/load_jobs/{id}/log"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "file")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/load_jobs/{id}/log")
      .get()
      .addHeader("content-type", "file")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/load_jobs/{id}/log",
      "headers": {
        "content-type": "file",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "file",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/load_jobs/{id}/log", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/load_jobs/{id}/log   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: file'

Response

Status Code

  • Log file

  • Not authorized to access load log

  • Log not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists all schemas in the database

Returns a list of schemas.

GET /schemas

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/schemas"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schemas")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/schemas",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/schemas", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/schemas   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Collection of schemas

Status Code

  • List of schemas

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns schema information

Returns schema information.

GET /schemas/{schema_name}

Request

Path Parameters

  • Schema name

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/schemas/SYSIBM",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/schemas/SYSIBM", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Schema information

  • Schema not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Lists tables in a schema

Returns the list of tables in a schema.

GET /schemas/{schema_name}/tables

Request

Path Parameters

  • Schema name

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/schemas/SYSIBM/tables",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/schemas/SYSIBM/tables", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Collection of tables

Status Code

  • List of tables

  • Database or schema not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Returns information about a table

Return information about a table.

GET /schemas/{schema_name}/tables/{table_name}

Request

Path Parameters

  • Schema name

  • Table name

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables/SYSROLES"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables/SYSROLES")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/schemas/SYSIBM/tables/SYSROLES",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/schemas/SYSIBM/tables/SYSROLES", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/schemas/SYSIBM/tables/SYSROLES   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Includes table definition and statistics. Note that statistics such as row count and size are not updated real time. Check the stats_timestamp value to know how current that information is.

Status Code

  • Table information

  • Table not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Deletes all table data

Deletes all table data using a TRUNCATE operation.

DELETE /schemas/{schema_name}/tables/{table_name}/data

Request

Path Parameters

  • Schema name

  • Table name

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data"
    
    	req, _ := http.NewRequest("DELETE", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data")
      .delete(null)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/schemas/NOT_EXIST_SCHEMA/tables/NOT_EXIST_TABLE/data   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Success

  • Not authorized to access table data

  • Table not found

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query the list of object schemas

Query the list of object schemas.

GET /admin/schemas/obj_type/{obj_type}

Request

Path Parameters

  • Object type.

    Allowable values: [table,hadooptable,view,mqt,alias,sequence,procedure,nickname,udt,function]

Query Parameters

  • Object type.

  • Whether to show system objects.

    Allowable values: [true,false]

  • The amount of return records.

    Default: 500

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/admin/schemas/obj_type/table?search_name=SYSIBM&show_systems=true&rows_return=50'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Query the list of object schemas.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Create schema

Creates a new schema. Any user with enough database authority can create schemas using dbapi directly. Regular users can create new schemas indirectly by creating a new table or other database object and specifying the name of the new schema where the object will be placed.

POST /admin/schemas

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas"
    
    	payload := strings.NewReader("{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({name: 'TESTSCHEMA', authorization: 'SYSIBM'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"name\":\"TESTSCHEMA\",\"authorization\":\"SYSIBM\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/schemas", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/schemas   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"name":"TESTSCHEMA","authorization":"SYSIBM"}'

Response

Status Code

  • Schema created.

  • Invalid parameters or schema already exists

  • Only administrators can create schemas directly.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Drops an empty schema

Drops an empty schema. An error is returned if the schema contains any objects.

DELETE /admin/schemas

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas"
    
    	payload := strings.NewReader("[{\"name\":\"TESTSCHEMA\"}]")
    
    	req, _ := http.NewRequest("DELETE", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "[{\"name\":\"TESTSCHEMA\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas")
      .delete(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify([{name: 'TESTSCHEMA'}]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"name\":\"TESTSCHEMA\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/admin/schemas", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/admin/schemas   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '[{"name":"TESTSCHEMA"}]'

Response

Status Code

  • The schema was dropped successfully.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get single object privilege

Get single object privilege.

GET /admin/privileges

Request

Query Parameters

  • Object type.

    Allowable values: [TABLE,VIEW,DATABASE,PROCEDURE,FUNCTION,MQT,SEQUENCE,HADOOP_TABLE,NICKNAME,SCHEMA,UDT]

  • Schema name of the object. For table and database, this parameter is not required.

  • Name of the object. For database, this parameter is not required.

  • The amount of return records.

    Default: 1000

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/admin/privileges?obj_type=VIEW&schema=SYSCAT&obj_name=VIEWS&rows_return=10'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Get object privilege.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Privilege list of selected objects

Privilege list of selected objects.

POST /admin/privileges

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges"
    
    	payload := strings.NewReader("{\"obj_type\":\"VIEW\",\"rows_return\":10,\"filter\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\"}]}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"obj_type\":\"VIEW\",\"rows_return\":10,\"filter\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\"}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/privileges",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      obj_type: 'VIEW',
      rows_return: 10,
      filter: [{schema: 'SYSCAT', obj_name: 'TABLES'}]
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"obj_type\":\"VIEW\",\"rows_return\":10,\"filter\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\"}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/privileges", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   https://{HOSTNAME}/dbapi/v4/admin/privileges   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"obj_type":"VIEW","rows_return":10,"filter":[{"schema":"SYSCAT","obj_name":"TABLES"}]}'

Response

Status Code

  • Privilege list of selected objects

  • Get error when search authid

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Grant or revoke privileges

Grant or revoke privileges

PUT /admin/privileges

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/privileges"
    
    	payload := strings.NewReader("{\"stop_on_error\":true,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"stop_on_error\":true,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/privileges")
      .put(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/privileges",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      stop_on_error: true,
      privileges: [
        {
          schema: 'SYSCAT',
          obj_name: 'TABLES',
          obj_type: 'VIEW',
          grantee: {authid: 'PUBLIC', authid_type: 'GROUP'},
          grant: ['select'],
          revoke: ['insert']
        }
      ]
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"stop_on_error\":true,\"privileges\":[{\"schema\":\"SYSCAT\",\"obj_name\":\"TABLES\",\"obj_type\":\"VIEW\",\"grantee\":{\"authid\":\"PUBLIC\",\"authid_type\":\"GROUP\"},\"grant\":[\"select\"],\"revoke\":[\"insert\"]}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/privileges", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/privileges   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"stop_on_error":true,"privileges":[{"schema":"SYSCAT","obj_name":"TABLES","obj_type":"VIEW","grantee":{"authid":"PUBLIC","authid_type":"GROUP"},"grant":["select"],"revoke":["insert"]}]}'

Response

Status Code

  • The status of grant or revoke

  • Get error when grant or revoke

  • Error payload

  • Error payload

  • Error payload

No Sample Response

This method does not specify any sample responses.

Generate schema DDL

Generate schema DDL.

POST /admin/schemas/ddl

Request

Query Parameters

  • Type of operation.

    Allowable values: [more]

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/ddl?action=more"
    
    	payload := strings.NewReader("{\"objects\":[{\"schema\":\"SCHEMA_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}")
    
    	req, _ := http.NewRequest("POST", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"objects\":[{\"schema\":\"SCHEMA_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/ddl?action=more")
      .post(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "POST",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/ddl?action=more",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({objects: [{schema: 'SCHEMA_NAME'}], options: [{}], stat_terminator: ';'}));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"objects\":[{\"schema\":\"SCHEMA_NAME\"}],\"options\":[{}],\"stat_terminator\":\";\"}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("POST", "/dbapi/v4/admin/schemas/ddl?action=more", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X POST   'https://{HOSTNAME}/dbapi/v4/admin/schemas/ddl?action=more'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"objects":[{"schema":"SCHEMA_NAME"}],"options":[{}],"stat_terminator":";"}'

Response

Status Code

  • Generate schema DDL.

  • Invalid parameters.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Create a new table

Create a new table.

PUT /admin/tables

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables"
    
    	payload := strings.NewReader("{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}")
    
    	req, _ := http.NewRequest("PUT", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables")
      .put(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "PUT",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/tables",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify({
      schema: 'TABLE_SCHEMA',
      table: 'TABLE_NAME',
      column_info: [
        {
          data_type: 'DECIMAL',
          length: 5,
          scale: {},
          column_name: 'COL_NAME',
          nullable: true
        }
      ]
    }));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\",\"column_info\":[{\"data_type\":\"DECIMAL\",\"length\":5,\"scale\":{},\"column_name\":\"COL_NAME\",\"nullable\":true}]}"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("PUT", "/dbapi/v4/admin/tables", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X PUT   https://{HOSTNAME}/dbapi/v4/admin/tables   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '{"schema":"TABLE_SCHEMA","table":"TABLE_NAME","column_info":[{"data_type":"DECIMAL","length":5,"scale":{},"column_name":"COL_NAME","nullable":true}]}'

Response

Status Code

  • The table was created successfully.

  • Invalid parameters.

  • Not authorized.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Drop table

Drop table.

DELETE /admin/tables

Request

  • package main
    
    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables"
    
    	payload := strings.NewReader("[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]")
    
    	req, _ := http.NewRequest("DELETE", url, payload)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    MediaType mediaType = MediaType.parse("application/json");
    RequestBody body = RequestBody.create(mediaType, "[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]");
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables")
      .delete(body)
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "DELETE",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/tables",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.write(JSON.stringify([{schema: 'TABLE_SCHEMA', table: 'TABLE_NAME'}]));
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    payload = "[{\"schema\":\"TABLE_SCHEMA\",\"table\":\"TABLE_NAME\"}]"
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("DELETE", "/dbapi/v4/admin/tables", payload, headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X DELETE   https://{HOSTNAME}/dbapi/v4/admin/tables   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'   -d '[{"schema":"TABLE_SCHEMA","table":"TABLE_NAME"}]'

Response

Status Code

  • The alias was dropped successfully.

  • Invalid parameters.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get table definition

Get table definition.

GET /admin/schemas/{schema_name}/tables/{table_name}/definition

Request

Path Parameters

  • Schema name of the object.

  • Table name.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/definition   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Get table definition.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Query table data

Fetches the table data up to a maximum of 100,000 rows. Currently it's not possible to retrieve data from tables that contain CLOB, BLOB or DBCLOB values.

GET /admin/schemas/{schema_name}/tables/{table_name}/data

Request

Path Parameters

  • Schema name of the object.

  • Table name.

Query Parameters

  • The amount of return records.

    Default: 1000

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   'https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/data?rows_return=1000'   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Returned result was successful.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get column detail properties

Get column detail properties.

GET /admin/schemas/{schema_name}/tables/{table_name}/columns/{column_name}/properties

Request

Path Parameters

  • Schema name of the object.

  • Table name.

  • Column name.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/schemas/SYSIBM/tables/SYSROLES/columns/CREATE_TIME/properties   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Get column detail properties.

  • Not authorized.

  • Object not found.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Get the metadata type

Get the metadata type.

GET /admin/tables/meta/datatype

Request

No Request Parameters

This method does not accept any request parameters.

  • package main
    
    import (
    	"fmt"
    	"net/http"
    	"io/ioutil"
    )
    
    func main() {
    
    	url := "https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype"
    
    	req, _ := http.NewRequest("GET", url, nil)
    
    	req.Header.Add("content-type", "application/json")
    	req.Header.Add("authorization", "Bearer {AUTH_TOKEN}")
    
    	res, _ := http.DefaultClient.Do(req)
    
    	defer res.Body.Close()
    	body, _ := ioutil.ReadAll(res.Body)
    
    	fmt.Println(res)
    	fmt.Println(string(body))
    
    }
  • OkHttpClient client = new OkHttpClient();
    
    Request request = new Request.Builder()
      .url("https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype")
      .get()
      .addHeader("content-type", "application/json")
      .addHeader("authorization", "Bearer {AUTH_TOKEN}")
      .build();
    
    Response response = client.newCall(request).execute();
  • var http = require("https");
    
    var options = {
      "method": "GET",
      "hostname": "{HOSTNAME}",
      "port": null,
      "path": "/dbapi/v4/admin/tables/meta/datatype",
      "headers": {
        "content-type": "application/json",
        "authorization": "Bearer {AUTH_TOKEN}"
      }
    };
    
    var req = http.request(options, function (res) {
      var chunks = [];
    
      res.on("data", function (chunk) {
        chunks.push(chunk);
      });
    
      res.on("end", function () {
        var body = Buffer.concat(chunks);
        console.log(body.toString());
      });
    });
    
    req.end();
  • import http.client
    
    conn = http.client.HTTPSConnection("{HOSTNAME}")
    
    headers = {
        'content-type': "application/json",
        'authorization': "Bearer {AUTH_TOKEN}"
        }
    
    conn.request("GET", "/dbapi/v4/admin/tables/meta/datatype", headers=headers)
    
    res = conn.getresponse()
    data = res.read()
    
    print(data.decode("utf-8"))
  • curl -X GET   https://{HOSTNAME}/dbapi/v4/admin/tables/meta/datatype   -H 'authorization: Bearer {AUTH_TOKEN}'   -H 'content-type: application/json'

Response

Status Code

  • Get the metadata type.

  • Error payload

No Sample Response

This method does not specify any sample responses.

Generate table DDL

Generate table DDL.

POST /admin/tables/ddl

Request

Query Parameters

  • Type of operation.

    Allowable values: [create,alter,more]