Skip to content

Instantly share code, notes, and snippets.

@hendri1
Created April 22, 2020 12:46
Show Gist options
  • Save hendri1/5d3107e54fad3ba235d8c596df2f9878 to your computer and use it in GitHub Desktop.
Save hendri1/5d3107e54fad3ba235d8c596df2f9878 to your computer and use it in GitHub Desktop.
Job Detail Contract API

Job Detail API Contract

Requirement

Data:
1. Details
   a. Job Name
   b. Status
   c. Description
   d. Job Type
   e. Date Created
   f. Who Created
2. Parameters
   a. Urgency
   b. No of Passes
   c. Accurarcy Treshold
   d. No of Files
3. Upload Details
   a. No of Success Upload
   b. No Of Failed Upload
4. Label Details
   a. List of Label
5. Progress (Client Only)
   a. Completed
   b. % Done
   c. Estimate
6. Action Log
   a. List of history action log

API

Client: ${BASE_URL}/api/v1/job/show

Admin: ${BASE_URL}/api/v1/admin/job/show

Method: GET

Query Parameter

1. job_id

Example Response

{
  "details": {
    "name": "Job Name",
    "status": "ongoing",
    "description" "Job Description",
    "type": "text"
    "type_name": "tagging",
    "created_at": "2020-04-17T11:57:30.617Z",
    "client": "Username Client"
  },
  "parameters": {
    "urgency": 1,
    "no_of_passes": 1,
    "accuracy_treshold": 1,
    "no_of_files": 1,
  },
  "uploads": {
    "success": 1,
    "failed": 1
  },
  "labels: [
    "YES",
    "NO"
  ],
  "progress": {
    "completed": 1,
    "estimate": 1
  }
}

Action Log

API

Client: ${BASE_URL}/api/v1/job/show/log

Admin: ${BASE_URL}/api/v1/admin/job/show/log

Method: GET

Query Parameter

1. job_id

Example Response

{
  "data": [
    {
      "action": "Detail of Action",
      "user": "username user",
      "created_at": "2020-04-17T11:57:30.617Z"
    }
  ],
  "paginate": {
    "current_page": 1,
    "per_page": 5,
    "total_page": 25,
    "total_data": 124
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment