A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: core/MY_Controller.php

Line Number: 258

Backtrace:

File: /home/lourenss/www/pingen_www/application/core/MY_Controller.php
Line: 258
Function: _error_handler

File: /home/lourenss/www/pingen_www/application/core/MY_Controller.php
Line: 54
Function: get_browser_language

File: /home/lourenss/www/pingen_www/application/controllers/Api.php
Line: 7
Function: __construct

File: /home/lourenss/www/pingen_www/index.php
Line: 316
Function: require_once

Pingen | Send Letters Online for Private, Business and Software Developers

You can list your available documents with the following URL.

                    GET https://api.pingen.com/document/list/
                

URL Parameters

NameTypeRequiredDefaultOptionsNotes
limitintno0Limit the amount of results
pageintno1When limiting the results, specifies page
sortstringnodatedate
pages
country
Sorts the list by the available values
sorttypestringnodescasc
desc
Defines the way of sorting


Example: Making a request with 100 Results, getting second page, and sorting by date ascending

        GET https://api.pingen.com/document/list/limit/100/page/2/sort/date/sorttype/asc/
    

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
pageintCurrent page that was passed in on the request
pagesintTotal number of pages available
countintTotal number of objects available
itemscollectionCollection of Document Objects

Example response:

    {
        "error":false,
        "page":1,
        "pages":1,
        "count":2,
        "items":[
            {
                "id":5452,
                "filename":"My_other_document.pdf",
                "date":"2012-08-12 18:50:38",
                "user_id": 35,
                "address": "Technoparkstrasse 1\n8005 Zürich\nSwitzerland",
                "country": "CH",
                "size": 196897,
                "pages":1,
                "pagetype":[
                    {
                        "number":1,
                        "type":2,
                        "color":1
                    }
                ],
                "rightaddress":0,
                "status":1,
                "sent":0,
                "fileremoved":0,
                "requirement_failure":0
            },
            {
                "id":5453,
                "filename":"My_other_document.pdf",
                "date":"2012-08-12 18:50:38",
                "user_id": 35,
                "address": "Technoparkstrasse 1\n8005 Zürich\nSwitzerland",
                "country": "CH",
                "size": 196897,
                "pages":1,
                "pagetype":[
                    {
                        "number":1,
                        "type":2,
                        "color":1
                    }
                ],
                "rightaddress":0,
                "status":1,
                "sent":1,
                "fileremoved":0,
                "requirement_failure":0
            }
        ]
    }
    

You can get your document with the following URL:

                    GET https://api.pingen.com/document/get/
                

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the document


Example: Making a request for document with id 5

                    GET https://api.pingen.com/document/get/id/5
                

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
itemobjectObject of Document

Example response:

    {
        "error":false,
        "item":{
            "id":5452,
            "filename":"My_other_document.pdf",
            "date":"2012-08-12 18:50:38",
            "user_id": 35,
            "address": "Technoparkstrasse 1\n8005 Zürich\nSwitzerland",
            "country": "CH",
            "size": 196897,
            "pages":1,
            "pagetype":[
                {
                    "number":1,
                    "type":2,
                    "color":1
                }
            ],
            "rightaddress":0,
            "status":1,
            "sent":0,
            "fileremoved":0,
            "requirement_failure":0
        }
    }
    

You can upload a new document with following URL:

                    POST https://api.pingen.com/document/upload/
                

File content variable

NameTypeRequiredDefaultOptionsNotes
fileraw fileyesPDF or ZIPThe file you would like to send

Body Parameters

NameTypeRequiredDefaultOptionsNotes
sendbooleannofalsetrue = automatically send
false = just upload
Defines if a document is merely uploaded or also sent
speedintif send=true yes
if send=false no
1 = Priority
2 = Economy
Defines the sending speed if the document is automatically sent
colorintno00 = B/W
1 = Color
2 = Mixed (optimized)
Type of print
duplexintno00 = Simplex
1 = Duplex
Paper handling
rightaddressintno00 = Address left
1 = Address right
If not passed, account default is taken.
envelopeintno0Envelope ID of prepared and designed envelope in your account.


Example: Uploading a new document and automatically sending it economy

                    POST https://api.pingen.com/document/upload/
                

Example content of data variable
    {
        "send":true,
        "speed":2,
        "color":1
    }
    
Example content of file variable
        Here the raw output of your file is passed
    

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
idintThe Id of the Document object that was created
itemobjectObject of Document
sendarrayOnly available if send=true. Array list linking document ids to post ids.

Example response:

    {
        "error":false,
        "id": 43,
        "item":{
            "id":43,
            "filename":"My_other_document.pdf",
            "date":"2012-08-12 18:50:38",
            "user_id": 35,
            "address": "Technoparkstrasse 1\n8005 Zürich\nSwitzerland",
            "country": "CH",
            "size": 196897,
            "pages":1,
            "pagetype":[
                {
                    "number":1,
                    "type":2,
                    "color":1
                }
            ],
            "rightaddress":0,
            "status":1,
            "requirement_failure":0
        },
        "send":[
            {
                "document_id":43,
                "send_id":101
            }
        ]
    }
    

You can get a document preview in PNG form for each page of a document

                    GET https://api.pingen.com/document/preview/
                

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the document
pageintno1The page you want to retreive
sizeintno595240
595
600
825
972
1240
The size in pixels


Example: Getting second page in size 1240 for document with id 5

                    GET https://api.pingen.com/document/preview/id/5/page/2/size/1240
                

Response

NameTypeNotes
HTTP Bodyimage/pngThe image in raw format

You can get the full PDF by getting following URL:

                    GET https://api.pingen.com/document/pdf/
                

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the document


Example: Getting PDF of document with id 5

                    GET https://api.pingen.com/document/pdf/id/5/
                

Response

NameTypeNotes
HTTP Bodyapplication/pdfThe PDF in raw format

You can send a document to postmail with following URL:

                    POST https://api.pingen.com/document/send/
                

Request Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the document

Body Parameters

NameTypeRequiredDefaultOptionsNotes
speedintyesVaries per CountryList of sending speeds per country available here (Tab Speed)
colorintno00 = B/W
1 = Color
2 = Mixed (optimized)
Type of print
duplexintno00 = Simplex
1 = Duplex
Paper handling
rightaddressintno00 = Address left
1 = Address right
If not passed, account default is taken.
envelopeintno0Envelope ID of prepared and designed envelope in your account.
valuesobjectmixedContains various content, possible options listed below
values->senderobjectmixedValues: name, street, code, city, country (ISO2)Only required for A-Post Plus and Registered letters
values->recipientobjectmixedValues: name, street, no, code, city, country (ISO2)Only required for A-Post Plus and Registered letters


Example: Sending a document with id 5 economy

                    POST https://api.pingen.com/document/send/id/5
                

Example content of data variable
    {
        "speed":2,
        "color":1,
    }
    

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.
idintThe Id of the Send object that was created

Example response:

    {
        "error":false,
        "id": 43
    }
    

You can delete a document with the following URL:

                    POST https://api.pingen.com/document/delete/
                

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the document


Example: Making a request for deleting document with id 5

                    POST https://api.pingen.com/document/delete/id/5
                

Response

NameTypeNotes
errorbooleanIs true if an error occured
errorcodeintCode of the error. Only returned if error is true.
errormessagestringInformational message about the error. Only returned if error is true.

Example response:

    {
        "error":false
    }