V2 to V3 Migration

For organizations currently using the Vision V2 API and want to start using V3.

In order to make integrating directly with the Vision API more clear and convenient, we've published a new V3 API with terminology that makes every endpoint and property reflect it's intended purpose more accurately.

Truepic will provide backwards compatibility to developers currently integrated with V2 until it is removed (date TBD), but we encourage all developers to migrate their existing codebase to the V3 terminology as soon as possible. The business functionality of all endpoints remains the same across V2 and V3.

For example, the following are functionally the same, but with different terminology:

When making requests to each version of the API, all request paths, bodies and query parameters must match the API version being requested. If they do not, a 400 error will be thrown, specifying which properties are not correct. For example: Invalid properties for Vision API version v3 in request query: 'event' must be 'inspection'"

The following maps the old V2 endpoints to their new V3 equivalents:

V2 Endpoint (Old)V3 Endpoint (New)
GET /v2/customers/{customerId}/setupsGET /v3/customers/{customerId}/teams
GET /v2/eventsGET /v3/inspections
POST /v2/eventsPOST /v3/inspections
GET /v2/events/{eventId}GET /v3/inspections/{inspectionId}
PUT /v2/events/{eventId}PUT /v3/inspections/{inspectionId}
POST /v2/events/{eventId}/completePOST /v3/inspections/{inspectionId}/complete
GET /v2/events/{eventId}/exportGET /v3/inspections/{inspectionId}/export
POST /v2/events/{eventId}/exportPOST /v3/inspections/{inspectionId}/export
GET /v2/events/{eventId}/{listItemId}/ca/vin/{vinNumber}GET /v3/inspections/{inspectionId}/{listItemId}/ca/vin/{vinNumber}

Here is the complete list of terminology changes for your reference to help with updating your own source code:

