Octopi allows damages to be reported on containers.

A user can report as many damages as needed for a container.

When a container is reported as damaged, it cannot leave the terminal until the repair is completed. Notification emails will be sent for these events based on the organization settings.

Supported Formats

json

GET /api/v1/containers/:container_number/damages.json
Returns a list of Container Damages.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not found.
500 Server crashed for some reason.

Examples

This API endpoint allows you to get the reported damages for a Container.
curl "https://app.octopi.co/api/v1/containers/:container_number/damages" -X GET -H "Authorization: Token token=YOUR TOKEN HERE"
{
  "damages": [
    {
      "id": 133535,
      "remarks": "Big hole in the side.",
      "reported_by": "System",
      "reported_at": "2022-06-22T15:40:05Z",
      "needs_repair": true,
      "repair": {
        "status": "waiting"
      }
    }
  ]
}

Params

Param name Description
container_number
required

Allows you to search Containers by number.

Validations:

  • Must be a String


GET /api/v1/containers/:container_number/damages/:id.json
Returns a Container Damage.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not found.
500 Server crashed for some reason.

Examples

This API endpoint allows you to get a reported damage for a Container.
curl "https://app.octopi.co/api/v1/containers/:container_number/damages/:id" -X GET -H "Authorization: Token token=YOUR TOKEN HERE"
{
  "damage": {
    "id": 133535,
    "remarks": "Big hole in the side.",
    "reported_by": "System",
    "reported_at": "2022-06-22T15:40:05Z",
    "needs_repair": true,
    "repair": {
      "status": "waiting"
    }
  }
}

Params

Param name Description
container_number
required

Allows you to search Containers by number.

Validations:

  • Must be a String

id
required

Allows you to search Container Damages by ID.

Validations:

  • Must be a Integer


POST /api/v1/containers/:container_number/damages.json
Creates a Container Damage.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not found.
500 Server crashed for some reason.

Examples

This API endpoint allows you to report a damage for a Container.
curl "https://app.octopi.co/api/v1/containers/:container_number/damages" -X POST \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "Authorization: Token token=YOUR TOKEN HERE" \
    -d '{
        "damage": {
            "remarks": "Big hole in the side.",
            "damaged_at": null,
            "needs_repair": true
        }
    }'
{
  "damage": {
    "id": 133535,
    "remarks": "Big hole in the side.",
    "reported_by": "System",
    "reported_at": "2022-06-22T15:40:05Z",
    "needs_repair": true,
    "repair": {
      "status": "waiting"
    }
  }
}

Params

Param name Description
container_number
required

Allows you to search Containers by number.

Validations:

  • Must be a String

damage
required

Validations:

  • Must be a Hash

damage[remarks]
required

Validations:

  • Must be a String

damage[damaged_at]
optional

Validations:

  • Must be a String

damage[needs_repair]
optional

Validations:

  • Must be one of: true, false.


PATCH /api/v1/containers/:container_number/damages/:id
Starts and completes the repair for a Container Damage.

Supported Formats

json

Errors

Code Description
400 Bad Request.
404 Not found.
500 Server crashed for some reason.

Examples

This API endpoint allows you to start and complete repairs for a damage.
curl --location --request PATCH 'https://app.octopi.co/api/v1/containers/:container_number/damages/:id' \
--header "Authorization: Token token=YOUR TOKEN HERE" \
--header 'Content-Type: application/json' \
--data-raw '{
    "repair": {
        "status_changed_at": null,
        "status": "started"
    }
}'
{
  "damage": {
    "id": 133535,
    "remarks": "Big hole in the side.",
    "reported_by": "System",
    "reported_at": "2022-06-22T15:40:05Z",
    "needs_repair": true,
    "repair": {
      "status": "started",
      "started_at": "2022-06-22T17:58:05Z"
    }
  }
}

Params

Param name Description
container_number
required

Allows you to search Containers by number.

Validations:

  • Must be a String

id
required

Allows you to search Container Damages by ID.

Validations:

  • Must be a Integer

repair
required

Validations:

  • Must be a Hash

repair[status]
required

The status of the repair. Can be ‘started’ or ‘completed’.

Validations:

  • Must be a String

repair[status_changed_at]
optional

The date and time the status was changed. Defaults to the current time.

Validations:

  • Must be a String

repair[notes]
optional

Validations:

  • Must be a String