Transaction IDs and External IDs

Each endpoint that takes a Transaction identifier (i.e. show, transactions, and destroy) accepts either:

  • The Record360 numeric Transaction ID, as returned by the show and index endpoints (e.g. 42).
  • An External ID (i.e. VIN), prefaced with an underscore (e.g. _WMWMF33519TW73378)

GET /api/assets
Index of all Assets

Returns a list of Assets which match the supplied filter (JSON encoded).

Currently supported filters:

  • external_id (string) reference number, VIN, etc.
  • check_in (boolean) true=checked-in, false=checked-out
  • created_at (time, time range) May be a time (in ISO 8601 format), in which case only Transactions at or after that time will be returned. It may also be a range of times, expressed as an array.
  • user_id (string)
  • location_id (string)
  • extended (object) Matches field(s) in the extended data. Supports dot notation to match nested objects and arrays.(see second example below)

Examples

$ curl -i \
  -H "Accept: application/json; version=1" \
  -H "Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQyLCJpYXQiOjE0NjM2OTQ4MjN9.k48v-R-un93KdIXqp9Zi12JOGJCu8uibtrWjscFCTqc" \
  "https://api.record360.com/api/assets?after_id=41&limit=2"

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate
{
  "assets": [
    {
      "id": "42",
      "external_id": "0011110384607"
    },
    {
      "id": "43",
      "external_id": "WMWMF33519TW73378",
      "make": "MINI",
      "model": "Cooper",
      "year": 2009,
      "check_in": true,
      "notations": { ... },
      "geo_coord": [122.289139, 47.612417],
      "email_sent_to": [],
      "location": {
        "id": "44",
        "name": "Main Office"
      },
      "transaction": {
        ...
      },
      "photos": [],
      "videos": [
        {
          "id": "1",
          "created_at": "2014-02-19T06:46:29.000Z",
          "url": "https://record360-media.s3.amazonaws.com/42/video/video1.mp4",
          "byte_size": 5650782
        },
      ],
      "damages": [
        {
          "id": "1",
          "created_at": "2014-02-19T06:46:29.000Z",
          "photos": [
            {
              "id": "58",
              "url": "https://record360-media.s3.amazonaws.com/42/image/image1.jpg",
              "byte_size": 638425,
              "created_at": "2014-02-19T06:46:29.000Z",
              "notation": "scratch"
            }
          ]
        }
      ],
      "signatures": [
        {
          "id": "1",
          "created_at": "2014-02-19T06:46:30.000Z",
          "url": "https://record360-media.s3.amazonaws.com/42/signature/signature1.png",
          "byte_size": 13389
        }
      ]
    },
    ...
  ],
  "links": {
    "prev": "https://api.record360.com/api/assets?before_id=42&limit=2",
    "next": "https://api.record360.com/api/assets?after_id=43&limit=2"
  }
}
  #   Example using filter with an extended property
  #
  #   Note that filter is a json parameter

 curl -i -X GET   -H "Accept: application/json; version=1"   -H "Authorization: Token eyJraWQiOiJLRitOMW01ZlJqdkMraFFIdktHL3d3IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIxNTc1IiwiaWF0IjoxNjY1NTkyMjIyfQ.BrtzzmYMeWFxcJ_JMVTf96Nxt3OrxoowyToo5CnYyWS155FpDhR_eVYUkPIttBV-ZLxCT1Obvpj-_k_ahnLL5lgePjzdidFC8n_ZV1nEJQjHEFDz6Vt9vBEkJMucdb0FUr_oyd_TiqobE7m7T7f0C3YJaiL8BbRPjgCoTUl-xFMuQZ-BBz0HTUzMFBo848f2OfspwufrG0jZiLUtcvEBCL21qi0OjIzHECjnsAHiKLigO5f25mzWCwzehIrpN2bpmK_fyYWaxwJb9YtV5HixC_hMftqy_NLvQLbkk5oBxy7vQ17UAPufRTaY7Dp1ODhZforZC2FmYB9jprp-Cm7jHw"   "https://api.record360.com/api/assets?limit=2"   -d '{"filter": {"extended":{"Email":"[email protected]"}}}'

  {
  "assets": [
    {
      "id": "1",
      "external_id": "sigtest4",
      "check_in": false,
      "notations": {
        "Checklist": {
          "Customer Date of Birth:": "",
          "Comments/Notes:": "",
          "Checklist Items": {
            "Registration Included": "false",
            "Operators Manual": "false"
          },
          "Customer Address:": "1",
          "Fuel IN:": "",
          "Mileage OUT:": "",
          "Drivers License Expiration Date:": "",
          "Fuel Added (Gallons):": "",
          "Fuel OUT:": "",
          "Inspection Items": {
            "Clean Interior": "",
            "Clean Exterior": ""
          },
          "Mileage IN:": "",
          "Customer Name:": "Sample data"
        }
      },
      "email_sent_to": [],
      "damage_cost": 1.2,
      "user": {
        "id": "546",
        "username": "[email protected]",
        "first_name": "ryan",
        "last_name": "morgan"
      },
      "location": {
        "id": "1000000100",
        "name": "AccuantScanTest"
      },
      "transaction": {
        "id": "11277",
        "check_in": false,
        "draft": false,
        "damage": false,
        "geo_coord": [
          -122.289228,
          47.612426
        ],
        "email_sent_to": [],
        "created_at": "2016-08-18T22:34:19.000Z",
        "workflow_modules": [
          "L1",
          "RC2",
          "LB1",
          "M1",
          "N2",
          "F1",
          "E1",
          "C2"
        ],
        "archive_status": "archived",
        "workflow_id": "195",
        "view_url": "https://dashboard.record360.com/dashboard/inspections/11277",
        "notations": {
          "Checklist": {
            "Customer Date of Birth:": "",
            "Comments/Notes:": "",
            "Checklist Items": {
              "Registration Included": "false",
              "Operators Manual": "false"
            },
            "Customer Address:": "1",
            "Fuel IN:": "",
            "Mileage OUT:": "",
            "Drivers License Expiration Date:": "",
            "Fuel Added (Gallons):": "",
            "Fuel OUT:": "",
            "Inspection Items": {
              "Clean Interior": "",
              "Clean Exterior": ""
            },
            "Mileage IN:": "",
            "Customer Name:": "Sample data"
          }
        },
        "asset": {
          "id": "1",
          "external_id": "sigtest4"
        },
        "user": {
          "id": "579",
          "username": "[email protected]",
          "first_name": "243",
          "last_name": "342"
        },
        "location": {
          "id": "1000000100",
          "name": "AccuantScanTest"
        },
        "photos": [
          {
            "id": "25726",
            "created_at": "2016-08-18T15:22:46.000Z",
            "byte_size": 108863,
            "url": "https://app.record360.com/m/5GSaWV",
            "thumbnail_url": "https://app.record360.com/m/DjSZVBimSZ"
          }
        ],
        "videos": [],
        "signatures": [
          {
            "id": "9143",
            "geo_coord": [
              -122.289228,
              47.612426
            ],
            "url": "https://app.record360.com/m/PWs0q6",
            "byte_size": 238372,
            "created_at": "2016-08-18T15:22:50.000Z"
          }
        ],
        "ident_docs": [],
        "files": []
      },
      "drafts": [],
      "photos": [],
      "videos": [],
      "signatures": [
        {
          "id": "9143",
          "geo_coord": [
            -122.289228,
            47.612426
          ],
          "url": "https://app.record360.com/m/PWs0q6",
          "byte_size": 238372,
          "created_at": "2016-08-18T15:22:50.000Z"
        }
      ],
      "damages": [
        {
          "id": "25726",
          "photos": [
            {
              "id": "25726",
              "created_at": "2016-08-18T15:22:46.000Z",
              "byte_size": 108863,
              "url": "https://app.record360.com/m/5GSaWV",
              "thumbnail_url": "https://app.record360.com/m/DjSZVBimSZ"
            }
          ]
        }
      ]
    },
    {
      "id": "2",
      "external_id": "uvuyfhihgigig",
      "check_in": false,
      "notations": {},
      "email_sent_to": [],
      "damage_cost": 0,
      "user": {
        "id": "576",
        "username": "[email protected]",
        "first_name": "hdjdkd",
        "last_name": "nskkss"
      },
      "transaction": {
        "id": "10933",
        "check_in": false,
        "draft": false,
        "damage": false,
        "geo_coord": [
          -122.289276,
          47.61246
        ],
        "email_sent_to": [],
        "created_at": "2016-05-06T17:27:57.000Z",
        "archive_status": "active",
        "view_url": "https://dashboard.record360.com/dashboard/inspections/10933",
        "notations": {},
        "asset": {
          "id": "2",
          "external_id": "uvuyfhihgigig"
        },
    ...
  ],
  "links": {
    "next": "/api/assets?after_id=2&limit=2"
  }
}

Params

Param name Description
before_id
optional

Return Assets before the specified ID

Validations:

  • Must be a String

after_id
optional

Return Assets after the specified ID

Validations:

  • Must be a String

limit
optional

Limit the number of Assets to return (max: 50)

Validations:

  • Must be a number.

filter
optional

Filter results by attribute (JSON encoded)- EX: filter={“extended”:{“Email”:“[email protected]”}}

Validations:

  • Must be a String


GET /api/assets/:id
Show a particular Asset

Examples

$ curl -i \
  -H "Accept: application/json; version=1" \
  -H "Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQyLCJpYXQiOjE0NjM2OTQ4MjN9.k48v-R-un93KdIXqp9Zi12JOGJCu8uibtrWjscFCTqc" \
  https://api.record360.com/api/assets/42

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate

{
  "asset": {
    "id": "42",
    "external_id": "WMWMF33519TW73378",
    "make": "MINI",
    "model": "Cooper",
    "year": 2009,
    "check_in": true,
    "notations": { ... },
    "geo_coord": [122.289139, 47.612417],
    "email_sent_to": [],
    "location": {
      "id": "44",
      "name": "Main Office"
    },
    "transaction": {
      ...
    },
    "photos": [],
    "videos": [
      {
        "id": "1",
        "created_at": "2014-02-19T06:46:29.000Z",
        "url": "https://record360-media.s3.amazonaws.com/42/video/video1.mp4",
        "byte_size": 5650782
      },
    ],
    "signatures": [
      {
        "id": "1",
        "created_at": "2014-02-19T06:46:30.000Z",
        "url": "https://record360-media.s3.amazonaws.com/42/signature/signature1.png",
        "byte_size": 13389
      }
    ],
    "damages": [
      {
        "id": "1",
        "created_at": "2014-02-19T06:46:29.000Z",
        "photos": [
          {
            "id": "58",
            "created_at": "2014-02-19T06:46:29.000Z",
            "url": "https://record360-media.s3.amazonaws.com/42/image/image1.jpg",
            "byte_size": 638425,
            "notation": "scratch"
          }
        ]
      }
    ],
    "extended": {
      "fleet_id": 4280
    }
  }
}

Params

Param name Description
id
required

Asset ID or _externalid

Validations:

  • Must be a String


GET /api/assets/:id/transactions
Index of all Transactions for an Asset

Returns a list of Transactions for an Asset which match the supplied filter (JSON encoded).

Currently supported filters:

  • reference_number (string)
  • check_in (boolean) true=check-in, false=check-out, null=add media
  • damage (boolean)
  • created_at (time, time range) May be a time (in ISO 8601 format), in which case only Transactions at or after that time will be returned. It may also be a range of times, expressed as an array.
  • user_id (string)
  • location_id (string)
  • extended (object) Matches field(s) in the extended data. Supports dot notation to match nested objects and arrays.

Examples

$ curl -i \
  -H "Accept: application/json; version=1" \
  -H "Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQyLCJpYXQiOjE0NjM2OTQ4MjN9.k48v-R-un93KdIXqp9Zi12JOGJCu8uibtrWjscFCTqc" \
  "https://api.record360.com/api/assets/123/transactions?after_id=41&limit=2"

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate
{
  "transactions": [
    {
      "id": "42",
      "check_in": true,
      "damage": false,
      "notations": {},
      "geo_coord": [122.289139, 47.612417],
      "email_sent_to": [],
      "workflow_id": "12",
      "created_at": "2016-06-14T22:59:22.225Z",
      "asset": {
        "id": "123",
        "external_id": "0011110384607"
      },
      ...
    },
    {
      "id": "43",
      ...
    },
    ...
  ],
  "links": {
    "prev": "https://api.record360.com/api/assets/123/transactions?before_id=42&limit=2"
    "next": "https://api.record360.com/api/assets/123/transactions?after_id=43&limit=2"
  }
}

Params

Param name Description
id
required

Asset ID or _externalid

Validations:

  • Must be a String

before_id
optional

Return Transactions before the specified ID

Validations:

  • Must be a String

after_id
optional

Return Transactions after the specified ID

Validations:

  • Must be a String

limit
optional

Limit the number of Transactions to return (max: 50)

Validations:

  • Must be a number.

filter
optional

Filter results by attribute (JSON encoded)

Validations:

  • Must be a String


POST /api/assets
Find or create an Asset

Given a domain-specific external_id, finds the existing Asset or creates a new Asset.

If external_id is a Vehicle Identification Number (VIN), the Asset will be populated with the vehicle’s make, model, and year.

Data that is not typically included in the asset model but that you would like added is passed in using an ‘extended’ property. Pass these values in like in the examples below using a JSON format.

Examples

$ curl -i \
  -H "Accept: application/json; version=1" \
  -H "Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQyLCJpYXQiOjE0NjM2OTQ4MjN9.k48v-R-un93KdIXqp9Zi12JOGJCu8uibtrWjscFCTqc" \
  -X POST \
  -H 'Content-type: application/json' \
  -d '{"asset": { "external_id": "NCC-1701D" , "extended": { "fleet_id": 4279 }}}' \
  https://api.record360.com/api/assets

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate

{
  "asset": {
    "id": "42",
    "external_id": "NCC-1701D",
    ...
    "extended": {
      "fleet_id": 4279
    }
  }
}
$ curl -i \
  -H "Accept: application/json; version=1" \
  -H "Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQyLCJpYXQiOjE0NjM2OTQ4MjN9.k48v-R-un93KdIXqp9Zi12JOGJCu8uibtrWjscFCTqc" \
  -X POST \
  -H 'Content-type: application/json' \
  -d '{"asset": { "external_id": "WMWMF33519TW73378" , "extended": { "fleet_id": 4279 }}}' \
  https://api.record360.com/api/assets

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate

{
  "asset": {
    "id": "43",
    "external_id": "WMWMF33519TW73378",
    "make": "MINI",
    "model": "Cooper",
    "year": 2009,
    "notations": {},
    "photos": [],
    "videos": [],
    "signatures": [],
    "damages": [],
    ...
    "extended": {
      "fleet_id": 4279
    }
  }
}

Params

Param name Description
asset
required

Asset attributes

Validations:

  • Must be a Hash

asset[external_id]
required

Domain-specific ID of the asset (e.g. VIN, serial number, registration number, etc)

Validations:

  • Must be a String

asset[extended]
optional , nil allowed

Extended data to be set if creating

Validations:

  • Must be a Hash


PATCH /api/assets/:id
Update an Asset

PUT /api/assets/:id
Update an Asset

Only supports updating Extended data on an Asset.

Note: Data that is not typically included in the asset model but that you would like added is passed in using an ‘extended’ property. Pass the values to be updated in this extended property in like in the examples below using a JSON format

Examples

$ curl -i \
  -H "Accept: application/json; version=1" \
  -H "Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQyLCJpYXQiOjE0NjM2OTQ4MjN9.k48v-R-un93KdIXqp9Zi12JOGJCu8uibtrWjscFCTqc" \
  -X PUT \
  -H 'Content-type: application/json' \
  -d '{"asset": { "extended": { "fleet_id": 4279 }}' \
  https://api.record360.com/api/assets/42

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Cache-Control: max-age=0, private, must-revalidate

{
  "asset": {
    "id": "42",
    ...
    "extended": {
      "fleet_id": 4279
    }
  }
}

Params

Param name Description
asset
required

Asset attributes

Validations:

  • Must be a Hash

asset[extended]
optional , nil allowed

Extended data

Validations:

  • Must be a Hash


DELETE /api/assets/:id
Delete an Asset (manager only)

Examples

$ curl -i \
  -H "Accept: application/json; version=1" \
  -H "Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjQyLCJpYXQiOjE0NjM2OTQ4MjN9.k48v-R-un93KdIXqp9Zi12JOGJCu8uibtrWjscFCTqc" \
  -X DELETE \
  https://api.record360.com/api/assets/42

HTTP/1.1 204 No Content

Params

Param name Description
id
required

Asset ID or _externalid

Validations:

  • Must be a String