Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

We provide an endpoint to run a script on a drawing and an endpoint to request the status of a script job.

Run a script job

Endpoint

 POST /startScriptJob

Query parameters

auth - API key associated with the partner

userId - partner defined user id

file - Identifier of designated file in backend system

fileUrl - URl to the file to open. Read only access (optional to the file parameter)

server - API server (not required if your files are loaded from S3 content bucket)

sessionId - Session id (optional, will be passed in header of requests to the API server)

token - Token (optional, will be passed in header of requests to the API server)

script - Url of the script file.

scriptOutputFile - It specifies the filename where the script output is written to. The file is uploaded to partner S3 content bucket logs folder. (optional)

Response

Text: JobID::{jobId}

jobId - unique job id that can be used to request job status.

Script file

Is a text file with extension *.scr that contains commands to execute.

Important: The script should always end with _EXIT command to make sure the server session is exited properly.

Example:

_CIRCLE 15,15 5

_CIRCLE 25,15 5

_EXIT

Get script job status

Endpoint

GET /scriptJobStatus

Query parameters

jobId - job id returned by start script job request

auth - API key associated with the partner

Response

Text: Job Status::{status}

status  - job status (Started, Failed or Successful)

Script job output

If scriptOutputFile parameter was provided with /startScriptJob request, a file with this name will be uploaded to partner’s S3 content bucket logs folder.

If the parameter was not passed, a default output file named {file}.txt will be created.