Task Import API (0.0.0)

Imports tasks via csv files given by the user.

This API is only authorized for VersaFleet SysAdmi

This API is only authorized for VersaFleet SysAdmin. Get presigned URL to upload import file to, before creating import job with file information This URL is only valid for one hour.

Authorizations:
bearerAuth
query Parameters
filename
string

The filename of the import file to be uploaded.

Responses

Response samples

Content type
application/json
{
  • "file": {
    },
  • "server_time": "2019-08-24T14:15:22Z"
}

This API is only authorized for VersaFleet SysAdmin. Return the list of Task Import Jobs.

Authorizations:
bearerAuth
query Parameters
page
integer <int64> >= 1
Default: 1
per_page
integer <int64> >= 1
Default: 200
order
string
Default: "desc"
Enum: "asc" "desc"

The direction of the sort

range_start_created_at
string <date-time>

Range start (inclusive) of Created At

range_end_created_at
string <date-time>

Range end (inclusive) of Created At

org_id
Array of strings

Array of Merchant IDs

Responses

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "task_import_jobs": [
    ]
}

(Deprecated. Use /presigned-url to upload files directly, then /sys/import-after-upload to create a new task import job) This API is only authorized for VersaFleet SysAdmin. Creates a Task Import Job (with a specific OrganizationID) that can be started later.

Authorizations:
bearerAuth
Request Body schema: multipart/form-data
files
string <binary>

There are a few requirements for the files to be uploaded:

  1. All files attached must be of type text/csv, preferably encoded in UTF-8
  2. All files must be non-empty
  3. All filenames must end with either 'tasks.csv' or 'items.csv'
  4. A filename that ends with 'tasks.csv' must be given
org_id
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "upload_record": {
    },
  • "last_executed_at_client_time_utc": "0001-01-01T00:00:00Z",
  • "last_executed_at_client_timezone": "",
  • "last_executed_at_server_time": "0001-01-01T00:00:00Z",
  • "server_time": "2020-10-28T10:30:24.061538+08:00",
  • "org_id": "organization_id"
}

This API is only authorized for VersaFleet SysAdmin. Creates a Task Import Job (with a specific OrganizationID) that can be started later. Import files should be uploaded directly using /presigned-url before running this request.

Authorizations:
bearerAuth
Request Body schema: application/json
required
Array of objects (file_data)
org_id
required
string
broadcast_preference
required
string
cargo_net_quantity
string
object (officer_contact)
service_type
required
string
Enum: "ltl" "motorcycle" "car" "mpv" "van_1.7m" "van_2.4m" "lorry_10ft" "lorry_14ft" "lorry_24ft" "lorry_40ft"

Responses

Request samples

Content type
application/json
{
  • "files": [
    ],
  • "org_id": "string",
  • "broadcast_preference": "string",
  • "cargo_net_quantity": "string",
  • "officer_contact": {
    },
  • "service_type": "car"
}

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "upload_record": {
    },
  • "last_executed_at_client_time_utc": "0001-01-01T00:00:00Z",
  • "last_executed_at_client_timezone": "",
  • "last_executed_at_server_time": "0001-01-01T00:00:00Z",
  • "server_time": "2020-10-28T10:30:24.061538+08:00",
  • "org_id": "organization_id"
}

This API is only authorized for VersaFleet SysAdmin. Read an existing Task Import Job.

Authorizations:
bearerAuth
path Parameters
import_job_id
required
string

ID of the Task Import Job to be read.

Responses

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "upload_record": {
    },
  • "last_executed_at_client_time_utc": "0001-01-01T00:00:00Z",
  • "last_executed_at_client_timezone": "",
  • "last_executed_at_server_time": "0001-01-01T00:00:00Z",
  • "server_time": "2020-10-28T10:30:24.061538+08:00",
  • "org_id": "organization_id"
}

This API is only authorized for VersaFleet SysAdmin. Start an existing Task Import Job. Tasks imported are added to the organization specified in the Task Import Job.

Authorizations:
bearerAuth
path Parameters
import_job_id
required
string

ID of the Task Import Job to be started.

Responses

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "upload_record": {
    },
  • "last_executed_at_client_time_utc": "0001-01-01T00:00:00Z",
  • "last_executed_at_client_timezone": "",
  • "last_executed_at_server_time": "0001-01-01T00:00:00Z",
  • "server_time": "2020-10-28T10:30:24.061538+08:00",
  • "org_id": "organization_id"
}