{
  // CustomerSetup -> Team
  customerSetupId: 'teamId',
  CustomerSetup: 'Team',
  default_customer_setup: 'default_team',
  customer_setup_id: 'team_id',
  setups: 'organization-teams',
  customer_setups: 'teams',
  'customer-setup': 'organization-team',
  customer_setup: 'team',
  customer_team: 'organization_team',

  // UserAssignedCustomer -> UserAssignedOrganization
  UserAssignedCustomer: 'UserAssignedOrganization',
  user_assigned_customers: 'user_assigned_organizations',

  // CustomerPlan -> OrganizationPlan
  CustomerPlan: 'OrganizationPlan',
  customerPlan: 'organizationPlan',
  customer_plans: 'organization_plans',
  customer_plan_id: 'organization_plan_id',
  customer_plan: 'organization_plan',

  // CustomerSalesforceConfig -> OrganizatonSalesforceConfig
  CustomerSalesforceConfig: 'OrganizationSalesforceConfig',
  customer_salesforce_configs: 'organization_salesforce_configs',
  customer_salesforce_config: 'organization_salesforce_config',

  // CustomerReportConfig -> OrganizationReportConfig
  CustomerReportConfig: 'OrganizationReportConfig',
  customer_reports_configs: 'organization_reports_configs',
  customer_reports_config: 'organization_reports_config',

  // CustomerSetupEventType -> TeamInspectionType
  CustomerSetupEventType: 'TeamInspectionType',
  customer_setups_event_types: 'teams_inspection_types',

  // CustomerSetupWebhook -> TeamWebhook
  CustomerSetupWebhook: 'TeamWebhook',
  customer_setups_webhooks: 'team_webhooks',

  // Customer -> Organization
  customers: 'organizations',
  customer_id: 'organization_id',
  Customer: 'Organization',
  ignoreCustomerIds: 'ignoreOrganizationIds',
  hasAccessToMultipleCustomers: 'hasAccessToMultipleOrganizations',
  customersUserHasAccessTo: 'organizationsUserHasAccessTo',
  customer_headers: 'organization_headers',
  customer: 'organization',

  // EventActionType -> TimelineActionType
  EventActionType: 'TimelineActionType',
  event_action_type_id: 'timeline_action_type_id',
  event_action_type: 'timeline_action_type',

  // EventAction -> TimelineAction
  EventAction: 'TimelineAction',
  event_actions: 'timeline_actions',
  event_action: 'timeline_action',

  // EventStatus -> InspectionStatus
  EventStatus: 'InspectionStatus',
  event_status: 'inspection_status',
  event_status_id: 'inspection_status_id',

  // EventToken -> InspectionToken
  EventToken: 'InspectionToken',
  event_tokens: 'inspection_tokens',
  event_token: 'inspection_token',

  // EventType -> InspectionType
  EventType: 'InspectionType',
  event_types: 'inspection_types',
  event_type_id: 'inspection_type_id',
  event_type: 'inspection_type',
  'event-types': 'inspection-types',
  'event-type': 'inspection-type',
  eventTypeId: 'inspectionTypeId',

  // EventAlert -> InspectionAlertConfig
  EventAlert: 'InspectionAlertConfig',
  event_alerts: 'inspection_alert_configs',
  'event-alerts': 'inspection-alert-configs',
  event_alert_id: 'inspection_alert_config_id',
  event_alert: 'inspection_alert_config',

  // Event -> Inspection
  event_id: 'inspection_id',
  eventId: 'inspectionId',
  Event: 'Inspection',
  'by-event': 'by-inspection',
  event: 'inspection',

  // SdkTruepicPendingOperation -> TruepicPendingOperation
  SdkTruepicPendingOperation: 'TruepicPendingOperation',
  sdk_truepic_pending_operations: 'truepic_pending_operations',

  // SdkTruepicExtended -> TruepicExtended
  SdkTruepicExtended: 'TruepicExtended',
  sdk_truepics_extended: 'truepics_extended',

  // SdkTruepicLensId -> TruepicLensId
  SdkTruepicLensId: 'TruepicLensId',
  sdk_truepic_lens_id: 'truepic_lens_ids',

  // SdkTruepic -> Truepic
  SdkTruepic: 'Truepic',

  // Consumer -> customer
  consumer_name: 'customer_name',
  consumer_ip_address: 'customer_ip_address',
  consumer_first_name: 'customer_first_name',
  consumer_last_name: 'customer_last_name',
  consumer_phone_number: 'customer_phone_number',
  consumer_email_address: 'customer_email_address',
  consumer_token_status: 'customer_token_status',
  consumer_address_lat: 'customer_address_lat',
  consumer_address_lng: 'customer_address_lng',
  distance_from_consumer_address_threshold:
    'distance_from_customer_address_threshold',
    distance_from_consumer_address:
    'distance_from_customer_address',
    distance_from_consumer_address_exceeds_threshold:
    'distance_from_customer_address_exceeds_threshold',
  consumer_address: 'customer_address',
  consumer_unique_id_label: 'customer_unique_id_label',
  consumer_unique_id_2: 'customer_unique_id_2',
  consumer_unique_id: 'customer_unique_id',
  consumer_user_id: 'customer_user_id',
  isConsumer: 'isCustomer',
  consumer_support_number: 'customer_support_number',
  consumer_support_label: 'customer_support_label',
  consumer_item_label: 'customer_item_label',
  jwt_consumer_expiry: 'jwt_customer_expiry',
  consumer_note: 'customer_note',

  // agent -> member
  assigned_to_agent_user_id: 'assigned_to_member_user_id',
  created_by_agent_user_id: 'created_by_member_user_id',
  assigned_to_agent_user: 'assigned_to_member_user',
  created_by_agent_user: 'created_by_member_user',
  modified_by_agent_user_id: 'modified_by_member_user_id',
  assigned_to_agent: 'assigned_to_member',
  created_by_agent: 'created_by_member',
  agent_user_id: 'member_user_id',
  agent_user: 'member_user',
  isAgent: 'isMember',
  isAgentAdmin: 'isMemberAdmin',
  isAgentOwnInspections: 'isMemberOwnInspections',
  isAgentReport: 'isMemberReport',
  isGroupAgent: 'isGroupMember',
  agent: 'member',

  // Miscellaneous
  camera_enabled: 'video_enabled',
  subdomain: 'organization_slug',
  verification_results: 'test_results',
  verification_result: 'test_result',
  branch_link: 'inspection_link',
  device_results: 'device_integrity_results',
  device_result: 'device_integrity_result',
  geo_results: 'geolocation_results',
  geo_result: 'geolocation_result',
}

Webhooks

For developers that are using the Webhook functionality to receive Inspection updates, we have also implemented a V3 version so that you can receive the V3 terminology to your Webhook. Developers can have their Webhook switched over to the V3 format by contacting a Truepic administrator.

The following Action Names that have been updated in V3:

V2 Action Name (Old)V3 Action Name (New)
ACTION_EVENT_CLOSEDACTION_INSPECTION_CLOSED
ACTION_EVENT_CANCELEDACTION_INSPECTION_CANCELED

Booleans

In V2, about half of the boolean fields were created as small-ints (0 or 1). In V3, we transform all of these to actual booleans (true or false) when responses are sent. This is a list of those property names:

  'app_opened',
  'archived',
  'video_enabled',
  'include_list',
  'is_default',
  'is_deleted',
  'is_expired',
  'is_mfa_required',
  'is_required',
  'is_rooted',
  'lens_transfer_done',
  'notify_event_creator',
  'pending_upload',
  'response_low_entropy',
  'status_overridden',