Create custom dimension definition
Creates a new custom dimension definition for the given organization. Returns 403 when the organization does not exist or the authenticated user is not an administrator of it.
curl --request POST \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Project",
"level": "EXPENSE",
"controlType": "LIST",
"presetLocation": "NONE",
"externalSourceId": "project",
"visibleIfNoPreset": true
}
'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions"
payload = {
"description": "Project",
"level": "EXPENSE",
"controlType": "LIST",
"presetLocation": "NONE",
"externalSourceId": "project",
"visibleIfNoPreset": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Project',
level: 'EXPENSE',
controlType: 'LIST',
presetLocation: 'NONE',
externalSourceId: 'project',
visibleIfNoPreset: true
})
};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Project',
'level' => 'EXPENSE',
'controlType' => 'LIST',
'presetLocation' => 'NONE',
'externalSourceId' => 'project',
'visibleIfNoPreset' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions"
payload := strings.NewReader("{\n \"description\": \"Project\",\n \"level\": \"EXPENSE\",\n \"controlType\": \"LIST\",\n \"presetLocation\": \"NONE\",\n \"externalSourceId\": \"project\",\n \"visibleIfNoPreset\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Project\",\n \"level\": \"EXPENSE\",\n \"controlType\": \"LIST\",\n \"presetLocation\": \"NONE\",\n \"externalSourceId\": \"project\",\n \"visibleIfNoPreset\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Project\",\n \"level\": \"EXPENSE\",\n \"controlType\": \"LIST\",\n \"presetLocation\": \"NONE\",\n \"externalSourceId\": \"project\",\n \"visibleIfNoPreset\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "abc123def456abc123def456abc123de",
"externalSourceId": "project",
"description": "Project",
"status": "active",
"level": "EXPENSE",
"presetLocation": "NONE",
"controlType": "LIST",
"useDateInterval": false,
"recipientId": null,
"useAsRecipientFilter": null,
"hideDimensionValues": null,
"usedInCarbonFootprint": false,
"deviateOnCreditRow": false,
"deviatingCreditRowValue": null,
"dimensionUsage": null,
"visible": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
String. The organization's internal ID (32-character hex string) or its externalSourceId. When the value matches the format of an internal ID, the internal ID takes precedence.
"11adfe2a080040e3892ffb89c21ec44e"
Body
At least one known property must be present. An empty body or a body with only unknown properties returns 400 INVALID_JSON_BODY or 400 NO_KNOWN_JSON_PROPERTIES respectively.
Display name of the custom dimension definition.
255The scope at which this dimension is applied. Use INACTIVE to create the dimension in an inactive state.
EXPENSE, EXPENSE_REPORT, INACTIVE Where the preset value is defined. Defaults to no preset when omitted.
NONE, EMPLOYEE, DEPARTMENT, CATEGORY Input type for the dimension. LIST and LIST_SEARCHABLE are both accepted and stored as a fixed list; the GET response always returns LIST for both.
LIST, LIST_SEARCHABLE, TEXT Caller-supplied identifier used to address this definition from an external system.
255Whether the dimension value can be associated with a date interval.
ID of the recipient to link to this dimension.
Whether this dimension is used as a recipient filter.
Whether the available dimension values are hidden from users.
Whether this dimension is used in carbon footprint calculations.
Whether the dimension uses a deviating value on credit rows.
Describes how the dimension is used within the system. VATDimension links the dimension to VAT code values in accounting.
Dimension, VATDimension When a preset is configured (presetLocation is not NONE), controls whether the user can override the preset value. Affects the computed visible field in the response.
When no preset is configured (presetLocation is NONE), controls whether the dimension is shown to users. Affects the computed visible field in the response.
Response
Created — returns the newly created custom dimension definition
Unique internal identifier of the custom dimension definition.
Display name of the custom dimension definition.
Lifecycle status of the dimension definition.
active, inactive The scope at which this dimension is applied.
EXPENSE, EXPENSE_REPORT Input type for the dimension. LIST means a fixed list of values; TEXT means free-text input.
LIST, TEXT Whether the dimension value can be associated with a date interval.
Computed visibility flag. true when the dimension is shown to users. Determined by presetLocation and user override settings.
Caller-supplied identifier used to address this definition from an external system. Null when not set.
Where the preset value is defined. Null when no preset is configured.
NONE, EMPLOYEE, DEPARTMENT, CATEGORY ID of the recipient linked to this dimension. Null when not set.
Whether this dimension is used as a recipient filter. Null when not configured.
Whether the available dimension values are hidden from users. Null when not configured.
Whether this dimension is used in carbon footprint calculations. Null when not configured.
Whether the dimension uses a deviating value on credit rows. Null when not configured.
The deviating dimension value applied on credit rows. Null when deviateOnCreditRow is false or not set.
Hide child attributes
Hide child attributes
Unique identifier of the deviating preset value.
ID of the dimension definition this deviating value belongs to.
ID of the preset list value used as the deviating value. Null when the deviating value is a string.
Text of the preset list value. Null when not applicable.
String value used as the deviating value. Null when the deviating value is a list value.
Describes how the dimension is used within the system. Null when not configured.
curl --request POST \
--url https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Project",
"level": "EXPENSE",
"controlType": "LIST",
"presetLocation": "NONE",
"externalSourceId": "project",
"visibleIfNoPreset": true
}
'import requests
url = "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions"
payload = {
"description": "Project",
"level": "EXPENSE",
"controlType": "LIST",
"presetLocation": "NONE",
"externalSourceId": "project",
"visibleIfNoPreset": True
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Project',
level: 'EXPENSE',
controlType: 'LIST',
presetLocation: 'NONE',
externalSourceId: 'project',
visibleIfNoPreset: true
})
};
fetch('https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Project',
'level' => 'EXPENSE',
'controlType' => 'LIST',
'presetLocation' => 'NONE',
'externalSourceId' => 'project',
'visibleIfNoPreset' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions"
payload := strings.NewReader("{\n \"description\": \"Project\",\n \"level\": \"EXPENSE\",\n \"controlType\": \"LIST\",\n \"presetLocation\": \"NONE\",\n \"externalSourceId\": \"project\",\n \"visibleIfNoPreset\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Project\",\n \"level\": \"EXPENSE\",\n \"controlType\": \"LIST\",\n \"presetLocation\": \"NONE\",\n \"externalSourceId\": \"project\",\n \"visibleIfNoPreset\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://stage-api.findity.com/api/v1/admin/organizations/{organizationId}/customdimensions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Project\",\n \"level\": \"EXPENSE\",\n \"controlType\": \"LIST\",\n \"presetLocation\": \"NONE\",\n \"externalSourceId\": \"project\",\n \"visibleIfNoPreset\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "abc123def456abc123def456abc123de",
"externalSourceId": "project",
"description": "Project",
"status": "active",
"level": "EXPENSE",
"presetLocation": "NONE",
"controlType": "LIST",
"useDateInterval": false,
"recipientId": null,
"useAsRecipientFilter": null,
"hideDimensionValues": null,
"usedInCarbonFootprint": false,
"deviateOnCreditRow": false,
"deviatingCreditRowValue": null,
"dimensionUsage": null,
"visible": true
}
