Deleting document class

Delete a particular document class based on the document class ID.

Syntax: DELETE /model/documentClass/{documentClassId}

Table 1. Deleting document classes requirements
Property Data type Description
apiKey header(required) String To authenticate API call.
documentClassIdpath (required) Number Unique identifier for each document class, can get from GET /model/documentClass response.
  • Curl
    curl -X DELETE -u 'Functional ID:Password' 'https://requesturl/ca/rest/content/v1/model/documentClass/{documentClassId}'  -H 'apiKey: ZjMzYzg1ZDYtNTk1Nwhi5782NzItYjg3Mzg2ZGQwOGNhO3h5aWJtO2RlZmF1bHQ='
  • Java
    import java.io.IOException;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.Response;
    import okhttp3.RequestBody;
    import java.util.Base64;
    import okhttp3.MediaType;
    
    
    public class testcode {
      public static void main(String[] args) {
        String encoding = Base64.getEncoder().encodeToString(("Functional ID:Password").getBytes());
        OkHttpClient client = new OkHttpClient();
    
    
        Request request = new Request.Builder()
          .url("https://requesturl/ca/rest/content/v1/model/documentClass/{documentClassId}")
          .delete()
          .addHeader("apiKey", "ZjMzYzg1ZDYtNTk1Nwhi5782NzItYjg3Mzg2ZGQwOGNhO3h5aWJtO2RlZmF1bHQ=")
          .addHeader("Authorization", "Basic " + encoding)
          .build();
    
    
        try {
          Response response = client.newCall(request).execute();
          System.out.println(response.body().string());
        } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }
      }
    }
    
    
    /*
     * The JAR files in Referenced Libraries could be found in the Download section with the following link:
     * 1. okhttp.jar - https://github.com/square/okhttp
     * 2. okio.jar - https://github.com/square/okio
     */
  • JavaScript
    let request = require("request");
    let Base64 = require('js-base64').Base64;
    
    
    let encoding = Base64.encode('Functional ID:Password');
    let options = {
      method: 'DELETE',
      url: 'https://requesturl/ca/rest/content/v1/model/documentClass/{documentClassId}',
      headers:
      {
        'apiKey' : 'ZjMzYzg1ZDYtNTk1Nwhi5782NzItYjg3Mzg2ZGQwOGNhO3h5aWJtO2RlZmF1bHQ=',
        'authorization': "Basic " + encoding
      }
    };
    
    
    request(options, function (error, response, body) {
      console.log(body)
      if (error) throw new Error(error);
    });
  • Python
    import requests
    import base64
    
    
    encoding = base64.b64encode(b'Functional ID:Password')
    
    
    url = "https://requesturl/ca/rest/content/v1/model/documentClass/{documentClassId}"
    headers = {
     "apiKey" : "ZjMzYzg1ZDYtNTk1Nwhi5782NzItYjg3Mzg2ZGQwOGNhO3h5aWJtO2RlZmF1bHQ=",
     "authorization": "Basic " +  encoding.decode("utf-8")
    }
    
    
    response = requests.request("DELETE", url, headers=headers)
Example response
{
  "status": {
    "code": 200,
    "messageId": "CIWCA11135",
    "message": "Successfully deleted the document class."
  }}