Siirry sisältöön
API: Dimensions
GET /dimension_api/
Fetch a list of all dimensions
Request parameters
Request can be filtered using query parameters as described below.
For example:
- Fetch only dimension with code 100:
- Fetch all dimensions of type 2
- /dimension_api?dimension_type_id=2
- Fetch all active dimensions of type 3
- /dimension_api?dimension_type_id=3&is_active=1
Name |
Description |
Data type |
Req’d |
Example |
code |
Code of the dimension |
string |
|
100 |
dimension_type_id |
Unique identifier of the dimension type |
int |
|
2 |
|
|
|
|
|
Response
Response code |
Description |
200 |
Ok, fetching a dimension was successfull |
404 |
Unable to add a dimension. Further information can be found from the errors array in response JSON |
405 |
Invalid method, double check you are sending ”GET” and not ”POST” etc |
503 |
Service Unavailable |
Name |
Description |
Data type |
Possible values / Examples |
status |
Status of the operation |
string |
OK / ERROR |
|
|
|
|
Name |
Description |
Data type |
Possible values / Examples |
id |
Unique identifier of the dimension |
int |
1 |
code |
Code of the dimension |
string |
ABC |
name_fi |
Dimension name in finnish |
string |
Projekti ABC |
name_en |
Dimension name in english |
string |
Project ABC |
name_sv |
Dimension name in swedish |
string |
Projekt ABC |
description |
Description of the dimension |
string |
|
is_active |
Dimension is visible in the UI |
int |
0 = Not active, 1 = Active |
active_after |
Dimension is active after this date |
string (date) |
|
|
|
|
|
Name |
Description |
Data type |
Possible values / Examples |
id |
Unique identifier of the dimension type |
int |
1 |
name_fi |
Dimension type name in finnish |
string |
Projekti |
name_en |
Dimension type name in english |
string |
Project |
name_sv |
Dimension type name in swedish |
string |
Projekt |
|
|
|
|
GET /dimension_api/<id>
Fetch one dimension
Example:
- /dimension_api/<id>
- /dimension_api/2
Request parameters
Name |
Description |
Data type |
Req’d |
Example |
id |
Unique identifier of the dimension |
int |
YES |
2 |
|
|
|
|
|
Response
Response code |
Description |
200 |
Ok, fetching a dimension was successfull |
404 |
Unable to add a dimension. Further information can be found from the errors array in response JSON |
405 |
Invalid method, double check you are sending ”GET” and not ”POST” etc |
503 |
Service Unavailable |
Name |
Description |
Data type |
Possible values / Examples |
status |
Status of the operation |
string |
OK / ERROR |
|
|
|
|
Name |
Description |
Data type |
Possible values / Examples |
id |
Unique identifier of the dimension |
int |
1 |
code |
Code of the dimension |
string |
ABC |
name_fi |
Dimension name in finnish |
string |
Projekti ABC |
name_en |
Dimension name in english |
string |
Project ABC |
name_sv |
Dimension name in swedish |
string |
Projekt ABC |
description |
Description of the dimension |
string |
|
is_active |
Dimension type is visible in the UI |
int |
0 = Not active, 1 = Active |
active_after |
Dimension is active after this date |
string (date) |
|
|
|
|
|
POST /dimension_api/add
Create a new or edit existing dimension using FORM DATA.
Request parameters
Name |
Description |
Data type |
Req’d |
Example |
id |
Unique identifier of the dimension. If id is given, existing dimension will be updated. |
int |
|
1 |
dimension_type_id |
Unique identifier of the dimension type |
int |
YES |
1 |
code |
Short code of the dimension |
string |
YES |
ABC |
name_fi |
Dimension name in finnish |
string |
YES |
Projekti ABC |
name_en |
Dimension name in english |
string |
|
Project ABC |
name_sv |
Dimension name in swedish |
string |
|
Projekt ABC |
description |
Description of the dimension |
string |
|
|
is_active |
Dimension is visible in the UI |
int |
|
0 = Not active, 1 = Active |
active_after |
Dimension is active after this date |
string (date) |
|
2018-01-01 |
|
|
|
|
|
Response
Response code |
Description |
200 |
Ok, adding a dimension was successfull |
400 |
Unable to add a dimension. Further information can be found from the errors array in response JSON |
401 |
API key / company code is invalid or the user does not have permission to add statements |
405 |
Invalid method, double check you are sending ”POST” and not ”GET” etc |
503 |
Service Unavailable |
Name |
Description |
Data type |
Possible values / Examples |
status |
Status of the operation |
string |
OK / ERROR |
id |
If adding a dimension was successfull, id contains unique identifier for the newly created dimension |
int |
1234 |
|
|
|
|
POST /dimension_api/add/type
Create a new dimension type using FORM DATA.
Request parameters
Name |
Description |
Data type |
Req’d |
Example |
name_fi |
Dimension type name in finnish |
string |
YES |
Projekti |
name_en |
Dimension type name in english |
string |
|
Project |
name_sv |
Dimension type name in swedish |
string |
|
Projekt |
description |
Description of the dimension type |
string |
|
|
|
|
|
|
|
Response
Response code |
Description |
200 |
Ok, adding a dimension type was successfull |
400 |
Unable to add a dimension type. Further information can be found from the errors array in response JSON |
401 |
API key / company code is invalid or the user does not have permission to add statements |
405 |
Invalid method, double check you are sending ”POST” and not ”GET” etc |
503 |
Service Unavailable |
Name |
Description |
Data type |
Possible values / Examples |
status |
Status of the operation |
string |
OK / ERROR |
id |
If adding a dimension type was successfull, id contains unique identifier for the newly created dimension type |
int |
1 |
|
|
|
|
GET /dimension_api/get/types
Fetch a list of dimension types
Request parameters
Name |
Description |
Data type |
Req’d |
Example |
dimension_type_id |
Optional, provide a unique identifier of a dimension type to return only one dimension type |
int |
YES |
Projekti |
|
|
|
|
|
Example queries:
- Fetch all dimension types
- Fetch only one dimension type (id: 2)
- /dimension_api/get/types/2
Response
Response code |
Description |
200 |
Ok, fetching a dimension type listing was succesfull |
401 |
API key / company code is invalid or the user does not have permission to add statements |
405 |
Invalid method, double check you are sending ”GET” and not ”POST” etc |
503 |
Service Unavailable |
Name |
Description |
Data type |
Possible values / Examples |
status |
Status of the operation |
string |
OK / ERROR |
|
|
|
|
Name |
Description |
Data type |
Possible values / Examples |
id |
Unique identifier of the dimension type |
int |
1 |
name_fi |
Dimension type name in finnish |
string |
Projekti |
name_en |
Dimension type name in english |
string |
Project |
name_sv |
Dimension type name in swedish |
string |
Projekt |
description |
Description of the dimension type |
string |
|
|
|
|
|