CraftMyPDF
App · 10 actions
Generate PDFs and images, find templates and read document usage in CraftMyPDF.
Actions
| Action | What it does |
|---|---|
| Generate a PDF | Generate a PDF. |
| Generate an image | Generate an image. |
| Get a template | Get a template. |
| Get account information | Get account information. |
| Get PDF information | Get PDF information. |
| Get template usage | Get template usage. |
| List template versions | List template versions. |
| List templates | List templates. |
| List transactions | List transactions. |
| Merge PDFs | Merge PDFs. |
Generate a PDF
Generate a PDF.
Inputs
- Template
template_idtextRequired - - Template ID.
- Template data
template_dataobjectRequired - JSON data, it supports stringified JSON string or an JSON object
- Version
versiontext - To generate a PDF using a specific version of the template. We use the latest template version unless you specify otherwise.
- Expiration
expirationnumber - Expiration of the generated PDF in minutes. default to 5 minutes, range between 1 minute and 10080 minutes(7 days)
- Output file
output_filetext - output file, default to 'output.pdf'
Outputs
dataobject- The response from CraftMyPDF.
Example output
{
"data": {
"anchors": [
{}
],
"einvoice_validation_details": "example",
"einvoice_validation_status": "valid",
"file": "example",
"status": "example",
"transaction_ref": "example"
}
}Generate an image
Generate an image.
Inputs
- Template
template_idtextRequired - Template ID
- Template data
template_dataobjectRequired - JSON data, it supports stringified JSON string or an JSON object
- Version
versiontext - To generate an image using a specific version of the template. We use the latest template version unless you specify otherwise.
- Expiration
expirationnumber - Expiration of the generated PDF in minutes. default to 5 minutes, range between 1 minute and 10080 minutes(7 days)
- Output file
output_filetext - output file, default to 'output.jpg'
- Output type
output_typetext - image output file type, default to 'jpeg'. Options are 'jpeg' or 'png'One of:
jpeg,png.
Outputs
dataobject- The response from CraftMyPDF.
Example output
{
"data": {
"file": "example",
"status": "example",
"transaction_ref": "example"
}
}Get a template
Get a template.
Inputs
- Template
template_idtextRequired - Template id
- Version
versiontext - Version of the template. Leave it empty to use the latest version.
Outputs
dataobject- The response from CraftMyPDF.
Example output
{
"data": {
"body": "example",
"json": "example",
"name": "example",
"status": "example"
}
}Get account information
Get account information.
Inputs
None.
Outputs
dataobject- The response from CraftMyPDF.
Example output
{
"data": {
"created_at": "example",
"quota_counter": 1,
"quota_max": 1,
"status": "example",
"template_counter": "example",
"template_max": 1,
"username": "example"
}
}Get PDF information
Get PDF information.
Inputs
- Url
urltextRequired - URL to a PDF file
Outputs
dataobject- The response from CraftMyPDF.
Example output
{
"data": {
"author": "example",
"creationDate": "example",
"creator": "example",
"keywords": "example",
"modificationDate": "example",
"producer": "example",
"status": "example",
"subject": "example",
"title": "example",
"totalPages": 1,
"url": "example"
}
}Get template usage
Get template usage.
Inputs
- Template IDs
template_idslistRequired - Templates to include in the usage report.
- Start date
start_datedate and time - Start date in ISO 8601 format (UTC time).
- End date
end_datedate and time - End date in ISO 8601 format (UTC time).
Outputs
dataobject- The response from CraftMyPDF.
Example output
{
"data": {
"end_date": "example",
"results": [
{
"template_id": "example",
"total_count": "example",
"total_credit": "example"
}
],
"start_date": "example",
"status": "example",
"template_ids": [
"example"
]
}
}List template versions
List template versions.
Inputs
- Template
template_idtextRequired - Template ID
Outputs
dataobject- The response from CraftMyPDF.
Example output
{
"data": {
"status": "example",
"template_id": "example",
"versions": [
{}
]
}
}List templates
List templates.
Inputs
- Limit
limitnumber - Retrieve only the number of records specified. Default to 300
- Offset
offsetnumber - Offset is used to skip the number of records from the results. Default to 0
- Template group
group_nametext - Return templates in the named group.
Outputs
dataobject- The response from CraftMyPDF.
Example output
{
"data": {
"status": "example",
"templates": [
{
"name": "example",
"template_id": "example"
}
]
}
}List transactions
List transactions.
Inputs
- Limit
limitnumber - Retrieve only the number of records specified. Default to 300
- Offset
offsetnumber - Offset is used to skip the number of records from the results. Default to 0
Outputs
dataobject- The response from CraftMyPDF.
Example output
{
"data": {
"status": "example",
"transactions": [
{
"created_at": "example",
"credit": "example",
"exec_tm": 1,
"resp_file_size": 1,
"resp_status": "success",
"transaction_ref": "example",
"transaction_type": "example"
}
]
}
}Merge PDFs
Merge PDFs.
Inputs
- PDF URLs
urlslistRequired - HTTPS URLs of the PDF files, in merge order.
- Expiration
expirationnumber - Expiration of the generated PDF in minutes. default to 5 minutes, range between 1 minute and 10080 minutes(7 days)
- Output file
output_filetext - output file, default to 'output.pdf'
Outputs
dataobject- The response from CraftMyPDF.
Example output
{
"data": {
"anchors": [
{}
],
"einvoice_validation_details": "example",
"einvoice_validation_status": "valid",
"file": "example",
"status": "example",
"transaction_ref": "example"
}
}