Xpenser API: Tags

Query / List

URL: http://xpenser.com/api/v1.0/tags/

Method: GET

Parameters:

Sample Usage:

List all expenses in the default report in json format:

curl -u user:password "http://xpenser.com/api/v1.0/tags/"

Response:

[
    {
        "name": "clientx",
        "id": 19
    },
    {
        "name": "deposit",
        "id": 23
    },
    {
        "name": "meals",
        "id": 24
    },
    {
        "name": "gas",
        "id": 26
    },
    {
        "name": "mileage",
        "id": 27
    },
    {
        "name": "personal",
        "id": 29
    }
]

Create

URL: /api/v1.0/tag/

Method: POST

Parameters:

Sample Usage:

curl -u user:password -d "name=mytag" "http://xpenser.com/api/v1.0/tag/"

Response:

{
    "name": "mytag",
    "id": 82
}

Read

URL: /api/v1.0/tag/{tag_id}

Method: GET

Sample Usage:

curl -u user:password "http://xpenser.com/api/v1.0/tag/82"

Response:

{
    "name": "mytag",
    "id": 82
}

Update

URL: /api/v1.0/tag/{tag_id}

Method: POST

Parameters:

Sample Usage:

curl -u user:password -d "name=newname" "http://xpenser.com/api/v1.0/tag/82"

Response:

{
    "name": "newname",
    "id": 82
}

Delete

URL: /api/v1.0/tag/{tag_id}/?action=delete

Method: POST

Sample Usage:

curl -u user:password -d "" "http://xpenser.com/api/v1.0/tag/82"

Response: HTTP 204 return code