User Tools


Cancel Project

Back to JEA API docs


Use the Cancel Project command to cancel the exploration process of an existing project. No stats on project completion will be carried out if a project is cancelled. This is the main difference between cancelling and terminating a project.

A valid JWT token must be included in the header, otherwise, the transaction will be rejected with an HTTP 401 Unauthorized error code. The result of the operation will be reported in an Engine Response object.

Synopsis

Engine Response

Result of the operation is returned as an engine response object as seen in the example here:

{
  "description": "Cancel flag set for project circle.",
  "ok": true
}

If the project is not accessible, the response may be:

{
  "description": "Project \"circle\" does not exist or not accessible to user \"yi@jeplus.org\".",
  "ok": false
}

Example using curl://

To send the Cancel Project command using curl:

curl -H "Authorization:Bearer eyJraWQiOiIxNT...9gjFXUrpQ" http://jea.ensims.com/jea_web/api/cancel/circle

On successful operation, an engine response object is returned. If the existing JWT is invalid, an HTTP 401 Unauthorized code will be returned.

Example using Python Requests

Make sure Requests is correctly installed in your Python environment, and run the following the lines:

import requests

jwt = 'eyJraWQiOiIxNTAy...yBqDDTkfjmsQons9gjFXUrpQ'
headers = {'Authorization': 'Bearer ' + jwt}
body = {}

# Cancel 'circle' project 
r = requests.get('http://jea.ensims.com/jea_web/api/cancel/circle', headers=headers, json=body)
  
r.json()


Site Tools