Xpenser API: Projects

Query / List

URL: /api/v1.0/projects/projects

Method: GET

Parameters:

Sample Usage:

List all projects in which I'm a participant in json format:

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

Response:

[
    {
        "status": "A", 
        "organization_id": 663, 
        "externalid": null, 
        "name": "Health and Sciences", 
        "id": 2
    }, 
    {
        "status": "A", 
        "organization_id": 663, 
        "externalid": null, 
        "name": "Government", 
        "id": 3
    }
]

List of all projects for the company regardless of whether I'm a participant or not:

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

Create

URL: /api/v1.0/projects/project

Method: POST

Parameters:

Sample Usage:

curl -u user:password -d "name=Health+And+Sciences" "http://xpenser.com/api/v1.0/projects/project"

Response:

{
    "status": "A", 
    "organization_id": 663, 
    "externalid": null, 
    "name": "Health And Sciences", 
    "id": 615
}

Read

URL: /api/v1.0/projects/project/{project_id}

Method: GET

Sample Usage:

curl -u "user:password" "http://xpenser.com/api/v1.0/projects/project/615"

Response:

{
    "status": "A", 
    "organization_id": 663, 
    "externalid": null, 
    "name": "Health And Sciences", 
    "id": 615
}

Update

URL: /api/v1.0/projects/project/{project_id}

Method: POST

Parameters:

Sample Usage:

curl -u user:password -d "status=X" "http://xpenser.com/api/v1.0/projects/project/615"

Response:

{
    "status": "X", 
    "organization_id": 663, 
    "externalid": null, 
    "name": "Health And Sciences", 
    "id": 615
}

Delete

URL: /api/v1.0/projects/project/{project_id}/?action=delete

Method: POST

Sample Usage:

curl -u user:password -d "" "http://xpenser.com/api/v1.0/projects/project/615?action=delete"

Response: HTTP 204 return code