Introduction

The Calculation API has been deprecated, all endpoints have been replicated and improved in other APIs.

Calculation Resources (Legacy)

Batch Processes

Batch Process resources are created when an import or calculation job is started. Their purpose is to provide an interface to track the status of a job, as jobs are run asynchronously.

GET /calculation/v1/batch-processes/{batchId}

Use this method to retrieve a specific batch process resource.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Parameter Description

batchId

The id of the batch process resource

Example
$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/batch-processes/108' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 550

{
  "id" : 108,
  "name" : "Formula Transform: Period 1",
  "type" : "Calc",
  "state" : "Complete",
  "startTime" : 1539962002211,
  "endTime" : 1539962545221,
  "scheduledJobId" : null,
  "importFileId" : null,
  "importFileType" : null,
  "scriptId" : null,
  "period" : "1",
  "userName" : "John Doe",
  "userAddress" : "127.0.0.1",
  "scriptParameters" : null,
  "log" : "\\n\\nRun Formula Transform\\n\\n1 - Run step: Formula Transform\\nUPDATE `ct_sales_data` SET `total_amount` = `amount1`+`amount2`  WHERE period = 1\\nAffected rows: 3\\n"
}
Fields
Path Type Description

id

Number

The system defined unique id for the batch process

name

String

The name of the tracked job

type

String

The type of the tracked job (Import, Calc, Scheduled Script, Delete, Bulk)

state

String

The state of the tracked job (Running, Complete, Failed, Terminated)

startTime

Number

The recorded start time of the tracked job

endTime

Number

The recorded end time of the tracked job

scheduledJobId

Number

Id of the scheduled job if the tracked job belongs to one

importFileId

Number

The id of the file imported if the tracked job is of type Import, otherwise null

importFileType

String

The import file type id indicating what import file type was used if the job is of type Import, otherwise null

scriptId

Number

The id of the script run as part of the tracked job, may be set if the type is Scheduled Script or Delete, otherwise null

period

String

The id of the selected period the tracked job was run for

userName

String

The user name of the authenticated caller that initiated the job

userAddress

String

The IP address of the authenticated caller that initiated the job

scriptParameters

String

Parameters applied if the tracked job is of type Script

log

String

The database log for the tracked job

Calculations

Calculation resources describe the configured calculations and custom table transform batches available. They can be filtered based on period applied, published state or in the case of batches whether it’s a delete script.

GET /calculation/v1/calculations

Use this method to retrieve a list of Calculations.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Parameter Description

periodNumber

Filters on if the calculation is available for the indicated period, optional

fromPeriod

Filters on if the calculation is available from the indicated period, optional

toPeriod

Filters on if the calculation is available until the indicated period, optional

isPublished

Filters on if the calculation is published, optional

isDeleteScript

Filters on if the calculation is intended as a delete script, only applies to batches, optional

Example

$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/calculations' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 854

{
  "sipComponentCalculations" : [ {
    "id" : 1,
    "name" : "SIP Calc",
    "type" : "sip-component",
    "fromPeriod" : 1,
    "toPeriod" : 4,
    "isPublished" : true
  } ],
  "leagueLadderCalculations" : [ {
    "id" : 2,
    "name" : "Ranking Calculation",
    "type" : "league-ladder",
    "fromPeriod" : null,
    "toPeriod" : null,
    "isPublished" : true
  } ],
  "calculationScripts" : [ {
    "id" : 3,
    "name" : "Run SIP Calc & Populate Results",
    "type" : "script",
    "fromPeriod" : null,
    "toPeriod" : null,
    "isPublished" : true,
    "scriptLanguage" : "python",
    "calculationScript" : "exec_script(\\\"python_common\\\")\\r\\n..."
  } ],
  "cttBatches" : [ {
    "id" : 4,
    "name" : "Delete Input Table",
    "fromPeriod" : null,
    "toPeriod" : null,
    "isDeleteScript" : true,
    "isPublished" : true
  } ]
}
Fields
Path Type Description

sipComponentCalculations

Array

An array of SIP Component calculations

sipComponentCalculations.[].id

Number

The system defined unique id for the calculation, used when starting a calculation job

sipComponentCalculations.[].name

String

The user defined name for the calculation

sipComponentCalculations.[].type

String

Indicates the type of calculation (sip-component)

