API Default Job preset

When working with the Workflow, in the Job creation connect plugin it is possible to select “default” (aka no preset).

How can I reproduce the same behavior with the API? Seems to me that all the endpoints require a job preset ID.

It has already been awhile ago since you posted this forum post but hereby I would like to inform you that, and perhaps someone else can confirm this, it isn’t possible to execute a Process Job Creation API request without a Job Creation Preset. The reason why I think this is, is because the input field Job Creation Preset ID/Name is a require field in the form available on the following webpage and because I am getting an error when I submit this form after removing the attribute “required” from this input field.

http://localhost:9340/serverengine/html/cookbook/examples/jc/jc-process-by-cse-json.html

There are three job creation endpoints:

/rest/serverengine/workflow/jobcreation/{configId} - without a payload
/rest/serverengine/workflow/jobcreation/{configId} - with a JSON payload
/rest/serverengine/workflow/jobcreation - with a JSON payload

The Cookbook only has examples for the first two endpoints, not for the third one.

Workflow uses the third one when you select “default”, which is the only endpoint that doesn’t require a config ID for a job preset. The following is a barebones example of a JSON payload for the third endpoint:

{
  "jobs": [
    {
      "segments": [
        {
          "documentsets": [
            {
              "documents": [
                {
                  "documentpages": [
                    {
                      "contentitem": 243002
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ],
  "identifiers": [
    445733,
    445665
  ],
  "ProcessInformations": {
    "ProcessName": "OutputHTML",
    "OriginalFilename": "Test.txt",
    "TaskIndex": 6,
    "JobInfos": {
      "JobInfo1": "",
      "JobInfo2": "",
      "JobInfo3": "",
      "JobInfo4": "",
      "JobInfo5": "Mrs Celina Nobles",
      "JobInfo6": "",
      "JobInfo7": "",
      "JobInfo8": "",
      "JobInfo9": ""
    },
    "LocalVariables": {},
    "GlobalVariables": {}
  }
}
2 Likes

Thanks for the clarification and the example! :grinning:

Bookmarked the reply for future reference.

Coming back to this thread to further understand the first endpoint you mentioed, its documentation is Process Job Creation (objectiflune.com)

It takes no payload and only the job configuration ID in its path.

If there is no payload or anything to specify either the contentsets\items to process what does get processed?

Sorry for not replying, I wasn’t monitoring the forum at the time and completely missed your question.

As you might have already guessed, that information is included in the config itself. The XML contains one or more instances of <contentSetIds>.

It’s probably easier to just use the endpoint that accepts a JSON payload.

1 Like