Skip to main content

Callback

The configuration is located in /callback/config.ion.

The configuration file itself is optional.

All properties in the configuration file are also optional.

Project config files inherit properties from tenant config files which inherit from the global defaults as given below.

See URL Connections for a detailed description of the connection configuration.

Callback configurations also support placeholder replacement in configuration strings.

Matching Connections to URLs​

The callback worker will send HTTP requests to notify the success of priint cloud rendering jobs.

The project configuration contains a list of connection configurations identified by their url property. Typically, just one.

The best matching configuration is the configuration with the longest matching URL part (computed from the start of the URL).

If no matching configuration is found, the system falls back to a default configuration.

Typical Project Configuration Example​

// /tenants/example.com/projects/datasheets/callback/config.ion
{
"connections": [{
"method": "POST",
"url": "https://example.com/notfications/priint-success",
"authentication": {
"type": "ApiKey",
"key": "API-KEY",
"value": "8e104bcc93c9f7af5626bbfae2c0295eced7d86985b90f639e8844"
},
"payload": [{
"value" : "{\"status\":\"success\",\"ticket\":\"{ticket}\"}"
}]
}]
}

Together with a callbackUrl setting of https://example.com/notfications/priint-success/{ticket} in /restapi/config.ion this configuration will lead to an HTTP Request like this:

POST /notifications/priint-success/u6g3fzzv36nzswjdb6dzdiuvpy HTTP/1.1
Host: https://example.com
API-KEY: 8e104bcc93c9f7af5626bbfae2c0295eced7d86985b90f639e8844
Content-type: application/json
User-agent: priintgrid-callback
Content-length: 395

{"status":"success","ticket":"u6g3fzzv36nzswjdb6dzdiuvpy"}

Default Behavior​

If the callback worker does only find a whitelisted URL in the config, then the system falls back to a default request.

Given the hypothetical renderpdf request like

POST /tenants/example.com/projects/datasheets/renderpdf
?custom=foo:bar
&foreignKey=0815
&callback=https://example.com/notifications/priint-success/%7Bticket%7D

and a user "datasheet-jobs" job ticket of "u6g3fzzv36nzswjdb6dzdiuvpy"

and a basic configuration like

// /tenants/example.com/projects/datasheets/callback/config.ion
{
"connections": [{
"url": "https://example.com/"
}]}

we get the following request to the callback URL:

POST /notifications/priint-success/u6g3fzzv36nzswjdb6dzdiuvpy HTTP/1.1
Host: https://example.com
Content-type: application/json
User-agent: priintgrid-callback
Content-length: 395

{
"foo" : "bar",
"tenant" : "example.com",
"project" : "datasheets",
"user" : "datasheet-jobs",
"ticket" : "u6g3fzzv36nzswjdb6dzdiuvpy",
"outputType" : "pdf",
"foreignKey" : "0815",
"location" : "tenants/example.com/projects/postcards/renderpdf/output/u6g3fzzv36nzswjdb6dzdiuvpy.pdf",
"dateTime" : "2023-10-13T17:59:44.424+02:00",
"timestamp" : "1697212784424"
}

Error Handling Configuration​

See Redelivery On Error.