sipComponentCalculations.[].fromPeriod

Number

The period from when this calculation is enabled, null for all

sipComponentCalculations.[].toPeriod

Number

The period to when this calculation is enabled, null for all

sipComponentCalculations.[].isPublished

Boolean

Boolean to indicate whether the calculation is currently published

leagueLadderCalculations

Array

An array of League Ladder calculations

leagueLadderCalculations.[].id

Number

The system defined unique id for the calculation, used when starting a calculation job

leagueLadderCalculations.[].name

String

The user defined name for the calculation

leagueLadderCalculations.[].type

String

Indicates the type of calculation (league-ladder)

leagueLadderCalculations.[].fromPeriod

Number

The period from when this calculation is enabled, null for all

leagueLadderCalculations.[].toPeriod

Number

The period to when this calculation is enabled, null for all

leagueLadderCalculations.[].isPublished

Boolean

Boolean to indicate whether the calculation is currently published, can be filtered on

calculationScripts

Array

An array of Calculation Scripts

calculationScripts.[].id

Number

The system defined unique id for the calculation, used when starting a calculation job

calculationScripts.[].name

String

The user defined name for the calculation

calculationScripts.[].type

String

Indicates the type of calculation (script)

calculationScripts.[].fromPeriod

Null

The period from when this calculation is enabled, null for all

calculationScripts.[].toPeriod

Null

The period to when this calculation is enabled, null for all

calculationScripts.[].isPublished

Boolean

Boolean to indicate whether the calculation is currently published, can be filtered on

calculationScripts.[].scriptLanguage

String

The language the attached script is written in

calculationScripts.[].calculationScript

String

The script to be run

cttBatches

Array

An array of Custom Table Transform Batches

cttBatches.[].id

Number

The system defined unique id for the batch, used when starting a calculation job

cttBatches.[].name

String

The user defined name for the batch

cttBatches.[].fromPeriod

Number

The period from when this batch is enabled, null for all

cttBatches.[].toPeriod

Number

The period to when this batch is enabled, null for all

cttBatches.[].isPublished

Boolean

Boolean to indicate whether the batch is currently published, can be filtered on

cttBatches.[].isDeleteScript

Boolean

Boolean to indicate whether the batch is a delete script, can be filtered on

Calculation Jobs

Calculation jobs are used to trigger calculations to run asynchronously. You can indicate either a calculation or transform batch to run.

POST /calculation/v1/calculation-jobs

Use this method to trigger a calculation or transform batch to run. The response indicates the batch process resource used to track progress on the generated job.

Request (run a Calculation)

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Path Type Description

periodNumber

Number

The selected period to run the calculation for

calculationId

Varies

The id of the selected calculation

batchId

Null

The id of the selected batch

participantId

Varies

The id for the participant to run the calculation for, set to null for all

periodRange

Array

The selected multiple periods to run the calculation for

participantIds

Array

if participantId is not set, this field indicates the selected participants to run the calculation

participantIdsByPeriod

Object

if participantIds & participantId are not set, The selected participants per period to run the calculation

teamId

Number

The team id which the calculation is run for

jobTitleIds

Array

The job titles which the calculation is run for

plan

Number

The id of the plan to run calculation for

sip

Number

The sip template id of the plan to run calculation for

generateOutput

Boolean

The boolean value to indicate if debug log should be written

userName

String

User name used for audit purpose

userAddress

String

User ip address for audit purpose

calculationType

String

The type of the calculation

type

String

The type of the calculation runs for

model

Number

jobId

Number

batchNumber

Number

logFileKey

Null

scriptMethod

Null

scriptParameter

Null

Example
$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/calculation-jobs' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1' \
    -d '{	"periodNumber": 1,
	"periodRange" : [ 1, 2 ],
	"batchId": null,
	"calculationId": 7,
	"participantId": null,
	"participantIds" : [ ],
	"participantIdsByPeriod" : {
		"1" : [ 80, 81 ],
		"2" : [ 80, 81 ]
	},
	"plan" : 0,
	"sip" : 0,
	"model" : 0,
	"generateOutput" : true,
	"batchNumber" : 1726,
	"jobId" : -1,
	"logFileKey" : null,
	"calculationType" : "sip-component",
	"scriptMethod" : null,
	"scriptParameter" : null,
	"type" : "participant",
	"teamId" : 63,
	"jobTitleIds" : [ 1, 2 ],
	"userName" : "admin1",
	"userAddress" : "192.168.25.3"  }'

