To create a Transaction with media (i.e. photos, videos, signatures, etc.):

  1. Call the User Uploads endpoint, passing a unique file_id chosen by the client.
  2. The response will include an upload_url. Upload the media file to that URL using a standard HTTP PUT request.
  3. Reference the uploaded file by ID in the request payload, as described below.

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 '{"transaction": { "asset_id": "43", "location_id": "44", work_order_id": "33", "department_id": "55", "group_id": "99", notations": {}, notations_extended: {}, "check_in": true, "damage": false, "geo_coord": [122.289139, 47.612417], "photos": [], "videos": [], "signatures": [{ "image": "signature1", created_at: "2016-06-14T21:33:54.000Z" }], "ident_docs": [{ "front_image": "license1", "identity": {} }] }}' \
  https://api.record360.com/api/transactions

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

{
  "transaction": {
    "id": "42",
    "check_in": true,
    "damage": false,
    "draft": false,
    "group_id": "99",
    "department_id": "55",
    "notations": { ... },
    "geo_coord": [122.289139, 47.612417],
    "email_sent_to": [],
    "sms_summary_numbers": ["+1425555555", "+1425554444"],
    "workflow_id": "12",
    "workflow_name": "Pickup",
    "archive_status": "active",
    "created_at": "2016-06-14T22:59:22.225Z",
    "asset": {
      "id": "43",
      "external_id": "0011110384607"
    },
    "user": {
      "id": "47",
      "username": "[email protected]",
      "first_name": "Some",
      "last_name": "User"
    },
    "location": {
      "id": "44",
      "name": "Main Office"
    },
    "photos": [
      {
        "id": "1",
        "created_at": "2014-02-19T06:46:29.000Z",
        "url": "https://record360-media.s3.amazonaws.com/42/image/image1.jpg",
        "byte_size": 638425,
        "geo_coord": [122.289139, 47.612417],
        "notation": "scratch",
      },
    ],
    "videos": [
      {
        "id": "1",
        "created_at": "2014-02-19T06:46:29.000Z",
        "url": "https://record360-media.s3.amazonaws.com/42/video/video1.mp4",
        "thumbnail_url": "https://record360-media.s3.amazonaws.com/42/video/video1-tn.mp4",
        "byte_size": 5650782
        "geo_coord": [122.289139, 47.612417],
        "duration": 42,
      },
    ],
    "signatures": [
      {
        "id": "1",
        "name": "J. Random Customer",
        "url": "https://record360-media.s3.amazonaws.com/42/signature/signature1.png",
        "byte_size": 13389,
        "geo_coord": [122.289139, 47.612417],
        "created_at": "2014-02-19T06:46:30.000Z"
      }
    ],
    "files": [
      {
        "id": "1",
        "created_at": "2014-02-19T06:46:30.000Z",
        "url": "https://record360-media.s3.amazonaws.com/42/file/ABCXYZ123.pdf",
        "byte_size": 555046
      }],
    "forms": [{
      form_template_id: "64",
      "values": {
        "Name": "J. Random User",
        "Street Address": "123 Main St.",
        ...
      }
    }]
  }
}

Params

Param name Description
transaction
required

Transaction attributes

Validations:

  • Must be a Hash

transaction[asset_id]
required

ID of the corresponding Asset

Validations:

  • Must be a String

transaction[location_id]
optional

Location ID (manager only)- required even if draft if inspection (transaction) is created by managers

Validations:

  • Must be a String

transaction[department_id]
optional , nil allowed

Department ID

Validations:

  • Must be a String

transaction[work_order_id]
optional , nil allowed

Work Order ID

Validations:

  • Must be a String

transaction[check_in]
optional , nil allowed

Check-in/-out?

Validations:

  • Must be one of: true, false, 1, 0.

transaction[draft]
optional , nil allowed

Is it a draft?

Validations:

  • Must be one of: true, false, 1, 0.

transaction[damage]
optional , nil allowed

Damage?

Validations:

  • Must be one of: true, false, 1, 0.

transaction[email_recipients]
optional , nil allowed

Email addresses for transaction summary email

Validations:

  • Must be an array of String

transaction[sms_recipients]
optional , nil allowed

Phone numbers for transaction summary PDF - in format ‘+12065554321’

Validations:

  • Must be an array of String

transaction[geo_coord]
optional , nil allowed

Geographical location (longitude, latitude)

Validations:

  • Must be an array of any type

transaction[notations]
optional , nil allowed

Notations

Validations:

  • Must be a Hash

transaction[notations_extended]
optional , nil allowed

Notations extended for Inline data like media

Validations:

  • Must be a Hash

transaction[workflow_id]
optional , nil allowed

Workflow ID

Validations:

  • Must be a String

transaction[photos]
optional

Photos

Validations:

  • Must be an Array of nested elements

transaction[photos][image]
required

File ID of uploaded image

Validations:

  • Must be a String

transaction[photos][notation]
optional , nil allowed

Notation (damage type)

Validations:

  • Must be a String

transaction[photos][damage_area]
optional , nil allowed

Damage area in photo (left,top (,right,bottom)

Validations:

  • Must be point or rectangle

transaction[photos][geo_coord]
optional , nil allowed

Location (longitude, latitude)

Validations:

  • Must be an array of any type

transaction[photos][created_at]
required

Creation time

Validations:

  • Must be a String

transaction[photos][instruction_id]
optional , nil allowed

Instructions for Photo

Validations:

  • Must be a String

transaction[videos]
optional

Videos

Validations:

  • Must be an Array of nested elements

transaction[videos][video]
required

File ID of uploaded video

Validations:

  • Must be a String

transaction[videos][duration]
optional

Length of video file (in seconds)

Validations:

  • Must be a Numeric

transaction[videos][geo_coord]
optional , nil allowed

Location (longitude, latitude)

Validations:

  • Must be an array of any type

transaction[videos][created_at]
required

Creation time

Validations:

  • Must be a String

transaction[signatures]
optional

Signatures

Validations:

  • Must be an Array of nested elements

transaction[signatures][name]
optional , nil allowed

Name of the signatory

Validations:

  • Must be a String

transaction[signatures][image]
optional , nil allowed

File ID of uploaded signature image

Validations:

  • Must be a String

transaction[signatures][geo_coord]
optional , nil allowed

Location (longitude, latitude)

Validations:

  • Must be an array of any type

transaction[signatures][created_at]
required

Creation time

Validations:

  • Must be a String

transaction[files]
optional

Attached files

Validations:

  • Must be an Array of nested elements

transaction[files][file]
required

File ID of uploaded attachment

Validations:

  • Must be a String

transaction[files][description]
optional , nil allowed

Description

Validations:

  • Must be a String

transaction[ident_docs]
optional

Identification documents

Validations:

  • Must be an Array of nested elements

transaction[ident_docs][front_image]
required

File ID of uploaded image for document front

Validations:

  • Must be a String

transaction[ident_docs][back_image]
optional , nil allowed

File ID of uploaded image for document back

Validations:

  • Must be a String

transaction[ident_docs][identity]
optional

Identity information (varies by document type)

Validations:

  • Must be a Hash

transaction[forms]
optional

Form data

Validations:

  • Must be an Array of nested elements

transaction[forms][form_template_id]
required

FormTemplate ID

Validations:

  • Must be a String

transaction[forms][values]
required

Form field values

Validations:

  • Must be a Hash

transaction[extended]
optional , nil allowed

Extended data

Validations:

  • Must be a Hash

transaction[recalls]
optional , nil allowed

Vehicle recall data

Validations:

  • Must be an array of Hash