This API is only authorized for VersaFleet SysAdmin. Retrieve the result of the Task Import Job

Authorizations:
bearerAuth
path Parameters
import_job_id
required
string

ID of the Task Import Job to get the result for.

Responses

Response samples

Content type
application/json
{
  • "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
  • "task_import_job_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
  • "file_import_results": [
    ],
  • "total_tasks_counted": 8,
  • "total_tasks_imported": 3,
  • "total_tasks_rejected": 1,
  • "total_items_counted": 0,
  • "total_items_imported": 0,
  • "total_items_rejected": 0,
  • "errors": [
    ],
  • "server_time": "2020-12-28T09:49:27.064Z",
  • "org_id": "organization_id"
}

Get presigned URL to upload import file to, before

Get presigned URL to upload import file to, before creating import job with file information This URL is only valid for one hour.

Authorizations:
bearerAuth
query Parameters
filename
string

The filename of the import file to be uploaded.

Responses

Response samples

Content type
application/json
{
  • "file": {
    },
  • "server_time": "2019-08-24T14:15:22Z"
}

Return the list of Task Import Jobs.

Authorizations:
bearerAuth
query Parameters
page
integer <int64> >= 1
Default: 1
per_page
integer <int64> >= 1
Default: 200
order
string
Default: "desc"
Enum: "asc" "desc"

The direction of the sort

range_start_created_at
string <date-time>

Range start (inclusive) of Created At

range_end_created_at
string <date-time>

Range end (inclusive) of Created At

Responses

Response samples

Content type
application/json
{
  • "meta": {
    },
  • "task_import_jobs": [
    ]
}

(Deprecated. Use /presigned-url to upload files directly, then /import-after-upload to create a new task import job). Creates a Task Import Job that can be started later.

Authorizations:
bearerAuth
Request Body schema: multipart/form-data
files
string <binary>

There are a few requirements for the files to be uploaded:

  1. All files attached must be of type text/csv, preferably encoded in UTF-8
  2. All files must be non-empty
  3. All filenames must end with either 'tasks.csv' or 'items.csv'
  4. A filename that ends with 'tasks.csv' must be given

Responses

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "upload_record": {
    },
  • "last_executed_at_client_time_utc": "0001-01-01T00:00:00Z",
  • "last_executed_at_client_timezone": "",
  • "last_executed_at_server_time": "0001-01-01T00:00:00Z",
  • "server_time": "2020-10-28T10:30:24.061538+08:00",
  • "org_id": "organization_id"
}

Creates a Task Import Job that can be started later. Import files should be uploaded directly using /presigned-url before running this request.

Authorizations:
bearerAuth
Request Body schema: application/json
Array of objects (file_data)
start_timezone
required
string
start_time
required
string <date-time>
end_timezone
required
string
end_time
required
string
service_type
required
string
Enum: "ltl" "motorcycle" "car" "mpv" "van_1.7m" "van_2.4m" "lorry_10ft" "lorry_14ft" "lorry_24ft" "lorry_40ft"

Responses

Request samples

Content type
application/json
{
  • "files": [
    ],
  • "start_timezone": "string",
  • "start_time": "2019-08-24T14:15:22Z",
  • "end_timezone": "string",
  • "end_time": "string",
  • "service_type": "car"
}

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "upload_record": {
    },
  • "last_executed_at_client_time_utc": "0001-01-01T00:00:00Z",
  • "last_executed_at_client_timezone": "",
  • "last_executed_at_server_time": "0001-01-01T00:00:00Z",
  • "server_time": "2020-10-28T10:30:24.061538+08:00",
  • "org_id": "organization_id"
}

Read an existing Task Import Job.

Authorizations:
bearerAuth
path Parameters
import_job_id
required
string

ID of the Task Import Job to be read.

Responses

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "upload_record": {
    },
  • "last_executed_at_client_time_utc": "0001-01-01T00:00:00Z",
  • "last_executed_at_client_timezone": "",
  • "last_executed_at_server_time": "0001-01-01T00:00:00Z",
  • "server_time": "2020-10-28T10:30:24.061538+08:00",
  • "org_id": "organization_id"
}

Start an existing Task Import Job.

Authorizations:
bearerAuth
path Parameters
import_job_id
required
string