Response

Example
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
Content-Length: 67

{
  "batchId" : 109,
  "url" : "/calculation/batch-processes/109"
}
Fields
Path Type Description

batchId

Number

The id of the batch process resource generated to track the job

url

String

The url endpoint used to get the batch process resource generated

Request (run a Transform Batch)

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Path Type Description

periodNumber

Number

The selected period to run the calculation for

calculationId

Null

The id of the selected calculation

batchId

Varies

The id of the selected batch

participantId

Varies

The id for the participant to run the calculation for, set to null for all

periodRange

Array

The selected multiple periods to run the calculation for

participantIds

Array

if participantId is not set, this field indicates the selected participants to run the calculation

participantIdsByPeriod

Object

if participantIds & participantId are not set, The selected participants per period to run the calculation

teamId

Number

The team id which the calculation is run for

jobTitleIds

Array

The job titles which the calculation is run for

plan

Number

The id of the plan to run calculation for

sip

Number

The sip template id of the plan to run calculation for

generateOutput

Boolean

The boolean value to indicate if debug log should be written

userName

String

User name used for audit purpose

userAddress

String

User ip address for audit purpose

calculationType

String

The type of the calculation

type

String

The type of the calculation runs for

model

Number

jobId

Number

batchNumber

Number

logFileKey

Null

scriptMethod

Null

scriptParameter

Null

Example
$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/calculation-jobs' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1' \
    -d '{	"periodNumber": 1,
	"periodRange" : [ ],
	"batchId": 7,
	"calculationId": null,
	"participantId": null,
	"participantIds" : [ 80, 81 ],
	"participantIdsByPeriod" : { },
	"plan" : 0,
	"sip" : 0,
	"model" : 0,
	"generateOutput" : true,
	"batchNumber" : 1726,
	"jobId" : -1,
	"logFileKey" : null,
	"calculationType" : "sip-component",
	"scriptMethod" : null,
	"scriptParameter" : null,
	"type" : "participant",
	"teamId" : 0,
	"jobTitleIds" : [ 1, 2 ],
	"userName" : "admin1",
	"userAddress" : "192.168.25.3"  }'

Response

Example
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
Content-Length: 67

{
  "batchId" : 110,
  "url" : "/calculation/batch-processes/110"
}
Fields
Path Type Description

batchId

Number

The id of the batch process resource generated to track the job

url

String

The url endpoint used to get the batch process resource generated

GET /calculation/v1/calculation-jobs/logs/{logId}

Use this method to retrieve the logs of a calculation. The results will be paginated.

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Parameter Description

logId

The log id of the job logs to fetch

Example
$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/calculation-jobs/logs/35?page=0&size=2' -i -X GET \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 433

{
  "content" : [ {
    "logMessage" : "first line",
    "status" : "",
    "createTime" : 1539962002211
  }, {
    "logMessage" : "second line",
    "status" : "ended",
    "createTime" : 1539962002222
  } ],
  "pageable" : "INSTANCE",
  "last" : true,
  "totalPages" : 1,
  "totalElements" : 2,
  "first" : true,
  "numberOfElements" : 2,
  "sort" : {
    "sorted" : false,
    "unsorted" : true
  },
  "size" : 0,
  "number" : 0
}
Fields
Path Type Description

.content

Array

The selected period to run the batch for

.content[].status

String

Status of the job log, indicating if it’s not in a batch or logging has ended

.content[].createTime

Number

Time since epoch for when the log was created

.content[].logMessage

String

The log message

.totalPages

Number

Total number of pages

.totalElements

Number

Total number of elements displayed within this page

.last

Boolean

True if this the last page, otherwise false

.first

Boolean

True if this the first page, otherwise false

Delete Jobs

Delete jobs are used to trigger deletes to run asynchronously.

POST /calculation/v1/delete-jobs/imported-file-data

Use this method to trigger deletion of previously imported file data from the table it was imported into. The response will contain information about the batch process resource created to track the job.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Path Type Description

importFileId

Number

The Id of the Import File to remove content for

userName

String

Username of the authenticated calling user

userAddress

String

Address of the authenticated calling user

