Developer API
KPI Categories
KPIs are organized into categories to make it easier for the admins to manage and assign KPIs.
KPI Category Object
The object has the following properties:
Name | Type | Read Only | Mandatory | Max Len. | Notes |
---|---|---|---|---|---|
id | integer | yes | no | Automatically generated for the KPI category | |
name | string | no | yes | 50 | The name of the KPI category |
sort_order | integer (16 bit) | no | yes | The display order of the KPI category | |
created_at | datetime | yes | no | The UTC date and time the category was created | |
updated_at | datetime | yes | no | The UTC date and time the category was updated |
JSON Example
{ "id": 1234, "name": "Sales Category", "sort_order": 1, "created_at": "2013-02-21T10:12:00", "updated_at": "2013-02-21T10:12:00" }
XML Example
<KPICategory xmlns="http://schemas.datacontract.org/2004/07/SimpleKPI.Application.Areas.Api.Models" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> <id>1234</id> <name>Sales Category</name> <sort_order>1</sort_order> <created_at>2013-02-21T10:12:00</created_at> <updated_at>2013-02-21T10:12:00</updated_at> </KPICategory>
Get all KPI Categories
GET /api/kpicategories
Using curl
curl https://{subdomain}.simplekpi.com/api/kpicategories -v -u {email_address}:{token}
Example Response
Status: 200 OK [ { "id": 1234, "name": "Sales Category", "sort_order": 1, "created_at": "2013-02-21T10:12:00", "updated_at": "2013-02-21T10:12:00" }, { "id": 1235, "name": "Financial KPIs", "sort_order": 2, "created_at": "2013-02-21T10:12:00", "updated_at": "2013-02-21T10:12:00" } ]
Get a KPI Category
GET /api/kpicategories/{id}
Using curl
curl https://{subdomain}.simplekpi.com/api/kpicategories/{id} -v -u {email_address}:{token}
Example Response
Status: 200 OK { "id": 1234, "name": "Sales Category", "sort_order": 1, "created_at": "2013-02-21T10:12:00", "updated_at": "2013-02-21T10:12:00" }
Add a KPI Category
POST /api/kpicategories
Using curl
curl https://{subdomain}.simplekpi.com/api/kpicategories -H "Content-Type: application/json" -d '{"name": "Sales Category", "sort_order": 1}' -v -u {email_address}:{token} -X POST
Example Response
Status: 201 Created Location: https://{subdomain}.simplekpi.com/api/kpicategories/{id} { "id": 1234, "name": "Sales Category", "sort_order": 1, "created_at": "2013-02-21T10:12:00", "updated_at": "2013-02-21T10:12:00" }
Update a KPI Category
PUT /api/kpicategories/{id}
Using curl
curl https://{subdomain}.simplekpi.com/api/kpicategories/{id} -H "Content-Type: application/json" -d '{"name": "Sales Category", "sort_order": 1}' -v -u {email_address}:{token} -X PUT
Example Response
Status: 200 OK { "id":1, "name":"Offices", "sort_order":1, "created_at":"2012-11-30T10:40:00", "updated_at":"2012-11-30T10:40:00" }
Delete a KPI Category
DELETE /api/kpicategories/{id}
Using curl
curl https://{subdomain}.simplekpi.com/api/kpicategories/{id} -v -u {email_address}:{token}
Example Response
Status: 200 OK