Print Job PDF
This endpoint is deprecated. Please do not use it for new projects. The documentation remains here for legacy API consumers.
“Printing” the job database to PDF
Request with tokens
Transforming the data into a PDF can be delegated to the API by sending a POST-request with the endpoint /jobs/printPdf:
1 |
curl -i -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json;" -X POST -d {postBody} "https://api.softgarden.io/api/rest/v2/frontend/jobs/printPdf" |
with TOKEN being either a client access token or a user access token.
The {postBody} in -d parameter represents a JSON Object as Follows:
1 2 3 4 5 |
{ "params": "...", "headline": "...", "jobs": "..." } |
“jobs” must contain the data that is to be transformed. Split jobs (=rows) using the string ‘::__::‘, the job’s data fields (=columns) with ‘::‘. “params” should contain the search parameters one used to obtain this job data. Split parameters with the string ‘::__::‘. And “headline” defines the resulting table’s headline text. Use ‘::‘ to split the different column names. The desired language that results should have in the final representation is extracted from the header. You then get something like this:
1 2 3 4 5 |
{ "params": "Test1::__::Test2::__::Test3", "headline": "Head1::__::Head2::__::Head3", "jobs": "Job1::Val1.1::Val1.2::Val1.3::__::Job2::Val2.1::Val2.2::Val2.3::__::Job3::Val3.1::Val3.2::Val3.3" } |
Request with basic authorization
As an alternative, you can use here the basic authorization method. Just write
1 |
curl -i -u "{clientId}:" -H "Content-Type: application/json;" -X POST -d {postBody} "https://api.softgarden.io/api/rest/v2/frontend/jobs/printPdf" |
{clientId} is the ID for your application to develop given to you by softgarden. The colon seen in the example is obligatory.
Path parameters
– none –
Query parameters
– none –
Response values
Upon | Returned value | Description |
---|---|---|
success | 204 – No Content | User will be redirected to PDF. |
failure | 500 – INTERNAL SERVER ERROR | When an error appears while processing your request. |
authorization error | 401 / 403 | See here for details. |
Example:
1 |
curl -i -H "Authorization: Bearer TOKEN" -H "Content-Type: application/json;" -X POST -d '{"params":"test", "headline":"Head1::__::Head2::__::Head3", "jobs":"Job1::Val1.1::Val1.2::Val1.3::__::Job2::Val2.1::Val2.2::Val2.3::__::Job3::Val3.1::Val3.2::Val3.3"}' "https://api.softgarden.io/api/rest/v2/frontend/jobs/printPdf" |