Example

$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/delete-jobs/imported-file-data' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1' \
    -d '{
  "importFileId": 1,
  "userName": "John Doe",
  "userAddress": "127.0.0.1"
}'

Response

Example
HTTP/1.1 202 Accepted
Content-Type: application/json;charset=UTF-8
Content-Length: 66

{
  "url" : "/calculation/v1/batch-processes/1",
  "batchId" : 1
}
Fields
Path Type Description

url

String

Url for the Batch Process resource generated to track the job

batchId

Number

The id of the Batch Process resource generated to track the job

Import Files

The import file service is used to allow users to upload files to be imported.

POST /zuul/calculation/v1/files

Use this method to upload a file for later use. The response describes the file as it is store remotely, including the file name and size.

Please note the /zuul prefix for this endpoint. If you do not provide it, your file upload will fail.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Part Description

file

The multipart file to be uploaded

Parameter Description

fileType

The intended type for the uploaded file

skipMD5

Boolean indicator for whether to skip the MD5 digest generation

fileName

(optional) A file name to use instead of the original name of the provided file

batchProcessId

(optional) The id of a preconfigured BatchProcess, if provided the file will be imported immediately on upload

Example

$ curl 'https://gateway-domain.performio.co/gateway/zuul/calculation/calculation/v1/files' -i -X POST \
    -H 'Content-Type: multipart/form-data' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1' \
    -F 'file=@/path/document-to-upload.json' \
    -F 'fileType=ImportFile' \
    -F 'skipMD5=true'

Response

Example
HTTP/1.1 201 Created
Content-Type: application/json;charset=UTF-8
Content-Length: 268

{
  "id" : 1563,
  "fileName" : "ParticipantSourceData.xlsx",
  "fileSize" : 22800082,
  "dateAndTime" : 1539962002211,
  "md5Digest" : "2a6ea13d0e18b1718042998d3172a1bf",
  "type" : null,
  "importParameter" : null,
  "imported" : false,
  "duplicateUpload" : false
}
Fields
Path Type Description

id

Number

The system defined unique id for the uploaded file

fileName

String

The name of the uploaded file

fileSize

Number

The size of the uploaded file in bytes

dateAndTime

Number

Date and time the file was uploaded

md5Digest

String

MD5 digest of the uploaded file, null if skipMD5 set to true in request

type

String

