Job Queries

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

Querying job

Querying job list

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

Query the list of jobs that the user participates in.

Headers

NameTypeDescription

token*

string

The token generated in the previous step

Request Body

NameTypeDescription

pageNo*

integer

page number

pageSize*

integer

page size

{
    "code":200,
    "msg":"success",
    "size":20,
    "page":1,
    "totalPages":1,
    "totalCount":2,
    "data":[
        {
            "jobID":"23852445952590777475260973439464112207496364646998189462210436653351556571331",
            "typeStr":"Upload",
            "jobName":"matrix addition job",
            "parties":[
                "111@gmail.com",
                "222@gmail.com",
                "333@gmail.com"
            ],
            "contractAddr":"0xD23C411aF00D557Bfef4390d8a1D1F2f61622130",
            "creator":"111@gmail.com",
            "creationTime":1676518206,
            "updateTime":1676518206
        },
        {
            "jobID":"3011173339614700144228046993114909367073003421675739591333024515403501305843",
            "typeStr":"Input",
            "jobName":"matrix multiplication",
            "parties":[
                "111@gmail.com",
                "222@gmail.com",
                "333@gmail.com"
            ],
            "contractAddr":"0x5402e4FCd2c90A72525ff891CD4C2eC9281E62ff",
            "creator":"111@gmail.com",
            "creationTime":1673422844,
            "updateTime":1673422844
        }
    ]
}

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/panel/jobListByUser' \
--header 'token: xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
  "pageNo": 1,
  "pageSize": 20
}'

Querying job detail by job id

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

Query job details according to jobid. The query user must be a participant of the job

Headers

NameTypeDescription

token*

string

The token generated in the previous step

Request Body

NameTypeDescription

jobID*

string

job id

{
    "code": 200,
    "msg": "success",
    "jobID": "106006086598460350897135634523568280408477446978521913351461287547366806554671",
    "typeStr": "Upload",
    "jobName": "decision tree job",
    "parties": [
        "111@gmail.com"
    ],
    "contractAddr": "0x717c6364378D2de0032BEfD0AB5964B44691750f",
    "creator": "111@gmail.com",
    "computationStr": "decision tree",
    "creationTime": 1678342677,
    "updateTime": 1678342677,
    "input": "",
    "featureData": "titanic_x.csv",
    "targetData": "titanic_y.csv",
    "testingData": "titanic_testx.csv"
}

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/panel/jobDetailByUser' \
--header 'token: xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
  "jobID": "xxxxxx"
}'

Querying notice list

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

Query the list of jobs that require input data.

Headers

NameTypeDescription

token*

string

The token generated in the previous step

Request Body

NameTypeDescription

pageNo*

integer

page number

pageSize*

integer

page size

{
    "code":200,
    "msg":"success",
    "size":20,
    "page":1,
    "totalPages":1,
    "totalCount":2,
    "data":[
        {
            "jobID":"32684791260453298104859009647047307465673888568545092225165106656999975656724",
            "type":"Input",
            "jobName":"privacy comparison job",
            "creator":"222@gmail.com",
            "creationTime":1675668300,
            "updateTime":1675668300,
            "contractAddr":"0x5402e4FCd2c90A72525ff891CD4C2eC9281E62ff"
        },
        {
            "jobID":"56819547717557264144992771514561558548085549762085773881024816086398223185533",
            "type":"Input",
            "jobName":"matrix addition job",
            "creator":"222@gmail.com",
            "creationTime":1675219780,
            "updateTime":1675219780,
            "contractAddr":"0x3b283afE5976272781Cc6DA3Fc7a9CAadb425758"
        }
    ]
}

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/panel/noticeList' \
--header 'token: xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
  "pageNo": 1,
  "pageSize": 20
}'

Querying computation result of a job

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

The computation results will be submitted to the blockchain through smart contracts. You can query the results submitted to the chain by this api. All participants can submit their calculation results to the blockchain.

Headers

NameTypeDescription

token*

string

The token generated in the previous step

Request Body

NameTypeDescription

pageNo*

integer

page number

pageSize*

integer

page size

jobID*

string

job id

{
    "code": 200,
    "msg": "success",
    "size": 20,
    "page": 1,
    "totalPages": 1,
    "totalCount": 3,
    "trainModel": "",
    "testingResult": "",
    "data": [
        {
            "txHash": "0xea89d05654be3009ebe61fe163347afbf40a053ecc641b2fc075347b7d6020eb",
            "submitValue": "[[b'5.000000' b'8.199982']\n [b'-15.000000' b'12.000000']\n [b'3.000000' b'6.000000']]",
            "submitTime": 1673407741,
            "ccdUsage": "0.018"
        },
        {
            "txHash": "0xab3df69787c634ab29bb784e00e59e017806683ee74667f4b9e340c66906c6cd",
            "submitValue": "[[b'5.000000' b'8.199982']\n [b'-15.000000' b'12.000000']\n [b'3.000000' b'6.000000']]",
            "submitTime": 1673407740,
            "ccdUsage": "0.018"
        },
        {
            "txHash": "0xce311949f53579056cf69b151a342245a019c3f0450ea209e139fafa908d3d1e",
            "submitValue": "[[b'5.000000' b'8.199982']\n [b'-15.000000' b'12.000000']\n [b'3.000000' b'6.000000']]",
            "submitTime": 1673407740,
            "ccdUsage": "0.018"
        }
    ]
}

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/panel/subListByUser' \
--header 'token: xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
  "pageNo": 1,
  "pageSize": 20,
  "jobID": "xxxxxx"
}'

Querying CCD usage

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

Query the details of the CCD consumption of the account.

Headers

NameTypeDescription

token*

string

The token generated in the previous step

Request Body

NameTypeDescription

pageNo*

integer

page number

pageSize*

integer

page size

{
    "code":200,
    "msg":"success",
    "size":20,
    "page":1,
    "totalPages":1,
    "totalCount":2,
    "data":[
        {
            "jobID":"67359335745793195679188745481165227472100204117487131087027292513447780097380",
            "type":"Upload",
            "jobName":"logistic regression job",
            "creator":"111@gmail.com",
            "creationTime":1677490079,
            "updateTime":1677490079,
            "ccdUsage":"0.003521",
            "contractAddr":"0x234f698c47ff3B6DC05DC2f9F1a357f2f6Dcda16"
        },
        {
            "jobID":"92660823194349043075443300863708415242102090291282612538954225036265610510681",
            "type":"Upload",
            "jobName":"decision tree job",
            "creator":"111@gmail.com",
            "creationTime":1677489985,
            "updateTime":1677489985,
            "ccdUsage":"0.011765",
            "contractAddr":"0x717c6364378D2de0032BEfD0AB5964B44691750f"
        }
    ]
}

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/panel/ccdUsageList' \
--header 'token: xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
  "pageNo": 1,
  "pageSize": 20
}'

Downloading uploaded dataset

GET https://www.phoenix.global/sdk/computation/panel/downloadDataset

Download the dataset of the upload job. Only the creator of the upload job can successfully call this api.

Query Parameters

NameTypeDescription

datasetType*

string

dataset type,one of feature, target, testing

jobID*

string

job id

Headers

NameTypeDescription

token*

string

The token generated in the previous step

The usage of curl and golang sdk is as follows:

curl --location 'https://www.phoenix.global/sdk/computation/panel/downloadDataset?datasetType=target&jobID=xxxxxx' \
--header 'token: xxxxxx'