Assigns

You can list your available assigns with the following URL:

                GET https://api.smallinvoice.com/assign/list/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
limitintno0Limit the amount of results
pageintno1When limiting the results, specifies page
sortstringnonamename
number
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.smallinvoice.com/assign/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 Assign Objects

Example content of data variable:

    {
        "error":false,
        "page":1,
        "pages":1,
        "count":2,
        "items":[
            {
                "id":3,
                "type":4,
                "type_id":16,
                "name":"Working for Project X",
                "employee":"John Doe",
                "hours":3,
                "year":2013,
                "month":2,
                "day":27,
                "date":"2013-02-27",
                "activity":"",
                "comment":"Repairing car",
                "billed":0
            },
            {
                "id":2,
                "type":1,
                "type_id":1,
                "name":"Working for Project Y",
                "employee":"Jane Doe",
                "hours":1.25,
                "year":2013,
                "month":2,
                "day":28,
                "date":"2013-02-28",
                "activity":"",
                "comment":"Cleaning house",
                "billed":0
            }
        ]
    }
    

You can get your assign with the following URL:

                GET https://api.smallinvoice.com/assign/get/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the assign


Example: Making a request for assign with id 5

                GET https://api.smallinvoice.com/assign/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 Assign

Example content of data variable:

    {
        "error":false,
        "item":{
            "id":3,
            "type":4,
            "type_id":16,
            "name":"Working for Project X",
            "employee":"John Doe",
            "hours":3,
            "year":2013,
            "month":2,
            "day":27,
            "date":"2013-02-27",
            "activity":"",
            "comment":"Repairing car",
            "billed":0
        }
    }
    

You can add a new assign with the following URL:

                POST https://api.smallinvoice.com/assign/add
            

Body parameters

NameTypeRequiredDefaultNotes
typeintyesSee Assign Types
type_idintyesId of assigned type
hoursfloatyesAssigned hours
datedateyesDay of setting the assignment
activitystringnoActivity name
commentstringnoComment to assignment


Example: Creating a new assign

                POST https://api.smallinvoice.com/assign/add/
            

Example content of data variable:
{
    "type":4,
    "type_id":16,
    "hours":3,
    "date":"2013-02-27",
    "activity":"",
    "comment":"Repairing car"
}

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

Example response:

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

You can edit an assign with the following URL:

                POST https://api.smallinvoice.com/assign/edit
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the assign

Body parameters

NameTypeNotes
typeintSee Assign Types
type_idintId of assigned type
hoursfloatAssigned hours
datedateDay of setting the assignment
activitystringActivity name
commentstringComment to assignment


Example: Editing an assign with id 5

                POST https://api.smallinvoice.com/assign/edit/id/5
            

Example content of data variable:
{
    "type":4,
    "type_id":16,
    "name":"Working for Project Y",
    "employee":"Jane Doe",
    "hours":3,
    "year":2013,
    "month":2,
    "day":27,
    "date":"2013-02-27",
    "activity":"",
    "comment":"Cleaning house",
    "billed":0
}

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 delete an assign with the following URL:

                POST https://api.smallinvoice.com/assign/delete/
            

URL Parameters

NameTypeRequiredDefaultOptionsNotes
idintyesThe Id of the assign


Example: Making a request for deleting assign with id 5

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