The intended type for the uploaded file (ImportFile, AnalyticsMainImportFile, ParticipantSourceDataImportFile, SFTPImportFile, SalesforceImportFile

importParameter

String

imported

Boolean

Boolean indicator for if the file has been imported

duplicateUpload

Boolean

Boolean indicator for if the file was duplicated

GET /calculation/v1/files

Use this method to retrieve a list of import files.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Example

$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/files' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 287

[ {
  "id" : 1563,
  "fileName" : "ParticipantSourceData.xlsx",
  "fileSize" : 22800082,
  "dateAndTime" : 1539962002211,
  "md5Digest" : "2a6ea13d0e18b1718042998d3172a1bf",
  "type" : "Sales Data import",
  "importParameter" : null,
  "imported" : false,
  "duplicateUpload" : false
} ]
Fields
Path Type Description

[].id

Number

The system defined unique id for the uploaded file

[].fileName

String

The name of the uploaded file

[].fileSize

Number

The size of the uploaded file in bytes

[].dateAndTime

Number

Date and time the file was uploaded

[].md5Digest

String

MD5 digest of the uploaded file, null if skipMD5 set to true in request

[].type

String

The intended type for the uploaded file (ImportFile, AnalyticsMainImportFile, ParticipantSourceDataImportFile, SFTPImportFile, SalesforceImportFile

[].importParameter

String

[].imported

Boolean

Boolean indicator for if the file has been imported

[].duplicateUpload

Boolean

Boolean indicator for if the file was duplicated

GET /calculation/v1/files/{id}

Use this method to retrieve a specific import file resource.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Parameter Description

id

The id of the import file resource

Example

$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/files/1563' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 283

{
  "id" : 1563,
  "fileName" : "ParticipantSourceData.xlsx",
  "fileSize" : 22800082,
  "dateAndTime" : 1539962002211,
  "md5Digest" : "2a6ea13d0e18b1718042998d3172a1bf",
  "type" : "Sales Data import",
  "importParameter" : null,
  "imported" : false,
  "duplicateUpload" : false
}
Fields
Path Type Description

id

Number

The system defined unique id for the uploaded file

fileName

String

The name of the uploaded file

fileSize

Number

The size of the uploaded file in bytes

dateAndTime

Number

Date and time the file was uploaded

md5Digest

String

MD5 digest of the uploaded file, null if skipMD5 set to true in request

type

String

The intended type for the uploaded file (ImportFile, AnalyticsMainImportFile, ParticipantSourceDataImportFile, SFTPImportFile, SalesforceImportFile

importParameter

String

imported

Boolean

Boolean indicator for if the file has been imported

duplicateUpload

Boolean

Boolean indicator for if the file was duplicated

GET /calculation/v1/files/md5-digest/{md5-digest}

Use this method to retrieve a specific import file resource using an md5-digest.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Parameter Description

md5-digest

MD5 digest of the uploaded file

Example

$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/files/md5-digest/2a6ea13d0e18b1718042998d3172a1bf' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 283

{
  "id" : 1563,
  "fileName" : "ParticipantSourceData.xlsx",
  "fileSize" : 22800082,
  "dateAndTime" : 1539962002211,
  "md5Digest" : "2a6ea13d0e18b1718042998d3172a1bf",
  "type" : "Sales Data import",
  "importParameter" : null,
  "imported" : false,
  "duplicateUpload" : false
}
Fields
Path Type Description

id

Number

The system defined unique id for the uploaded file

fileName

String

The name of the uploaded file

fileSize

Number

The size of the uploaded file in bytes

dateAndTime

Number

Date and time the file was uploaded

md5Digest

String

MD5 digest of the uploaded file, null if skipMD5 set to true in request

type

String

The intended type for the uploaded file (ImportFile, AnalyticsMainImportFile, ParticipantSourceDataImportFile, SFTPImportFile, SalesforceImportFile

importParameter

String

imported

Boolean

Boolean indicator for if the file has been imported

duplicateUpload

Boolean

Boolean indicator for if the file was duplicated

GET /calculation/v1/files/{id}/contents

Use this method to retrieve the contents of an import file resource.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Parameter Description

id

Id of the uploaded file

Example

$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/files/1563/contents' -i -X GET \
    -H 'Accept: application/octet-stream' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Length: 115
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="ParticipantSourceData.xlsx"
Accept-Ranges: bytes

participant, period, client, total
exampleUser, 1, acme, 1000
exampleUser, 2, acme, 1500
exampleUser, 3, acme, 1200

Import File Types

Import file type resources describe the different ways in which data (via file or record based import) can be brought into the system. An importer, standard or custom, outlines the expected format of the incoming data. When creating an import job an importer type must be provided by id.

GET /calculation/v1/import-file-types/standard

Use this method to retrieve a paginated list of all standard importer types. Standard importer types are provided by the system and are not configurable.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Parameter Description

page

(Optional) Number representing the page to retrieve. Pages start from 0.

size

(Optional) Number representing the records per page count. Default page size is 20 and the maximum is 2000.

Example
$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/import-file-types/standard?page=0&size=5' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 2735

{
  "content" : [ {
    "id" : "standard-1",
    "name" : "Account",
    "description" : "Link the master customer number to the participant",
    "catalogue" : "Standard Import Type",
    "recordFormat" : "{\"Master Customer Number(compulsory, text)\":\"<>\",\"Name(compulsory, text)\":\"<>\",\"Source(compulsory, text)\":\"<>\"}"
  }, {
    "id" : "standard-2",
    "name" : "Market",
    "description" : "Upload the market details",
    "catalogue" : "Standard Import Type",
    "recordFormat" : "{\"Name (compulsory, text)\":\"<>\",\"Market Id (compulsory, text)\":\"<>\"}"
  }, {
    "id" : "standard-3",
    "name" : "Participant",
    "description" : "Upload participant details",
    "catalogue" : "Standard Import Type",
    "recordFormat" : "{\"Team ID (optional, text)\":\"<>\",\"Location (optional, text)\":\"<>\",\"Access Enabled (compulsory, Yes/No)\":\"<>\",\"Start Date (optional, date)\":\"<>\",\"Surname (compulsory, text)\":\"<>\",\"Job Title (optional, text)\":\"<>\",\"Mobile (optional, text)\":\"<>\",\"Status (compulsory, Active/Inactive)\":\"<>\",\"Allow Single Signon (compulsory, Yes/No)\":\"<>\",\"Username (compulsory, text)\":\"<>\",\"First Name (compulsory, text)\":\"<>\",\"Manager Status (optional, Yes/No)\":\"<>\",\"Plan (optional, text)\":\"<>\",\"Job Title Description (optional, text)\":\"<>\",\"OTC (optional, text)\":\"<>\",\"Eid (compulsory, text)\":\"<>\",\"Comments (optional, text)\":\"<>\",\"Email (compulsory, text)\":\"<>\"}"
  }, {
    "id" : "standard-4",
    "name" : "Member Update",
    "description" : "Upload user details",
    "catalogue" : "Standard Import Type",
    "recordFormat" : "{\"Surname (optional, text)\":\"<>\",\"Location (optional, text)\":\"<>\",\"Access Enabled (optional, Yes/No)\":\"<>\",\"First Name (optional, text)\":\"<>\",\"Email (optional, text)\":\"<>\",\"Username (optional, text)\":\"<>\",\"Mobile (optional, text)\":\"<>\",\"Status (optional, Active/Inactive)\":\"<>\",\"Allow Single Signon (optional, Yes/No)\":\"<>\",\"Eid (compulsory, text)\":\"<>\",\"Comments (optional, text)\":\"<>\"}"
  }, {
    "id" : "standard-5",
    "name" : "Participant Period Attributes",
    "description" : "Upload any Period effective Attributes for Participants and their input values to components",
    "catalogue" : "Standard Import Type",
    "recordFormat" : "{}"
  } ],
  "pageable" : {
    "sort" : {
      "sorted" : false,
      "unsorted" : true
    },
    "pageNumber" : 0,
    "pageSize" : 5,
    "offset" : 0,
    "unpaged" : false,
    "paged" : true
  },
  "last" : false,
  "totalPages" : 4,
  "totalElements" : 19,
  "first" : true,
  "numberOfElements" : 5,
  "sort" : {
    "sorted" : false,
    "unsorted" : true
  },
  "size" : 5,
  "number" : 0
}
Fields
Path Type Description

content.[].id

String

The system defined unique id for the importer, can be used when creating an import job to indicate which importer to use

content.[].name

String

The system defined name for the importer

content.[].description

String

The system defined description of the intent of the importer

content.[].catalogue

String

Indicates whether the importer is standard or custom

content.[].recordFormat

String

A JSON representation of the expected import format, used to form a record based import job

totalElements

Number

Total number of elements

totalPages

Number

Total available pages

last

Boolean

Boolean indicator for if the current page is the last

size

Number

The maximum amount of elements to return per page

number

Number

The current page number

first

Boolean

Boolean indicator for if the current page is the first

GET /calculation/v1/import-file-types/custom

Use this method to retrieve a paginated list of all custom importer types. Custom importer types are provided by the user, and are configurable.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Parameter Description

page

(Optional) Number representing the page to retrieve. Pages start from 0.

size

(Optional) Number representing the records per page count. Default page size is 20 and the maximum is 2000.

Example
$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/import-file-types/custom?page=0&size=5' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 746

{
  "content" : [ {
    "id" : "1",
    "name" : "Sales Commission Table import",
    "type" : "adhoc",
    "description" : "Description",
    "catalogue" : "",
    "recordFormat" : "{}"
  }, {
    "id" : "2",
    "name" : "Sales Data import",
    "type" : "adhoc",
    "description" : "Description",
    "catalogue" : "",
    "recordFormat" : "{}"
  } ],
  "pageable" : {
    "sort" : {
      "sorted" : false,
      "unsorted" : true
    },
    "pageNumber" : 0,
    "pageSize" : 5,
    "offset" : 0,
    "unpaged" : false,
    "paged" : true
  },
  "last" : true,
  "totalPages" : 1,
  "totalElements" : 2,
  "first" : true,
  "numberOfElements" : 2,
  "sort" : {
    "sorted" : false,
    "unsorted" : true
  },
  "size" : 5,
  "number" : 0
}
Fields
Path Type Description

content.[].id

String

The system defined unique id for the importer, can be used when creating an import job to indicate which importer to use

content.[].name

String

The user defined name for the importer

content.[].type

String

The user defined type of the importer (Analytics Main, Hard Coded, Salesforce Opportunity Data Import, Participant Source Data, Scripted, Custom Table)

content.[].description

String

The user defined description of the intent of the importer

content.[].catalogue

String

Indicates whether the importer is standard or custom

content.[].recordFormat

String

A JSON representation of the expected import format, used to form a record based import job

totalElements

Number

Total number of elements

totalPages

Number

Total available pages

last

Boolean

Boolean indicator for if the current page is the last

size

Number

The maximum amount of elements to return per page

number

Number

The current page number

first

Boolean

Boolean indicator for if the current page is the first

Import Jobs

Import jobs are used to trigger imports to run asynchronously. You can indicate either a file by id or provide a list of up to 50 records for either a standard or custom import type.

POST /calculation/v1/import-jobs/file

Use this method to trigger an import based on a pre-uploaded file. The response will contain information about the file selected and the batch process resource created to track the job.

Request (with Period Number)

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Path Type Description

fileId

Number

Id for the file to be imported

periodNumber

String

The selected period to run the import for, may be omitted if the import file type does not require a period

typeId

String

Id for the selected import file type

username

String

Username of the authenticated calling user

userAddress

String

Address of the authenticated calling user

Example
$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/import-jobs/file' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1' \
    -d '{
  "fileId": 1,   "periodNumber": "1",
  "typeId": "standard-3",
  "username": "John Doe",
  "userAddress": "127.0.0.1"
}'

Response

Example
HTTP/1.1 202 Accepted
Content-Type: application/json;charset=UTF-8
Content-Length: 156

{
  "fileId" : 1,
  "batchId" : 1,
  "url" : "/calculation/v1/batch-processes/1",
  "username" : "John Doe",
  "userAddress" : "127.0.0.1",
  "period" : 1
}
Fields
Path Type Description

url

String

Url for the batch process entity to check the status of the import

batchId

Number

The id of the batch process resource generated to track the job

username

String

Username of the calling user

fileId

Number

Id for the file being imported

userAddress

String

Address of the calling user

period

Number

The selected period the import is running for, null if not provided

Request (with Period Range)

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Path Type Description

fileId

Number

Id for the file to be imported

periodRange

Array

The selected period range to run the import for, may be omitted if the import file type does not require a period, only the highest and lowest value will be considered

typeId

String

Id for the selected import file type

username

String

Username of the authenticated calling user

userAddress

String

Address of the authenticated calling user

Example
$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/import-jobs/file' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1' \
    -d '{
  "fileId": 1,   "periodRange": [1, 2, 3],
  "typeId": "standard-3",
  "username": "John Doe",
  "userAddress": "127.0.0.1"
}'

Response

Example
HTTP/1.1 202 Accepted
Content-Type: application/json;charset=UTF-8
Content-Length: 171

{
  "fileId" : 1,
  "batchId" : 1,
  "url" : "/calculation/v1/batch-processes/1",
  "username" : "John Doe",
  "userAddress" : "127.0.0.1",
  "periodRange" : [ 1, 2, 3 ]
}
Fields
Path Type Description

url

String

Url for the batch process entity to check the status of the import

batchId

Number

The id of the batch process resource generated to track the job

username

String

Username of the calling user

fileId

Number

Id for the file being imported

userAddress

String

Address of the calling user

periodRange

Array

The selected period range the import is running for, null if not provided

POST /calculation/v1/import-jobs/record

Use this method to trigger an import based on an array of records provided in the request (currently to a maximum of 50). The response will contain information about the import file record generated for your provided records and the batch process resource created to track the job.

Request (with Period Number)

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Path Type Description

periodNumber

String

The selected period to run the import for, may be omitted if the import file type does not require a period

typeId

String

Id for the selected import file type

username

String

Username of the authenticated calling user

userAddress

String

Address of the authenticated calling user

records

Array

List of records in JSON format to be imported

Example
$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/import-jobs/record' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1' \
    -d '{
  "records": [
    { "field1": "value1" },    { "field1": "value2" },    { "field1": "value3" },    { "field1": "value4" }  ],
  "periodNumber": "1",
  "typeId": "standard-1",
  "username": "John Doe",
  "userAddress": "127.0.0.1"
}'

Response

Example
HTTP/1.1 202 Accepted
Content-Type: application/json;charset=UTF-8
Content-Length: 156

{
  "fileId" : 1,
  "batchId" : 1,
  "url" : "/calculation/v1/batch-processes/1",
  "username" : "John Doe",
  "userAddress" : "127.0.0.1",
  "period" : 1
}
Fields
Path Type Description

url

String

Url for the batch process entity to check the status of the import

batchId

Number

The id of the batch process resource generated to track the job

fileId

Number

Id for the import file created that is being imported

username

String

Username of the calling user

userAddress

String

Address of the calling user

period

Number

The selected period the import is running for, null if not provided

Request (with Period Range)

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Path Type Description

periodRange

Array

The selected period range to run the import for, may be omitted if the import file type does not require a period, only the highest and lowest value will be considered

typeId

String

Id for the selected import file type

username

String

Username of the authenticated calling user

userAddress

String

Address of the authenticated calling user

records

Array

List of records in JSON format to be imported

Example
$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/import-jobs/record' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1' \
    -d '{
  "records": [
    { "field1": "value1" },    { "field1": "value2" },    { "field1": "value3" },    { "field1": "value4" }  ],
  "periodRange": [1, 2, 3],
  "typeId": "standard-1",
  "username": "John Doe",
  "userAddress": "127.0.0.1"
}'

