# Administration API

Every function listed in this page may be used directly from the administration section in the application.

# Create an administrator

If no user has been registered yet, any attempt to connect triggers an admin creation form.

To create an administrator account without the help of the form, please use the following route :

Path Method Parameters
/api/admin/register POST userid (valid mail address), password, confirm (password confirmation)

# Possible outputs

  • 201 Created : The admin has been created.
  • 400 Bad Request : Missing parameter.
  • 409 Conflict : There's already an admin.
  • 500 Internal Server Error : Creation failed.

# Exemple curl

curl -X POST --data "userid=foo@foo.fr&password=bar&confirm=bar" http://localhost:59599/api/admin/register

# Get running jobs

Path Méthode Paramètres
/api/admin/jobs GET

Outputs a JSON table with the IDs of the jobs that are currently running.

# Exemple curl

curl -X GET --proxy "" -u "admin:password" http://localhost:59599/api/admin/jobs

# Users management

# List users

Path Méthode Paramètres
/api/admin/users GET

Outputs a JSON table with the complete list of users.

# Exemple curl

curl -X GET --proxy "" -u "admin:password" http://localhost:59599/api/admin/users

# Add a user

Path Méthode Paramètres
/api/admin/users/ POST userid (valid mail address), password, group (defaults to 'user', set to 'admin' to create an administrator)

# Possible outputs

  • 201 Created : User has been created.
  • 400 Bad Request : Missing parameter.
  • 409 Conflict : User name already exists.
  • 500 Internal Server Error : Creation failed.

When the creation succeeds, the output contains a complete information about the user in JSON format.

# Exemple curl

curl -X POST --proxy "" -u "admin:password" --data "userid=foo@foo.net&password=bar&group=user" http://localhost:59599/api/admin/users/

# Update a user ###

Path Méthode Paramètres
/api/admin/users/{username} POST username (valid mail address), group

# Possible outputs

  • 200 OK : User updated.
  • 400 Bad Request : Missing parameter.
  • 404 Not Found : User not found.
  • 500 Internal Server Error : Update failed.

When the update succeeds, the output contains the updated user in JSON format.

# Exemple curl

curl -X POST --proxy "" -u "admin:password" --data "group=admin" http://localhost:59599/api/admin/users/foo@foo.net

# Delete a user ###

Path Method Parameters
/api/admin/users/{username} DELETE

# Possible output

  • 204 No Content : User has been deleted.
  • 404 Not Found : User not found.
  • 403 Forbidden : The admin has tried to delete the admin account.

# Example curl

curl -v -X DELETE -u "admin:password" http://localhost:59599/api/admin/users/foo@foo.net

# Reset a password ###

Path Method Parameters
/api/admin/passwords/{username} POST

# Possible output

  • 200 OK : The password has been reset.
  • 404 Not Found : User not found.

# Example curl

curl -v -X DELETE -u "admin:password" http://localhost:59599/api/admin/users/foo@foo.net

# Repositories update

The URLs below allow for updating the different parts of ezPAARSE.

# Check the state of a repository

Path Method What's updated
/api/admin/app/status GET Core software
/api/admin/platforms/status GET Platforms (Parsers, PKBs, scrapers)
/api/admin/middlewares/status GET Middlewares
/api/admin/resources/status GET Resources (predefined settings, default formats...)

# Possible feedbacks

  • 200 OK : Checking normally completed.
  • 500 Internal Server Error : Checking failed.

# Response body

The server reply with a JSON response containing various things about the git status of the given repository.

Example:

{
  "current": "2.9.4-4-g9089308", # Current commit description
  "head": "2.9.4-4-g9089308",    # HEAD commit description
  "tag": "2.9.4",                # Current git tag (latest tag before the current commit)
  "from-head": "uptodate",       # State of HEAD compared to origin (can be 'uptodate' or 'outdated')
  "from-tag": "upward",          # State of current tag compared to origin (can be 'uptodate', 'outdated' or 'upward')
  "local-commits": false,        # Is there any unpushed local commit ?
  "local-changes": false         # Is there any uncommited local changes ?
}

# Example curl

curl -X GET -u "admin:password" http://localhost:59599/api/admin/platforms/status

# Update a repository

Path Method Parameters
/api/admin/app/status PUT Core software
/api/admin/platforms/status PUT Platforms (Parsers, PKBs, scrapers)
/api/admin/middlewares/status PUT Middlewares
/api/admin/resources/status PUT Resources (predefined settings, default formats...)

# Example curl

curl -X PUT -u "admin:password" http://localhost:59599/api/adminplatforms/status

# Possible outputs

  • 200 OK : Platforms have been updated
  • 500 Internal Server Error : Update failed.