CraftMyPDF

App · 10 actions

Generate PDFs and images, find templates and read document usage in CraftMyPDF.

Actions

ActionWhat it does
Generate a PDFGenerate a PDF.
Generate an imageGenerate an image.
Get a templateGet a template.
Get account informationGet account information.
Get PDF informationGet PDF information.
Get template usageGet template usage.
List template versionsList template versions.
List templatesList templates.
List transactionsList transactions.
Merge PDFsMerge PDFs.

Generate a PDF

Generate a PDF.

Inputs

Templatetemplate_idtextRequired
- Template ID.
Template datatemplate_dataobjectRequired
JSON data, it supports stringified JSON string or an JSON object
Versionversiontext
To generate a PDF using a specific version of the template. We use the latest template version unless you specify otherwise.
Expirationexpirationnumber
Expiration of the generated PDF in minutes. default to 5 minutes, range between 1 minute and 10080 minutes(7 days)
Output fileoutput_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

Templatetemplate_idtextRequired
Template ID
Template datatemplate_dataobjectRequired
JSON data, it supports stringified JSON string or an JSON object
Versionversiontext
To generate an image using a specific version of the template. We use the latest template version unless you specify otherwise.
Expirationexpirationnumber
Expiration of the generated PDF in minutes. default to 5 minutes, range between 1 minute and 10080 minutes(7 days)
Output fileoutput_filetext
output file, default to 'output.jpg'
Output typeoutput_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

Templatetemplate_idtextRequired
Template id
Versionversiontext
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

UrlurltextRequired
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 IDstemplate_idslistRequired
Templates to include in the usage report.
Start datestart_datedate and time
Start date in ISO 8601 format (UTC time).
End dateend_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

Templatetemplate_idtextRequired
Template ID

Outputs

dataobject
The response from CraftMyPDF.
Example output
{
  "data": {
    "status": "example",
    "template_id": "example",
    "versions": [
      {}
    ]
  }
}

List templates

List templates.

Inputs

Limitlimitnumber
Retrieve only the number of records specified. Default to 300
Offsetoffsetnumber
Offset is used to skip the number of records from the results. Default to 0
Template groupgroup_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

Limitlimitnumber
Retrieve only the number of records specified. Default to 300
Offsetoffsetnumber
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 URLsurlslistRequired
HTTPS URLs of the PDF files, in merge order.
Expirationexpirationnumber
Expiration of the generated PDF in minutes. default to 5 minutes, range between 1 minute and 10080 minutes(7 days)
Output fileoutput_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"
  }
}

On this page