Response

Example
HTTP/1.1 202 Accepted
Content-Type: application/json;charset=UTF-8
Content-Length: 171

{
  "fileId" : 1,
  "batchId" : 1,
  "url" : "/calculation/v1/batch-processes/1",
  "username" : "John Doe",
  "userAddress" : "127.0.0.1",
  "periodRange" : [ 1, 2, 3 ]
}
Fields
Path Type Description

url

String

Url for the batch process entity to check the status of the import

batchId

Number

The id of the batch process resource generated to track the job

fileId

Number

Id for the import file created that is being imported

username

String

Username of the calling user

userAddress

String

Address of the calling user

periodRange

Array

The selected period range the import is running for, null if not provided

Participants

Participant resources are used to describe details about specific users within the system. They can be used to retrieve and provide a list of ids when creating a calculation job.

GET /calculation/v1/participants

Use this method to retrieve a filtered list of participant resources.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Parameters
Parameter Description

isEnabled

Filters on if the participant is enabled, optional

Example

$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/participants?isEnabled=true' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 172

[ {
  "id" : 1,
  "eid" : "participant1",
  "enabled" : true,
  "name" : "John Doe"
}, {
  "id" : 2,
  "eid" : "participant2",
  "enabled" : true,
  "name" : "Jane Doe"
} ]
Fields
Path Type Description

