REST API

You can get the API_KEY from your account.


Example
format JSON XML
This is the most basic and simple way to use the transform service!
1
2
3
4
5
6
curl -H "Authorization: API_KEY" \
https://api.prexview.com/v1/transform \
-F json="<data.json" \
-F template="template-name" \
-F output="pdf" \
-o result.pdf
You can also use a string instead of a file with curl
1
-F json="{\"hello\":\"World\"}" \
This is the most basic and simple way to use the transform service!
1
2
3
4
5
6
curl -H "Authorization: API_KEY" \
https://api.prexview.com/v1/transform \
-F xml="<data.xml" \
-F template="template-name" \
-F output="pdf" \
-o result.pdf
You can also use a string instead of a file with curl
1
-F xml=" <hello>world</hello>" \

Options

 
format
Required: Yes

Data to use for the document creation, must be xml or json.

 
template
Required: Yes

Template’s name to use.

You can use json sintax here to access data and have dynamic template names

Example
format JSON XML
1
2
3
4
5
{
"Data": {
"customer": "123"
}
}
Template name can use any data attribute or text node
1
invoice-customer-{{Data.customer}}
We will translate that to the following
1
invoice-customer-123
1
<Data customer="123"></Data>
Template name can use any data attribute or text node
1
invoice-customer-{{Data._customer}}
We will translate that to the following
1
invoice-customer-123
And finally the service will try to find the template invoice-customer-123 in order to transform the data and generate the document.
 
output
Required: Yes

Document response type from the service, it can be html, pdf, png or jpg.

 
templateBackup

Template’s name to use to be used if the option template is not available in the service.

 
note

Custom note that can be used to add any information, it’s limit up to 500 chars. This is useful if you want to add metadata such as document, transaction or customer ID.

You can use json syntax to access data and get dynamic template names.

Example
format JSON XML
1
2
3
4
5
{
"Data": {
"customer": "123"
}
}
Notes can use any data attribute or text
1
2
Document: Invoice
Customer: {{Data.customer}}
We will translate that to the following
1
2
Document: Invoice
Customer: 123
1
<Data customer="123"></Data>
Notes can use any data attribute or text
1
2
Document: Invoice
Customer: {{Data._customer}}
We will translate that to the following
1
2
Document: Invoice
Customer: 123