Job Operations

Good to know: All job operation interfaces need to use token as the request header.

Creating jobs

Creating a privacy computing job

POST https://www.phoenix.global/sdk/computation/panel/createJobByInput

Create a privacy computing job. The computation data of the job is input through the keyboard.

Headers

Name
Type
Description

token*

string

The token generated in the previous step

Request Body

Name
Type
Description

computation*

string

Computation type. One of "Privacy Comparison", "Matrix Addition", and "Matrix Multiplication"

input*

string

Data used for computing, formatted as a matrix,such as "[[18,34,18.2]]"

jobName*

string

Job name that cannot be repeated

parties*

string array

Computation participants. The current version of the input type job has three parties. Participants need to provide computation data and can view the computation results on the phoenix blockchain.

{
    "code": 200,
    "msg": "success",
    "jobID": "82432641958147347699879957611773176975645610459935361780929612748304054178070"
}

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/panel/createJobByInput' \
--header 'token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IkxKTDJAMTYzLmNvbSIsImV4cCI6MTY3ODM0ODkwMX0.OAia1TMt31EOGuvbt5SjspiACNiWfgmDeTVpwG6pP9c' \
--header 'Content-Type: application/json' \
--data-raw '{
  "computation": "Matrix Addition",
  "input": "[[18,34,18.2]]",
  "jobName": "matrix addition job Test",
  "parties": [
    "xxxxxx@gmail.com",
    "xxxxxx@gmail.com",
    "xxxxxx@gmail.com"
  ]
}'

Creating a machine learning classification job

POST https://www.phoenix.global/sdk/computation/panel/createJobByFile

Create a machine learning classification job. The participant of the job is the creator.

Headers

Name
Type
Description

token*

string

The token generated in the previous step

Request Body

Name
Type
Description

computation*

string

Form data. Computation type. One of "Decision Tree", "Logistic Regression", "SVM" and "Deep Learning MLP"

jobName*

string

Form data. Job name

featureData*

file

Form data. Feature dataset in .CSV format, cannot contain special characters

targetData*

file

Form data. Target dataset in .CSV format, cannot contain special characters

testingData

file

Form data. Testing dataset in .CSV format, cannot contain special characters. The dimensions of testing dataset and feature dataset should be same

{
    "code": 200,
    "msg": "success",
    "jobID": "15336929879565052031766977071313450079096374296015479727460579121350576553341"
}

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/panel/createJobByFile' \
--header 'token: xxxxxxxxxxxx' \
--form 'computation="Decision Tree"' \
--form 'jobName="decision tree" test"' \
--form 'featureData=@"feature dataset file path"' \
--form 'targetData=@"target dataset file path"' \
--form 'testingData=@"testing dataset file path"'

Creating a machine learning clustering job

POST https://www.phoenix.global/sdk/computation/panel/createJobByFile

Create a machine learning clustering job, which only needs to upload a feature dataset file.

Headers

Name
Type
Description

token*

string

The token generated in the previous step

Request Body

Name
Type
Description

computation*

string

Form data. Computation type. One of "Birch Clustering", "K-Means Clustering", and "Spectral Clustering"

jobName*

string

Form data. Job name

featureData*

string

Form data. Feature dataset in .CSV format, cannot contain special characters

{
    "code": 200,
    "msg": "success",
    "jobID": "15336929879565052031766977071313450079096374296015479727460579121350576553341"
}

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/panel/createJobByFile' \
--header 'token: xxxxxx' \
--form 'computation="Birch Clustering"' \
--form 'jobName="birch clustering job test"' \
--form 'featureData=@"feature dataset path"'

Filling data

Filling in the computation data for the job of input type

POST https://www.phoenix.global/sdk/computation/panel/fillData

Fill data for job of input type. The user who fills in the data must be a participant of the job.

Headers

Name
Type
Description

token*

string

The token generated in the previous step

Request Body

Name
Type
Description

input*

string

Data used for computing, formatted as a matrix,such as "[[18,34,18.2]]"

jobID*

string

The job id returned when creating a job

{
    "code": 200,
    "msg": "fill success"
}

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/panel/fillData' \
--header 'token: xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
  "input": "[[1,2,3.2]]",
  "jobID": "xxxxxx"
}
'

Deleting job

Deleting job by job id

POST https://www.phoenix.global/sdk/computation/panel/deleteJobByUser

Delete a job according to job id. Only the creator has permission to delete

Headers

Name
Type
Description

token*

string

The token generated in the previous step

Request Body

Name
Type
Description

jobID*

string

The job id returned when creating a job

{
    "code": 200,
    "msg": "delete success"
}
curl --location 'https://www.phoenix.global/sdk/computation/panel/deleteJobByUser' \
--header 'token: xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
  "jobID": "xxxxxx"
}
'