[].id

Number

The system defined unique id for the participant

[].eid

String

The user defined unique id for the participant

[].enabled

Boolean

Boolean to indicate if the participant is enabled

[].name

String

The participants name

Periods

Period resources are used to describe details about all configured periods. They can be used to limit jobs based on period provided or availability.

GET /calculation/v1/periods

Use this method to retrieve a list of all periods.

Request

Headers
Name Description

Authorization

OAuth 2.0 authentication token

Example

$ curl 'https://gateway-domain.performio.co/gateway/calculation/v1/periods' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer e9036e38-d67e-11e8-9f8b-f2801f1b9fd1'

Response

Example
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 447

[ {
  "periodNumber" : 1,
  "status" : null,
  "customLabel" : null,
  "locked" : false
}, {
  "periodNumber" : 2,
  "status" : null,
  "customLabel" : null,
  "locked" : false
}, {
  "periodNumber" : 3,
  "status" : null,
  "customLabel" : null,
  "locked" : false
}, {
  "periodNumber" : 4,
  "status" : null,
  "customLabel" : null,
  "locked" : false
}, {
  "periodNumber" : 5,
  "status" : null,
  "customLabel" : null,
  "locked" : false
} ]
Fields
Path Type Description

[].periodNumber

Number

The unique identifier for the period, sequential in nature

[].status

Null

The current state of the period (Finalised, In Progress, In Approval or user defined), used to constrict visibility

[].customLabel

Null

User defined custom label for periods, used to replace standard naming

[].locked

Boolean

Boolean indicator for restricting whether calculations can run on the period