API
Endpoints
All API endpoints can be found at https://rissc.demo.printformer.net/docs/
For example, information (such as DataKeys and CustomAttributes) can be read from a printformer template:
Another example of an API call flow:
Server to server communication
All requests to /api-ext/*
must have an Authorization: Bearer
and Accept: application/json
header. The Authorization header contains the API key of the client as which the API should be addressed.
Example
CODE
|
The API key can be found in the printformer Admin menu under Integrations > API Keys in the individual clients (> API).
File recall
For file retrieval using the API endpoints under /api-ext/files/*
, the generation of a JWT is necessary.
Through the parametersr jti
, exp
and urlPath
which can be modified by the external platform, the validity of the file URL can be set appropriately depending on the use case.
The API endpoints do not directly deliver the file, but only a short valid redirect to the actual file URL.
User authentication
To log a user from an external platform into printfomer (e.g. for the editor call) a JWT must be generated.
JSON Web Token
Supported JWT Claims
Claim | Position | Description | Example | Required | Usage |
---|---|---|---|---|---|
client | Payload | Client Identifier | oU4dL51h | yes | printformer > Integrations > API-Keys |
user | Payload | User Identifier | oxrboJwf | no | Returned by the API when creating a user. Required as soon as a user is to be authenticated, e.g. when calling the editor. |
urlPath | Payload |
| no | Validated as soon as the claim is in the token. Should be set e.g. when generating the token for file retrieval to prevent a token from being valid for multiple file retrieval URLs. | |
redirect | Payload | URL to which the user should be redirected after successful login |
| no | Must be generated from the external platform |
jti | Header | Nonce, must not be used twice, must be generated again for each JWT | K1jKpIZSiS08TtX3XixI6dPZ91jBVS23tp8z2uiA7RjQxcBk0pCwC9d6FrU2 | no | Required as soon as a user is to be authenticated, e.g. when calling the editor. |
exp | Payload | Expiration Date (Timestamp UTC) how long this JWT is valid for | 1511430662 | no | Validated as soon as the claim is in the token. |
The JWT is signed with a Sha256 (the API key of the client is used again as the key).
In the browser https://demo.printformer.net/auth?jwt={JWT}
is then called.
Instruction: User attachment to editor call
Step | API-Reference | Required | Results | Beschreibung |
---|---|---|---|---|
1 | https://rissc.demo.printformer.net/docs/#/User/post_api_ext_user |
| User Identifier | First, a new user is created. The new user is automatically assigned to the client that created it. |
2 | https://rissc.demo.printformer.net/docs/#/Draft/post_api_ext_draft |
| DraftHash | A new draft is created for the newly created user. |
3 | https://rissc.demo.printformer.net/docs/#/User/post_api_ext_user |
| JWT | The External Platform must generate a JWT |
4 |
| Editor-Aufruf | With this JWT the user can be logged in once |