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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
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 |
---|---|---|
|
|
The system defined unique id for the batch process |
|
|
The name of the tracked job |
|
|
The type of the tracked job (Import, Calc, Scheduled Script, Delete, Bulk) |
|
|
The state of the tracked job (Running, Complete, Failed, Terminated) |
|
|
The recorded start time of the tracked job |
|
|
The recorded end time of the tracked job |
|
|
Id of the scheduled job if the tracked job belongs to one |
|
|
The id of the file imported if the tracked job is of type Import, otherwise null |
|
|
The import file type id indicating what import file type was used if the job is of type Import, otherwise null |
|
|
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 |
|
|
The id of the selected period the tracked job was run for |
|
|
The user name of the authenticated caller that initiated the job |
|
|
The IP address of the authenticated caller that initiated the job |
|
|
Parameters applied if the tracked job is of type Script |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
Filters on if the calculation is available for the indicated period, optional |
|
Filters on if the calculation is available from the indicated period, optional |
|
Filters on if the calculation is available until the indicated period, optional |
|
Filters on if the calculation is published, optional |
|
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 |
---|---|---|
|
|
An array of SIP Component calculations |
|
|
The system defined unique id for the calculation, used when starting a calculation job |
|
|
The user defined name for the calculation |
|
|
Indicates the type of calculation (sip-component) |
|
|
The period from when this calculation is enabled, null for all |
|
|
The period to when this calculation is enabled, null for all |
|
|
Boolean to indicate whether the calculation is currently published |
|
|
An array of League Ladder calculations |
|
|
The system defined unique id for the calculation, used when starting a calculation job |
|
|
The user defined name for the calculation |
|
|
Indicates the type of calculation (league-ladder) |
|
|
The period from when this calculation is enabled, null for all |
|
|
The period to when this calculation is enabled, null for all |
|
|
Boolean to indicate whether the calculation is currently published, can be filtered on |
|
|
An array of Calculation Scripts |
|
|
The system defined unique id for the calculation, used when starting a calculation job |
|
|
The user defined name for the calculation |
|
|
Indicates the type of calculation (script) |
|
|
The period from when this calculation is enabled, null for all |
|
|
The period to when this calculation is enabled, null for all |
|
|
Boolean to indicate whether the calculation is currently published, can be filtered on |
|
|
The language the attached script is written in |
|
|
The script to be run |
|
|
An array of Custom Table Transform Batches |
|
|
The system defined unique id for the batch, used when starting a calculation job |
|
|
The user defined name for the batch |
|
|
The period from when this batch is enabled, null for all |
|
|
The period to when this batch is enabled, null for all |
|
|
Boolean to indicate whether the batch is currently published, can be filtered on |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Path | Type | Description |
---|---|---|
|
|
The selected period to run the calculation for |
|
|
The id of the selected calculation |
|
|
The id of the selected batch |
|
|
The id for the participant to run the calculation for, set to null for all |
|
|
The selected multiple periods to run the calculation for |
|
|
if participantId is not set, this field indicates the selected participants to run the calculation |
|
|
if participantIds & participantId are not set, The selected participants per period to run the calculation |
|
|
The team id which the calculation is run for |
|
|
The job titles which the calculation is run for |
|
|
The id of the plan to run calculation for |
|
|
The sip template id of the plan to run calculation for |
|
|
The boolean value to indicate if debug log should be written |
|
|
User name used for audit purpose |
|
|
User ip address for audit purpose |
|
|
The type of the calculation |
|
|
The type of the calculation runs for |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
---|---|---|
|
|
The id of the batch process resource generated to track the job |
|
|
The url endpoint used to get the batch process resource generated |
Request (run a Transform Batch)
Headers
Name | Description |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Path | Type | Description |
---|---|---|
|
|
The selected period to run the calculation for |
|
|
The id of the selected calculation |
|
|
The id of the selected batch |
|
|
The id for the participant to run the calculation for, set to null for all |
|
|
The selected multiple periods to run the calculation for |
|
|
if participantId is not set, this field indicates the selected participants to run the calculation |
|
|
if participantIds & participantId are not set, The selected participants per period to run the calculation |
|
|
The team id which the calculation is run for |
|
|
The job titles which the calculation is run for |
|
|
The id of the plan to run calculation for |
|
|
The sip template id of the plan to run calculation for |
|
|
The boolean value to indicate if debug log should be written |
|
|
User name used for audit purpose |
|
|
User ip address for audit purpose |
|
|
The type of the calculation |
|
|
The type of the calculation runs for |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
---|---|---|
|
|
The id of the batch process resource generated to track the job |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
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 |
---|---|---|
|
|
The selected period to run the batch for |
|
|
Status of the job log, indicating if it’s not in a batch or logging has ended |
|
|
Time since epoch for when the log was created |
|
|
The log message |
|
|
Total number of pages |
|
|
Total number of elements displayed within this page |
|
|
True if this the last page, otherwise false |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Path | Type | Description |
---|---|---|
|
|
The Id of the Import File to remove content for |
|
|
Username of the authenticated calling user |
|
|
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 for the Batch Process resource generated to track the job |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Part | Description |
---|---|
|
The multipart file to be uploaded |
Parameter | Description |
---|---|
|
The intended type for the uploaded file |
|
Boolean indicator for whether to skip the MD5 digest generation |
|
(optional) A file name to use instead of the original name of the provided file |
|
(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 |
---|---|---|
|
|
The system defined unique id for the uploaded file |
|
|
The name of the uploaded file |
|
|
The size of the uploaded file in bytes |
|
|
Date and time the file was uploaded |
|
|
MD5 digest of the uploaded file, null if skipMD5 set to true in request |
|
|
The intended type for the uploaded file (ImportFile, AnalyticsMainImportFile, ParticipantSourceDataImportFile, SFTPImportFile, SalesforceImportFile |
|
|
|
|
|
Boolean indicator for if the file has been imported |
|
|
Boolean indicator for if the file was duplicated |
GET /calculation/v1/files
Use this method to retrieve a list of import files.
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 |
---|---|---|
|
|
The system defined unique id for the uploaded file |
|
|
The name of the uploaded file |
|
|
The size of the uploaded file in bytes |
|
|
Date and time the file was uploaded |
|
|
MD5 digest of the uploaded file, null if skipMD5 set to true in request |
|
|
The intended type for the uploaded file (ImportFile, AnalyticsMainImportFile, ParticipantSourceDataImportFile, SFTPImportFile, SalesforceImportFile |
|
|
|
|
|
Boolean indicator for if the file has been imported |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
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 |
---|---|---|
|
|
The system defined unique id for the uploaded file |
|
|
The name of the uploaded file |
|
|
The size of the uploaded file in bytes |
|
|
Date and time the file was uploaded |
|
|
MD5 digest of the uploaded file, null if skipMD5 set to true in request |
|
|
The intended type for the uploaded file (ImportFile, AnalyticsMainImportFile, ParticipantSourceDataImportFile, SFTPImportFile, SalesforceImportFile |
|
|
|
|
|
Boolean indicator for if the file has been imported |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
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 |
---|---|---|
|
|
The system defined unique id for the uploaded file |
|
|
The name of the uploaded file |
|
|
The size of the uploaded file in bytes |
|
|
Date and time the file was uploaded |
|
|
MD5 digest of the uploaded file, null if skipMD5 set to true in request |
|
|
The intended type for the uploaded file (ImportFile, AnalyticsMainImportFile, ParticipantSourceDataImportFile, SFTPImportFile, SalesforceImportFile |
|
|
|
|
|
Boolean indicator for if the file has been imported |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
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'
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
(Optional) Number representing the page to retrieve. Pages start from 0. |
|
(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 |
---|---|---|
|
|
The system defined unique id for the importer, can be used when creating an import job to indicate which importer to use |
|
|
The system defined name for the importer |
|
|
The system defined description of the intent of the importer |
|
|
Indicates whether the importer is standard or custom |
|
|
A JSON representation of the expected import format, used to form a record based import job |
|
|
Total number of elements |
|
|
Total available pages |
|
|
Boolean indicator for if the current page is the last |
|
|
The maximum amount of elements to return per page |
|
|
The current page number |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
(Optional) Number representing the page to retrieve. Pages start from 0. |
|
(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 |
---|---|---|
|
|
The system defined unique id for the importer, can be used when creating an import job to indicate which importer to use |
|
|
The user defined name for the importer |
|
|
The user defined type of the importer (Analytics Main, Hard Coded, Salesforce Opportunity Data Import, Participant Source Data, Scripted, Custom Table) |
|
|
The user defined description of the intent of the importer |
|
|
Indicates whether the importer is standard or custom |
|
|
A JSON representation of the expected import format, used to form a record based import job |
|
|
Total number of elements |
|
|
Total available pages |
|
|
Boolean indicator for if the current page is the last |
|
|
The maximum amount of elements to return per page |
|
|
The current page number |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Path | Type | Description |
---|---|---|
|
|
Id for the file to be imported |
|
|
The selected period to run the import for, may be omitted if the import file type does not require a period |
|
|
Id for the selected import file type |
|
|
Username of the authenticated calling user |
|
|
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 for the batch process entity to check the status of the import |
|
|
The id of the batch process resource generated to track the job |
|
|
Username of the calling user |
|
|
Id for the file being imported |
|
|
Address of the calling user |
|
|
The selected period the import is running for, null if not provided |
Request (with Period Range)
Headers
Name | Description |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Path | Type | Description |
---|---|---|
|
|
Id for the file to be imported |
|
|
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 |
|
|
Id for the selected import file type |
|
|
Username of the authenticated calling user |
|
|
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 for the batch process entity to check the status of the import |
|
|
The id of the batch process resource generated to track the job |
|
|
Username of the calling user |
|
|
Id for the file being imported |
|
|
Address of the calling user |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Path | Type | Description |
---|---|---|
|
|
The selected period to run the import for, may be omitted if the import file type does not require a period |
|
|
Id for the selected import file type |
|
|
Username of the authenticated calling user |
|
|
Address of the authenticated calling user |
|
|
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 for the batch process entity to check the status of the import |
|
|
The id of the batch process resource generated to track the job |
|
|
Id for the import file created that is being imported |
|
|
Username of the calling user |
|
|
Address of the calling user |
|
|
The selected period the import is running for, null if not provided |
Request (with Period Range)
Headers
Name | Description |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Path | Type | Description |
---|---|---|
|
|
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 |
|
|
Id for the selected import file type |
|
|
Username of the authenticated calling user |
|
|
Address of the authenticated calling user |
|
|
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 for the batch process entity to check the status of the import |
|
|
The id of the batch process resource generated to track the job |
|
|
Id for the import file created that is being imported |
|
|
Username of the calling user |
|
|
Address of the calling user |
|
|
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 |
---|---|
|
OAuth 2.0 authentication token |
Parameters
Parameter | Description |
---|---|
|
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 |
---|---|---|
|
|
The system defined unique id for the participant |
|
|
The user defined unique id for the participant |
|
|
Boolean to indicate if the participant is enabled |
|
|
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.
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 |
---|---|---|
|
|
The unique identifier for the period, sequential in nature |
|
|
The current state of the period (Finalised, In Progress, In Approval or user defined), used to constrict visibility |
|
|
User defined custom label for periods, used to replace standard naming |
|
|
Boolean indicator for restricting whether calculations can run on the period |