Updated on 2025-03-05 GMT+08:00

Common Algorithm Parameters

Request Example

{
 "algorithmName":"XXX",
 "parameters":{
         ...
 }
}

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

algorithmName

Yes

String

Algorithm name.

Available values are as follows (algorithm names you can call):

  • shortest_path
  • shortest_path_of_vertex_sets
  • common_neighbors_of_vertex_sets

parameters

Yes

Object

Algorithm parameters. For details, see the parameter description of each algorithm.

Table 2 New Body parameters of version 2.1.7

Parameter

Mandatory

Type

Description

executionMode

No

String

  • sync: synchronous
  • async: asynchronous

The default value is async.

Supported algorithms are as follows (algorithm names you can call):

  • shortest_path
  • shortest_path_of_vertex_sets

offset

No

Integer

Synchronization result offset. The default value is 0.

NOTE:

This parameter is available when executionMode is sync.

Supported algorithms are as follows (algorithm names you can call):

  • shortest_path
  • shortest_path_of_vertex_sets
  • common_neighbors_of_vertex_sets

limit

No

Integer

Maximum number of returned synchronization results. The maximum value is 100000. The default value is 100000.

NOTE:

This parameter is available when executionMode is sync.

Supported algorithms are as follows (algorithm names you can call):

  • shortest_path
  • shortest_path_of_vertex_sets
  • common_neighbors_of_vertex_sets

Example Response

Algorithms are executed based on input parameters. You can call Querying Job Status and Execution Results to use the job_id returned by the algorithm to obtain the algorithm execution result.

Status code: 200

Example response (successful request)

{
    "data": {

   "outputs": {
           $response_data //Result of each algorithm. The results vary with the algorithm.
           "runtime": 1.365867,
           "data_return_size": 3,
           "data_offset": 0,
           "data_total_size": 100
    }
  },
  "status": "complete"
}

response_data indicates the result of each algorithm. The results vary with algorithms.

Status code: 400

Example response (failed request)

Http Status Code: 400
{
"errorMessage":"Running algorithm [XXXX] error: YYYYYYYYY!",
"errorCode":"GES.8301"
}

Response Parameters

Table 3 Response body parameters

Parameter

Type

Description

errorMessage

String

System prompt. If execution succeeds, this parameter may be left blank. If execution fails, this parameter is used to display the error message.

errorCode

String

System prompt. If execution succeeds, this parameter may be left blank. If execution fails, this parameter is used to display the error code.

status

String

Returned job status for a successful query. Possible values are waiting, running, and complete. This parameter is left blank when the query fails.

data

Object

Algorithm execution result. This parameter is left blank when the query fails.