ID of the Task Import Job to be started.

Responses

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "upload_record": {
    },
  • "last_executed_at_client_time_utc": "0001-01-01T00:00:00Z",
  • "last_executed_at_client_timezone": "",
  • "last_executed_at_server_time": "0001-01-01T00:00:00Z",
  • "server_time": "2020-10-28T10:30:24.061538+08:00",
  • "org_id": "organization_id"
}

This API is only authorized for import worker. Retrieves file from AWS S3 for import.

Authorizations:
bearerAuth
path Parameters
bucket
required
string

Name of the AWS S3 bucket to get the file from

object_key
required
string

Object key of the file in the AWS S3 bucket to get hte file from

Responses

Response samples

Content type
application/json
{
  • "Error": "open sample.items.csv: no such file or directory"
}

Retrieve the current status of the Task Import Job

Authorizations:
bearerAuth
path Parameters
import_job_id
required
string

ID of the Task Import Job to retrieve the status for.

Responses

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "import_status": "new",
  • "file_upload_record_id": "000000000000000000000000",
  • "task_import_job_id": "000000000000000000000000"
}

This API is only authorized for import worker. Updates the status of a Task Import Job.

Authorizations:
bearerAuth
path Parameters
import_job_id
required
string

ID of the Task Import Job to update the status for.

Request Body schema: application/json
prev_status
string
next_status
string

Responses

Request samples

Content type
application/json
{
  • "prev_status": "string",
  • "next_status": "string"
}

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "import_status": "new",
  • "file_upload_record_id": "000000000000000000000000",
  • "task_import_job_id": "000000000000000000000000"
}

This API is only authorized for import worker. Updates the status of a Task Import Job to failed.

Authorizations:
bearerAuth
path Parameters
import_job_id
required
string

ID of the Task Import Job to update the status to failed for

Responses

Response samples

Content type
application/json
{
  • "id": "000000000000000000000000",
  • "import_status": "new",
  • "file_upload_record_id": "000000000000000000000000",
  • "task_import_job_id": "000000000000000000000000"
}

This API is only authorized for import worker. Record the result of a completed Task Import Job.

Authorizations:
bearerAuth
Request Body schema: application/json
id
string
task_import_job_id
string
Array of objects (file_import_result)
total_tasks_counted
integer <int64>
total_tasks_imported
integer <int64>
total_tasks_rejected
integer <int64>
total_items_counted
integer <int64>
total_items_imported
integer <int64>
total_items_rejected
integer <int64>
errors
Array of strings
server_time
string <date-time>
org_id
string <uuid>

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "task_import_job_id": "string",
  • "file_import_results": [
    ],
  • "total_tasks_counted": 0,
  • "total_tasks_imported": 0,
  • "total_tasks_rejected": 0,
  • "total_items_counted": 0,
  • "total_items_imported": 0,
  • "total_items_rejected": 0,
  • "errors": [
    ],
  • "server_time": "2019-08-24T14:15:22Z",
  • "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b"
}

Response samples

Content type
application/json
{
  • "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
  • "task_import_job_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
  • "file_import_results": [
    ],
  • "total_tasks_counted": 8,
  • "total_tasks_imported": 3,
  • "total_tasks_rejected": 1,
  • "total_items_counted": 0,
  • "total_items_imported": 0,
  • "total_items_rejected": 0,
  • "errors": [
    ],
  • "server_time": "2020-12-28T09:49:27.064Z",
  • "org_id": "organization_id"
}

Retrieve the result of the Task Import Job

Authorizations:
bearerAuth
path Parameters
import_job_id
required
string

ID of the Task Import Job to get the result for.

Responses

Response samples

Content type
application/json
{
  • "id": "xxxxxxxxxxxxxxxxxxxxxxxx",
  • "task_import_job_id": "xxxxxxxxxxxxxxxxxxxxxxxx",
  • "file_import_results": [
    ],
  • "total_tasks_counted": 8,
  • "total_tasks_imported": 3,
  • "total_tasks_rejected": 1,
  • "total_items_counted": 0,
  • "total_items_imported": 0,
  • "total_items_rejected": 0,
  • "errors": [
    ],
  • "server_time": "2020-12-28T09:49:27.064Z",
  • "org_id": "organization_id"
}

Return the template for task import

Responses

Return the template for item import

Responses