Misc Account Info And Misc
Related Knowledgebase-Explore Samples
Files Storage
You can upload files as temporary files into PDF.co. Temporary files are stored for 1 hour by default and then auto removed.
To store files permanently (pdf templates, images you want to reuse) please use PDF.co built-in files storage at https://app.pdf.co/files instead.
You can also use 3rd party cloud services:
- Dropbox: you can use
public link
to a file from Dropbox - Google Drive: you can use link to a file that was shared as
anyone with a link
- Google Docs/Sheets/Slides: you can use a link to a document in Google Docs that was shared as
anyone with a link
- Any other cloud service that can store a file and provide a link to uploaded file.
IMPORTANT NOTE FOR GOOGLE DRIVE/DOCS users: free Google Drive/Docs limits the number of requests to their files. If you use a link to file or document from Google Drive or Google Drive then make sure you have no more than 5-10 requests per minute. Otherwise Google Drive returns no file or error page.
Temporary Files Upload
You can upload temporary files up to 2GB in size. Please note that to process these files you should use async=true
mode with data extraction and tools endpoints along with /job/check
to check status of background jobs you create.
Steps to Upload File:
1) First, call /file/upload/get-presigned-url
. It will generate link for uploading (presignedUrl
) and final link (url
) 2) Now send your file to the presignedUrl
link using the PUT
method within the next 30 minutes. 3) Once finished, use url
to access the file you have just uploaded.
Note: all uploaded files are considered to be temporary files and are automatically permanently removed after 1 hour.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If a file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example: Uploading a Temporary File
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
GET
https://api.pdf.co/v1/file/upload/get-presigned-url?name=test.pdf&encrypt=true
200
{
"presignedUrl": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=900&....",
"url": "https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=....",
"error": false,
"status": 200,
"name": "test.pdf",
"remainingCredits": 93574
}
PUT
https://pdf-temp-files.s3-us-west-2.amazonaws.com/28e191b14f3a4f43b16fcef1d53d191e/test.pdf?X-Amz-Expires=900&....
--form 'file=@/path/to/file'
200
{
}
Now you can access your file using link from "url" param to from the first step.
Available Methods
[GET] /account/credit/balance
Description: Get remaining account balance.
Status Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If a file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
- Method: GET
- URL: /v1/account/credit/balance
Query parameters
No query parameters accepted.
Body payload
No body parameters accepted.
Example responses
/account/credit/balance
{
"remainingCredits": 99795868
}
Code Snippet
CURL
curl --location --request GET 'https://api.pdf.co/v1/account/credit/balance' \
--header 'x-api-key: '
[GET] /license/info (on-prem API Server only)
Description: Get your complete license information.
Errors
Code | Description |
---|---|
200 | The request has succeeded |
400 | bad input parameters |
401 | unauthorized |
403 | not enough credits |
405 | Timeout error. To process large documents or files please use asynchronous mode ( set async parameter to true) and then check the status using /job/check endpoint. If a file contains many pages then specify a page range using pages parameter. The number of pages of the document can be obtained using the endpoint /pdf/info |
Example
Sample Request:
! Don’t forget to set x-api-key
url param or http header param (preferred) to API key, get yours here
- Method: GET
- URL: /license/info
Query parameters
No query parameters accepted.
Body payload
No body parameters accepted.
Example responses
/license/info (on-prem API Server only)
{
"body": {
"modules": [
{
"moduleName": "PDFExtractor",
"enabled": true,
"licenseInfo": {
"LicenseType": "Commercial",
"UpdatesExpireOn": "Never",
"LimitType": "Unlimited",
"LimitTerm": "None",
"Limit": -1,
"Remainder": -1
}
},
{
"moduleName": "PDFToHTML",
"enabled": true,
"licenseInfo": {
"LicenseType": "Commercial",
"UpdatesExpireOn": "Never",
"LimitType": "Unlimited",
"LimitTerm": "None",
"Limit": -1,
"Remainder": -1
}
},
{
"moduleName": "PDFGenerator",
"enabled": true,
"licenseInfo": {
"LicenseType": "Commercial",
"UpdatesExpireOn": "Never",
"LimitType": "Unlimited",
"LimitTerm": "None",
"Limit": -1,
"Remainder": -1
}
},
{
"moduleName": "BarcodeGenerator",
"enabled": true,
"licenseInfo": {
"LicenseType": "Commercial",
"UpdatesExpireOn": "Never",
"LimitType": "Unlimited",
"LimitTerm": "None",
"Limit": -1,
"Remainder": -1
}
},
{
"moduleName": "BarcodeReader",
"enabled": true,
"licenseInfo": {
"LicenseType": "Commercial",
"UpdatesExpireOn": "Never",
"LimitType": "Unlimited",
"LimitTerm": "None",
"Limit": -1,
"Remainder": -1
}
},
{
"moduleName": "PDFRenderer",
"enabled": true,
"licenseInfo": {
"LicenseType": "Commercial",
"UpdatesExpireOn": "Never",
"LimitType": "Unlimited",
"LimitTerm": "None",
"Limit": -1,
"Remainder": -1
}
},
{
"moduleName": "Spreadsheet",
"enabled": true,
"licenseInfo": {
"LicenseType": "Commercial",
"UpdatesExpireOn": "Never",
"LimitType": "Unlimited",
"LimitTerm": "None",
"Limit": -1,
"Remainder": -1
}
},
{
"moduleName": "DocumentParser",
"enabled": true,
"licenseInfo": {
"LicenseType": "Commercial",
"UpdatesExpireOn": "Never",
"LimitType": "Unlimited",
"LimitTerm": "None",
"Limit": -1,
"Remainder": -1
}
},
{
"moduleName": "TextRecognition",
"enabled": true,
"licenseInfo": {
"LicenseType": "Commercial",
"UpdatesExpireOn": "Never",
"LimitType": "Unlimited",
"LimitTerm": "None",
"Limit": -1,
"Remainder": -1
}
}
]
},
"pageCount": 0,
"error": false,
"status": 200
}
Code Snippet
CURL
curl --location --request GET 'localhost:8080/license/info'
Knowledgebase
Samples
Copyright © 2016 - 2023 PDF.co