Create a Client Application
/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
- multipart/form-data
-
file: file
File(JSON payload) to upload.
Use
Content-Type: application/json
to describe this information as a JSON object. -
metadata: string
You can use this parameter to pass the input params
Usename
andisEnabled
for the new client application.Content-Type: application/json
to describe this information as a JSON object.The field
isEnabled
is optional. The default value for this field istrue
For example:
{
"name": "testApp",
"isEnabled": "false"
}
Response
- application/json
- application/xml
201 Response
-
Location: string
The URI for the newly created resource is in the
Location Header
field.
object
-
createdTime(optional):
string
Date the client application was created.
-
errorCode(optional):
string
An error code of zero (0) indicates no errors.
-
id(optional):
string
Globally unique identifier (GUID) of the client application.
-
isEnabled(optional):
string
Flag to indicate if the client application is enabled/disabled.
-
modifiedTime(optional):
string
Date the client application was last modified.
-
name(optional):
string
Client application name.
{
"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.
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
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
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" }