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 letters with the following URL.

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

URL Parameters

NameTypeRequiredDefaultOptionsNotes
limitintno0Limit the amount of results
pageintno1When limiting the results, specifies page
sortstringnorecipientrecipient
company
address
country
pages
status
Sorts the list by the available values
sorttypestringnoascasc
desc
Defines the way of sorting


Example: Making a request with 100 Results, getting second page, and sorting by country descending

        GET https://api.pingen.com/letter/list/limit/100/page/2/sort/country/sorttype/desc
    

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 Letter Objects
Example response:
{
    "error":false,
    "page":1,
    "pages":1,
    "count":2,
    "items":[
        {
            "id":1,
            "title":"Confirming your offer",
            "date":"2012-08-12",
            "place":"Zürich",
            "content":"Dear Rian...",
            "recipient":"Rian Smith",
            "company":"ACME GmbH",
            "address":"Mainstreet 10\n8000 Zürich\nSwitzerland",
            "country":"CH",
            "signature_id":8,
            "layout_id":1,
			"user_id":4,
            "pages":1,
            "status":1,
            "sent":1
        },
        {
            "id":2,
            "title":"Request for transfer papers",
            "date":"2012-08-12",
            "place":"Zürich",
            "content":"Dear Rian...",
            "recipient":"Rian Smith",
            "company":"ACME GmbH",
            "address":"Subsidiarystreet 2\n3000 Bern\nSwitzerland",
            "country":"CH",
            "signature_id":0,
            "layout_id":1,
			"user_id":4,
            "pages":1,
            "status":1,
            "sent":1
        }
    ]
}

You can get your letter object with the following URL:

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

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the letter


Example: Making a request for letter with id 5

                    GET https://api.pingen.com/letter/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 Letter

Example response:

    {
        "error":false,
        "item":{
            "id":2,
            "title":"Request for transfer papers",
            "date":"2012-08-12",
            "place":"Zürich",
            "content":"Dear Rian...",
            "recipient":"Rian Smith",
            "company":"ACME GmbH",
            "address":"Subsidiarystreet 2\n3000 Bern\nSwitzerland",
            "country":"CH",
            "signature_id":0,
            "layout_id":1,
			"user_id":4,
            "pages":1,
            "status":1,
            "sent":1
        }
    }
    

You can add new letter with the following URL:

                    POST https://api.pingen.com/letter/add
                

Body parameters

NameTypeRequiredDefaultNotes
recipientscollectionYesRecipient Objects
titlestringNoTitle of letter
datedateNoLetter date (yyyy-mm-dd)
placestringNoThe letter place of creation
contentstringNoFull content of the letter
layout_idintNoDefault of CompanyLayout used in this letter
signature_idintNoThe id of the signature used


Example: Creating a new letter

                    POST https://api.pingen.com/letter/add/
                

Example content of data variable
        {
            "recipients":[
                {
                    "name":"Steve Willson",
        			"company":"ACME GmbH",
                    "address":"Mainstreet 10\n8000 Zürich\nSwitzerland"
                }
            ],
            "title":"My first letter",
            "date":"2012-08-02",
            "content":"Content of the letter, using basic HTML"
        }
     

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 Letter Object that was created

Example response:

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

You can add edit a letter with the following URL:

                    POST https://api.pingen.com/letter/edit
                

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the letter

Body parameters

NameTypeRequiredDefaultNotes
overwriteintIf series letter yesDefine how changes are applied. 1 = for all letters, 2 = only for this one
recipientscollectionNoList of all recipients
titlestringNoTitle of letter
datedateNoLetter date (yyyy-mm-dd)
placestringNoThe letter place of creation
contentstringNoFull content of the letter
layout_idintNoDefault of CompanyLayout used in this letter
signature_idintNoThe id of the signature used


Example: Editing a letter with id 54

                    POST https://api.pingen.com/letter/edit/id/54
                

Example content of data variable
        {
            "title":"New letter title"
        }
     

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
    }
    

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

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

URL Parameters

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


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

                    GET https://api.pingen.com/letter/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/letter/pdf/
                

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the letter


Example: Getting PDF of letter with id 5

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

Response

NameTypeNotes
HTTP Bodyapplication/pdfThe PDF in raw format

You can send a letter to postmail with following URL:

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

Request Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the letter

Body Parameters

NameTypeRequiredDefaultOptionsNotes
speedintyes1 = Priority
2 = Economy
Speed of sending
colorintno00 = B/W
1 = Color
Type of print


Example: Sending a document with id 5 economy

                    POST https://api.pingen.com/letter/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 Post Object that was created

Example response:

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

You can delete a letter with the following URL:

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

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the letter


Example: Making a request for deleting letter with id 5

                    POST https://api.pingen.com/letter/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
    }