To create a Transaction with media (i.e. photos, videos, signatures, etc.):
file_id
chosen by the client.upload_url
. Upload the media file to that URL using a standard HTTP
PUT
request.$ 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.", ... } }] } }
Param name | Description |
---|---|
transaction
required |
Transaction attributes Validations:
|
transaction[asset_id]
required |
ID of the corresponding Asset Validations:
|
transaction[location_id]
optional |
Location ID (manager only)- required even if draft if inspection (transaction) is created by managers Validations:
|
transaction[department_id]
optional , nil allowed |
Department ID Validations:
|
transaction[work_order_id]
optional , nil allowed |
Work Order ID Validations:
|
transaction[task_id]
optional , nil allowed |
Task ID Validations:
|
transaction[check_in]
optional , nil allowed |
Check-in/-out? Validations:
|
transaction[draft]
optional , nil allowed |
Is it a draft? Validations:
|
transaction[damage]
optional , nil allowed |
Damage? Validations:
|
transaction[email_recipients]
optional , nil allowed |
Email addresses for transaction summary email Validations:
|
transaction[sms_recipients]
optional , nil allowed |
Phone numbers for transaction summary PDF - in format ‘+12065554321’ Validations:
|
transaction[geo_coord]
optional , nil allowed |
Geographical location (longitude, latitude) Validations:
|
transaction[notations]
optional , nil allowed |
Notations Validations:
|
transaction[notations_extended]
optional , nil allowed |
Notations extended for Inline data like media Validations:
|
transaction[workflow_id]
optional , nil allowed |
Workflow ID Validations:
|
transaction[photos]
optional |
Photos Validations:
|
transaction[photos][image]
required |
File ID of uploaded image Validations:
|
transaction[photos][notation]
optional , nil allowed |
Notation (damage type) Validations:
|
transaction[photos][damage_area]
optional , nil allowed |
Damage area in photo (left,top (,right,bottom) Validations:
|
transaction[photos][geo_coord]
optional , nil allowed |
Location (longitude, latitude) Validations:
|
transaction[photos][created_at]
required |
Creation time Validations:
|
transaction[photos][instruction_id]
optional , nil allowed |
Instructions for Photo Validations:
|
transaction[photos][overlays]
optional , nil allowed |
Overlays the server will add to photo to indicate region of interest Validations:
|
transaction[photos][overlays][type]
required |
Type of overlay (must be ‘symbol’) Validations:
|
transaction[photos][overlays][cx]
required |
Left position as a float value between 0 and 1 (percentage from left) Validations:
|
transaction[photos][overlays][cy]
required |
Top position as a float value between 0 and 1 (percentage from top) Validations:
|
transaction[photos][overlays][symbol]
optional , nil allowed |
Symbol to overlay (must be ‘ring’, ‘ring@2x’, ‘ring@3x’) Validations:
|
transaction[videos]
optional |
Videos Validations:
|
transaction[videos][video]
required |
File ID of uploaded video Validations:
|
transaction[videos][duration]
optional |
Length of video file (in seconds) Validations:
|
transaction[videos][geo_coord]
optional , nil allowed |
Location (longitude, latitude) Validations:
|
transaction[videos][created_at]
required |
Creation time Validations:
|
transaction[signatures]
optional |
Signatures Validations:
|
transaction[signatures][name]
optional , nil allowed |
Name of the signatory Validations:
|
transaction[signatures][image]
optional , nil allowed |
File ID of uploaded signature image Validations:
|
transaction[signatures][geo_coord]
optional , nil allowed |
Location (longitude, latitude) Validations:
|
transaction[signatures][created_at]
required |
Creation time Validations:
|
transaction[files]
optional |
Attached files Validations:
|
transaction[files][file]
required |
File ID of uploaded attachment Validations:
|
transaction[files][description]
optional , nil allowed |
Description Validations:
|
transaction[ident_docs]
optional |
Identification documents Validations:
|
transaction[ident_docs][front_image]
required |
File ID of uploaded image for document front Validations:
|
transaction[ident_docs][back_image]
optional , nil allowed |
File ID of uploaded image for document back Validations:
|
transaction[ident_docs][identity]
optional |
Identity information (varies by document type) Validations:
|
transaction[forms]
optional |
Form data Validations:
|
transaction[forms][form_template_id]
required |
FormTemplate ID Validations:
|
transaction[forms][values]
required |
Form field values Validations:
|
transaction[extended]
optional , nil allowed |
Extended data Validations:
|
transaction[recalls]
optional , nil allowed |
Vehicle recall data Validations:
|