Create a Client Application

post

/documents/api/1.2/config/clientApplications

Create a new custom actions client application. A single configuration file in JSON format containing one or more custom action definitions is required.

You must be an administrator to perform this operation.

The request is a multipart HTTP request where one part is a JSON object (metadata) with the attributes name , isEnabled and the other part is the content of the file itself (file).

Request

Supported Media Types
Form Parameters
  • File(JSON payload) to upload.

    Use Content-Type: application/json to describe this information as a JSON object.

  • You can use this parameter to pass the input params name and isEnabled for the new client application.

    Use Content-Type: application/json to describe this information as a JSON object.

    The field isEnabled is optional. The default value for this field is true

    For example:

    {

    "name": "testApp",

    "isEnabled": "false"

    }
Back to Top

Response

Supported Media Types

201 Response

Created. The request was fulfilled and the new resource was created.
Headers
  • The URI for the newly created resource is in the Location Header field.
Body ()
Root Schema : PostClientApplicationResponse
Type: object
Metadata about a specific client application
Show Source
Example Response (application/json)
{
    "createdTime":"2023-05-03T11:26:27Z",
    "errorCode":"0",
    "id":"7579B0A49C7A34960929793458C1B355",
    "isEnabled":"false",
    "modifiedTime":"2023-05-03T15:22:14Z",
    "name":"testapp"
}

409 Response

Client application with the given name already exist.

Back to Top

Examples

The following example creates a new client application, which contains the metadata and a custom action json file. The json file is a configuration file, consumed by OCE web client.

POST .../config/clientApplications/

Request Header

The request is a multipart request with a specified boundary delimiter of the following general form:
Content-Type: multipart/form-data; boundary=---1234567890

Request Body

-----1234567890
Content-Disposition: form-data; name="metadata"
Content-Type: application/json
{ 
    "name": "testapp",
    "isEnabled":"false" 
}
-----1234567890
Content-Disposition: form-data; name="file"; filename="clientconfig.json"
Content-Type: application/json
 
<File Content>
-----1234567890--

HTTP Status Code

HTTP_STATUS = 201

JSON Response

{
  "createdTime": "2023-05-08T12:37:28Z",
  "errorCode": "0",
  "id": "427090D588695B4B4C59D868E83E27B9",
  "isEnabled": "false",
  "modifiedTime": "2023-05-08T12:37:28Z",
  "name": "testapp"
}

Example 2

The following example returns an error, because the client application with the given name already exists.

POST .../config/clientApplications/

Request Header

The request is a multipart request with a specified boundary delimiter of the following general form:
Content-Type: multipart/form-data; boundary=---1234567890

Request Body

-----1234567890
Content-Disposition: form-data; name="metadata"
Content-Type: application/json
{ 
    "name": "testapp",
    "isEnabled":"false" 
}
-----1234567890
Content-Disposition: form-data; name="file"; filename="clientconfig.json"
Content-Type: application/json
 
<File Content>
-----1234567890--

HTTP Status Code

HTTP_STATUS = 409

JSON Response

{
  "errorCode": "-17",
  "errorKey": "!csAFUnableToPerformActionForApp,create,testapp!csAFAppAlreadyExist,testapp",
  "errorMessage": "Unable to perform 'create' action for JSON application 'testapp'. Application 'testapp' already exist.",
  "isEnabled": "0",
  "name": "testapp",
  "title": "Unable to perform 'create' action for JSON application 'testapp'. Application 'testapp' already exist.",
  "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html"
}
Back to Top