KpisApi Resource

GET /kpis

For an authenticated user, this method retrieves all KPIs visible to the user sorted alphabetically

Request Parameters
name type description default constraints
firstResult query The first result(used in pagination) 0 min: 0
owner query Specifies whether the kpis returned should be all that he has access to, or only those of which he is creator. Possible values: ALL, ME. Note that case matters! ALL "ALL" or "ME" or "PUBLIC" or "SHARED"
pageSize query The page size (used in pagination) 10 min: 0
Response Body
media type data type description
application/json KpisResponse (JSON) A json containing representing the KPI.

Example

Request
GET /kpis
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "totalNumberOfKpis" : 12345,
  "keyPerformanceIndices" : [ {
    "id" : 12345,
    "name" : "...",
    "language" : "LA",
    "andKpiTerms" : [ "...", "..." ],
    "orKpiTerms" : [ "...", "..." ],
    "description" : "...",
    "editable" : true
  }, {
    "id" : 12345,
    "name" : "...",
    "language" : "GV",
    "andKpiTerms" : [ "...", "..." ],
    "orKpiTerms" : [ "...", "..." ],
    "description" : "...",
    "editable" : true
  } ]
}
                
              

POST /kpis

For an authenticated user, this method allows the user to create a KPI

The Content-Type in the header must be set to: application/json;charset="UTF-8"

Request Body
media type data type description
application/json KeyPerformanceIndex (JSON) The specification of the KeyPerformanceIndex to be create

language: language of the Key Performance Index

name: name of the Key Performance Index

description: description of the Key Performance Index

andKpiTerm: 'AND' terms to be included in the Key Performance Index

orKpiTerm: 'OR' terms to be included in the Key Performance Index

A note about the OR and AND terms about the KPI. The AND terms specify terms that MUST ALL be in the document. Out of the OR terms, atleast one must be present in the documents. Eg: If OR terms are "HELLO" and "BYE"; and AND terms are "EVERYONE" and "ALSO", the document must contain: ( EVERYONE AND ALSO) AND ( HELLO OR BYE ).
Note that if only one AND / OR term is specified, it does not matter if it is under OR or AND

Response Body
media type data type description
application/json KeyPerformanceIndex (JSON) A json containing representing the created KPI.

Example

Request
POST /kpis
Content-Type: application/json
Accept: application/json

                
{
  "andKpiTerms" : [ "...", "..." ],
  "orKpiTerms" : [ "...", "..." ],
  "language" : "LA",
  "name" : "...",
  "description" : "..."
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "editable" : true
}
                
              

DELETE /kpis/{id}

For an authenticated user, this method deletes a previously created KeyPerformanceIndex, as long as the KeyPerformanceIndex was created by the user, and is not referenced anywhere else. All associated observers are also deleted.

Request Parameters
name type description default constraints
id path The id of KeyPerformanceIndex for which the user wants to remove.   required, min: 1
sectorId query The id of the sector in the context of which the KeyPerformanceIndex is to be removed: If the KeyPerformanceIndex is not referenced by any other sector than the one identified by this parameter, it is removed. However, if the KeyPerformanceIndex is referenced by any other sectors, it is not removed. -1 int
Response Body
media type data type description
application/json boolean (JSON) A boolean representing whether the operation was successful.

Example

Request
DELETE /kpis/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...
                
              

GET /kpis/{id}

For an authenticated user, this method gets a previously created KeyPerformanceIndex, as long as the KeyPerformanceIndex was created by the user.

Request Parameters
name type description constraints
id path The id of KeyPerformanceIndex for which the user wants to retrive required, min: 1
Response Body
media type data type description
application/json KeyPerformanceIndexDetails (JSON) A json containing representing the KPI.

Example

Request
GET /kpis/{id}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "language" : "NA",
  "andKpiTerms" : [ "...", "..." ],
  "orKpiTerms" : [ "...", "..." ],
  "description" : "...",
  "editable" : true
}
                
              

PUT /kpis/{id}

For an authenticated user, this method allows the user to modify a Key Performance Index created by the user

The Content-Type in the header must be set to: application/json;charset="UTF-8"

Request Parameters
name type description constraints
id path The id of the kpi to be modified min: 1
Request Body
media type data type description
application/json KeyPerformanceIndex (JSON) The new specification of the KeyPerformanceIndex to be modified

language: language of the Key Performance Index

name: name of the Key Performance Index

description: description of the Key Performance Index

andKpiTerm: 'AND' terms to be included in the Key Performance Index

orKpiTerm: 'OR' terms to be included in the Key Performance Index

Response Body
media type data type description
application/json KeyPerformanceIndex (JSON) A json containing representing the modified KPI.

Example

Request
PUT /kpis/{id}
Content-Type: application/json
Accept: application/json

                
{
  "andKpiTerms" : [ "...", "..." ],
  "orKpiTerms" : [ "...", "..." ],
  "language" : "GV",
  "name" : "...",
  "description" : "..."
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "editable" : true
}