LogoLogo
What's NewDeveloper CommunitySupportStatus
  • 🚀Get Started
    • What is JourneyApps Platform?
    • Tutorial: Build your First App
      • 1. Introduction
      • 2. Create a new App
      • 3. OXIDE IDE Overview
      • 4. Hello World app
      • 5. The Data Model
      • 6. View Components
      • 7. Queries and Data Sync
      • 8. Simple Navigation
      • 9. View Stack
      • 10. Input Validation
      • 11. View Parameters
      • 12. Data Manipulation
      • 13. Responsive Apps
      • 14. Styling
      • 15. Lists
      • 16. GPS Capturing
      • 17. Relationships
      • 18. Multiple User Roles
      • 19. Deployment and Users
      • 20. Version Control
      • 21. CSV and APIs
      • 22. Conclusion
    • JourneyApps Platform Fundamentals
      • Creating a New App
        • Git-enabled Apps
      • What are Views?
      • What is the Data Model?
      • JourneyApps Syntax Basics
      • Access the Database (DB)
        • Manipulate DB Objects
        • Query DB Objects
      • View Navigation
        • Deep Linking
      • CloudCode Overview
      • OXIDE (Online IDE)
  • 💻Build your App
    • JourneyApps Syntax
      • Syntax Basics
      • Access the DB
      • View Navigation
      • Async & Await
      • TypeScript Apps (Beta)
        • runtime-build package
        • TypeScript App Troubleshooting
      • What's New in V4
        • Updating to the V4 API
    • Configure your Data Model
      • What is the data model?
      • Reference: model
        • field
        • belongs-to
        • has-many
        • index
      • Data Rules
        • Data Buckets
        • Sync Rules - Limit data synced to devices
        • Data ACLs - Limit access to data
        • Real-world example for Data Rules
        • ❔FAQs
        • Migrate to Data Rules
      • App Indexes
      • Webhooks
    • UI Components
      • All UI Components
        • actionSheet
        • Attachments
        • button
        • button-group
        • capture-coordinates
          • marker
          • marker-query
        • capture-file
        • capture-photo
        • capture-signature
        • card
          • accent
          • action
        • columns
          • column
        • component
        • context-menu
          • divider
          • item
        • CSV
        • date-input
        • datetime-input
        • dialog
          • body
        • display-3d-model
          • 📖display-3d-model Guides
            • Guide 1: Initialize and layout a 3D model in a view
            • Guide 2: Control playback position
            • Guide 3: Troubleshooting controls
        • display-coordinates
        • display-file
        • display-image
        • display-photo
        • display-signature
        • heading
        • html
          • HTML Advanced Topics
          • ❔HTML FAQs
          • 📖Guide: HTML & JourneyApps iFrame Client
        • icons
        • info
        • info-table
          • row
        • journey.photos (capture multiple photos)
        • JourneyPrinter (print PDFs)
        • grid
          • cell
          • 📖grid Examples
        • list
          • list-item
            • accent
            • asset
            • pills
              • pill
            • action
        • multiple-choice-checklist
        • navigation (Navigation drawer)
          • general-section
            • item
          • section
            • item
              • item
          • ❔navigation FAQs
        • notification
        • object-dropdown
        • object-list
          • action
        • object-repeat
        • object-table
          • action
          • column
            • action
            • edit-boolean
            • edit-date
            • edit-datetime
            • edit-integer
            • edit-number
            • edit-select
            • edit-text
            • edit-time
            • edit-typeahead
              • action
            • header-action
          • column-group
          • empty-action
          • 📖object-table Guides
            • Actions
            • Cell callouts
            • Column groups
            • Columns
            • Controlled object-table
            • Controls
            • Copy & paste data
            • Edit cells
            • Filters
            • Frozen columns
            • Fullscreen object-table
            • Mode
            • State
            • Styles
        • optionList
        • PhotonSync (transfer data offline)
        • power-bi
          • 📖Guide: PowerBI Embedding
        • scan-barcode
        • shortcut
        • sidebar
        • single-choice-dropdown
        • single-choice-radio
        • template
        • text-input
        • time-input
        • toggle
        • view
      • JS/TS Events
      • Show / Hide UI Components
      • View Templates
      • XML Fields (Attributes)
        • align-content
        • align-controls
        • align-label
        • bind
        • clear-button-visibility
        • control-order
        • disabled
        • error-message
        • icon-position
        • id
        • hide-if
        • modifier-text
        • label
        • label-case
        • label-color
        • on-change
        • on-press
        • placeholder
        • required
        • show-if
    • JS / TS APIs
      • Attachment
      • Bluetooth (Beta)
      • Broadcast
      • component
      • CSV
      • DB
      • HardwareBarcode
      • journey
        • journey.config
        • journey.container
        • journey.device
        • journey.diagnostics
        • journey.dialog
        • journey.files
        • journey.hardware
        • journey.photos
        • journey.runtime
        • journey.sensors
        • journey.viewStack
      • JourneyPrinter
      • KeyboardBarcode
      • LocalDB
      • NFC
      • OnlineDB
      • PhotonSync
      • SerialPort
      • ShortcutManager
      • TCPSocket
      • user
    • Extend your App with Custom Code
      • App packages
        • App packages overview
        • PDF report package
        • TypeScript library & unit tests
        • Manage External Dependencies
      • Custom HTML
    • Style & Customize your App
      • Style & configure UI components
        • Overview
        • Understand extendable themes
        • Use themes on a view
        • Theme specific components on a view
        • Examples
        • Debugging
        • ❔FAQs
      • Change your App Font
      • Custom Branding
        • Custom Container Features
        • Special Requirements for iOS Containers
    • Integrate your App
      • Backend integrations with CloudCode
      • Barcode Scanning
        • Barcode Scanning using Keyboard Emulation
        • Hardware Barcode Scanning
        • scan-barcode
      • Bluetooth Low Energy (BLE)
      • Broadcast API
      • HTTP requests (Fetch API)
      • JourneyApps Print (Android)
      • Maps and navigation
      • NFC
      • Opening external links/apps
      • Serial Port
      • TCP Sockets
    • Design Intuitive Apps
      • UX Guidelines
      • Write Effective Copy
  • 📱App Features
    • RealWear® Voice Control
      • Automatic Voice Commands
        • Automatic Voice Commands - Advanced
      • Manual Voice Commands
    • App, Runtime and Container Updates
    • Batch Operations (App)
    • Call JS/TS Functions from XML
    • Capture GPS Locations
    • Push Notifications
    • Translations
    • XML Format Strings
    • Webhooks (External)
  • 🌐CloudCode
    • CloudCode Overview
    • Trigger a CloudCode Task
      • Trigger CC with a Schedule
      • Trigger CC via a Webhook
      • Trigger CC from an App
      • Trigger CC from Another Task
      • Trigger CC via HTTP
    • Attachments in CloudCode
    • Timezones
    • Advanced CloudCode Topics
      • Access Multiple DBs in CloudCode Tasks
      • Batch API (CloudCode)
      • CloudCode Dependencies
      • Configure HTTPS in CloudCode
      • Deployment environment variables
      • Local CloudCode Development
      • PDF Reports using CloudCode
      • Shared CloudCode Tasks
      • Translations in CloudCode
  • 📥Backend API
    • Introduction
    • API Reference
      • Retrieve All Objects
      • Query Objects
      • Sort Results
      • Limit and Skip
      • Count Objects
      • Create a New Object
      • Retrieve a Single Object
      • Update a Single Object
      • Delete a Single Object
      • Batch Operations (v4 API)
      • Oplog API
      • Retrieve the App Data Model
      • Manage App Users and Sessions
      • Field Representation
      • Error Responses
    • API Limits
    • Update to the V4 API
  • ⚙️Technical
    • Data Synchronization Priority
    • Device Diagnostics
    • JSON1 Query Engine
    • Improve App Performance
    • Security Measures
    • Supported Platforms
      • Web Container
      • Windows Installer
    • Domain Whitelist
  • 🖥️OXIDE
    • Get started with OXIDE
      • OXIDE Overview
      • Components of OXIDE
    • Configure Testing Deployments
    • Edit and Manage Files
      • How to Navigate to a Function
      • Manage External Dependencies
    • Create and Manage App Containers
    • Debugging & Troubleshooting
      • Common Troubleshooting Pointers
      • App Diagnostics Reports
      • Build Logs
    • OXIDE Workspaces
      • OXIDE Trees
  • ❕Deprecated Features
    • Deprecated Features and Components
Powered by GitBook
On this page
  • 1. API URL Path Changes
  • 2. Response Data Format for Retrieving Multiple Objects
  • 3. Partial Updates to Objects Should Now Use PATCH Method
  • 4. PUT Method Will Replace Object Completely
  • 5. Updated Field Representation for Choice Data Types
  • 6. Changes to Photos and Signatures Response Data Format
  • 7. New Data Model Naming Conventions
  • 8. JSON Response Format Supported Only
  • 9. Structured Error Responses
  1. Build your App
  2. JourneyApps Syntax
  3. What's New in V4

Updating to the V4 API

1. API URL Path Changes

Base path now includes App Instance ID The 'base path' for API v4 now includes the App Instance ID (the same as the API username used in authentication).

Base path in API v1:
Base path in API v4:

/api/v1/

/api/v4/backend-deployment-id/

Use '/objects' to access objects Accessing objects is now namespaced under '/objects' in the URL:

Accessing objects in API v1:
Accessing objects in API v4:

/api/v1/object-name.json

/api/v4/backend-deployment-id/objects/object-name.json

Changes to 'datamodel' and 'oplog'

The 'datamodel' and 'oplog' API functions no longer have underscores in their names:

Getting the Data Model in API v1:
Getting the Data Model in API v4:

/api/v1/_datamodel.json

/api/v4/backend-deployment-id/datamodel.json

Accessing the Oplog in API v1:
Accessing the Oplog in API v4:

/api/v1/_oplog.json

/api/v4/backend-deployment-id/oplog.json

2. Response Data Format for Retrieving Multiple Objects

When retrieving multiple objects, the structure of the JSON data returned now namespaces objects underneath an 'objects' key, and metadata such as 'count' of the number of objects in the response, as well as the total number of objects in the collection is also returned:

{
  "objects": [
    {
      "updated_at": "2012-08-29T06:46:10Z",
      "name": "Lena Deberon",
      "id": "9a700bdc-f115-11e1-bac8-001cc01904e3",
      "display": "Lena Deberon"
    },
    {
      "updated_at": "2012-08-29T06:46:17Z",
      "name": "Sara Heandy",
      "id": "3c2db07a-f1a5-11e1-a7df-001cc01904e3",
      "display": "Sara Heandy"
    }
  ],
  "count": 2,
  "total": 2,
  "more": false
}
[
  {
    "_updated_at": "2012-08-29T06:46:10Z",
    "name": "Lena Deberon",
    "id": "9a700bdc-f115-11e1-bac8-001cc01904e3",
    "display_name": "Lena Deberon",
    "display_attachments": {
    }
  },
  {
    "_updated_at": "2012-08-29T06:46:17Z",
    "name": "Sara Heandy",
    "id": "3c2db07a-f1a5-11e1-a7df-001cc01904e3",
    "display_name": "Sara Heandy",
    "display_attachments": {
    }
  }
]

3. Partial Updates to Objects Should Now Use PATCH Method

In API v1, using the PUT HTTP request method would perform a partial update on an object (e.g. only updating a selected set of the object's fields). In API v4, PATCH must now be used for partial updates.

Failure to change the HTTP request method for partial updates to PATCH will result in data loss!

Partial update to an object in API v1:

PUT https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/tasks/198c990e-f1bf-11e1-8d7d-001cc01904e3.json

task[status]=1
curl "https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/tasks/198c990e-f1bf-11e1-8d7d-001cc01904e3.json" \
    -u "533bda53027894f69b001055:7Ajj5htRY1uzw7b4w23V" \
    -X PUT \
    -d "task[status]=1"
require 'rest-client'
journey = RestClient::Resource.new "https://run-testing-us.journeyapps.com/api/v4", "533bda53027894f69b001055", "7Ajj5htRY1uzw7b4w23V"
journey["533bda53027894f69b001055/tasks/198c990e-f1bf-11e1-8d7d-001cc01904e3.json"].put :task=>{:status=>1}

Partial update to an object in API v4:

PATCH https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/objects/tasks/198c990e-f1bf-11e1-8d7d-001cc01904e3.json

task[status]=1
curl "https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/objects/tasks/198c990e-f1bf-11e1-8d7d-001cc01904e3.json" \
    -u "533bda53027894f69b001055:7Ajj5htRY1uzw7b4w23V" \
    -X PATCH \
shell    -d "task[status]=1"
require 'rest-client'
journey = RestClient::Resource.new "https://run-testing-us.journeyapps.com/api/v4", "533bda53027894f69b001055", "7Ajj5htRY1uzw7b4w23V"
journey["533bda53027894f69b001055/objects/tasks/198c990e-f1bf-11e1-8d7d-001cc01904e3.json"].patch :task=>{:status=>1}

4. PUT Method Will Replace Object Completely

Whereas in API v1, using the PUT HTTP request method will perform a partial update on an object, in API v4, the PUT method will replace the object completely. In other words, fields that are not present (in the object payload provided) will be cleared.

Replace object in API v1:

Not supported in API v1.

Replace object in API v4:

PUT https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/objects/tasks/198c990e-f1bf-11e1-8d7d-001cc01904e3.json

task[status]=1
curl "https://run-testing-us.journeyapps.com/api/v4/533bda53027894f69b001055/objects/tasks/198c990e-f1bf-11e1-8d7d-001cc01904e3.json" \
    -u "533bda53027894f69b001055:7Ajj5htRY1uzw7b4w23V" \
    -X PUT \
    -d "task[status]=1"
require 'rest-client'
journey = RestClient::Resource.new "https://run-testing-us.journeyapps.com/api/v4", "533bda53027894f69b001055", "7Ajj5htRY1uzw7b4w23V"
journey["533bda53027894f69b001055/objects/tasks/198c990e-f1bf-11e1-8d7d-001cc01904e3.json"].put :task=>{:status=>1}

5. Updated Field Representation for Choice Data Types

"Choice" data types, i.e. single-choice, single-choice-integer, multiple-choice and multiple-choice-integer now return now the value/key and the display name of the selected option(s):

'single-choice-integer' representation in API v1:
'single-choice-integer' representation in API v4:

"status": 1

"status": {"key": 1,"display": "Closed"}

6. Changes to Photos and Signatures Response Data Format

In API v4, the response data format for photos and signatures include various changes:

  • Photos and signatures are no longer included in a separate display_attachments field — they are now directly part of the object's fields in the response data.

  • URLs for photos and attachments are now absolute URLs, no longer relative URLs

  • A state field now indicates the availability of the image — pending or uploaded.

{
  "id": "c3d59ff0-ba4a-11e3-a567-001e6733fe3c",
  "type": "task",
  "updated_at": "2015-02-05T08:17:58Z",
  "display": "Buy Groceries",
  "name": "Buy Groceries",
  "photo": {
    "id": "eacb4836-f1b9-11e1-9750-001cc01904e3",
    "state": "uploaded",
    "thumbnail": "https://run.journeyapps.com/media/AwNDkyOSJdLFsicCIsI?sha1=12345",
    "fullscreen": "https://run.journeyapps.com/media/3JlZW4iXV0W1siZiIs?sha1=12345",
    "original": "https://run.journeyapps.com/media/SJdLFsicCIsW1siZiIs?sha1=12345"
  }
}
{
  "id": "c3d59ff0-ba4a-11e3-a567-001e6733fe3c",  
  "type": "task",  
  "updated_at": "2015-02-05T08:17:58Z",  
  "display": "Buy Groceries",  
  "name": "Buy Groceries",  
  "display_attachments": {  
    "photo": {  
      "thumbnail": "/media/AwNDkyOSJdLFsicCIsI?sha1=12345",  
      "fullscreen": "/media/3JlZW4iXV0W1siZiIs?sha1=12345",  
      "original": "/media/SJdLFsicCIsW1siZiIs?sha1=12345"  
    }  
  }  
}  

7. New Data Model Naming Conventions

{
  "models": {
    "user": {
      "name": "user",
      "label": "User",
      "display": "{name}",
      "fields": {
        "name": {
          "name": "name",
          "label": "Name",
          "type": "text",
          "subtype": "name"
        }
      },
      "belongs_to": {
      },
      "has_many": {
      }
    },
    "category": {
      "name": "category",
      "label": "Category",
      "display": "{name}",
      "fields": {
        "name": {
          "name": "name",
          "label": "Name",
          "type": "text"
        }
      },
      "belongs_to": {
      },
      "has_many": {
        "tasks": {
          "model": "task",
          "name": "tasks",
          "inverse_of": "category"
        }
      }
    },
    "task": {
      "name": "task",
      "label": "Task",
      "display": "{name}",
      "fields": {
        "name": {
          "name": "name",
          "label": "Name",
          "type": "text"
        },
        "instructions": {
          "name": "instructions",
          "label": "Instructions",
          "type": "text"
        },
        "status": {
          "name": "status",
          "label": "Status",
          "type": "single-choice-integer",
          "options": [
            {
              "key": 0,
              "display": "Open"
            },
            {
              "key": 1,
              "display": "Closed"
            }
          ]
        }
      },
      "belongs_to": {
        "category": {
          "model": "category",
          "name": "category",
          "inverse_of": "tasks"
        }
      },
      "has_many": {
      }
    }
  }
}
{
  "objects":{
    "user":{
      "has_many":{

      },
      "belongs_to":{

      },
      "name":"user",
      "label":"User",
      "attributes":{
        "name":{
          "name":"name",
          "label":"Name",
          "type":"string",
          "spec":"text.name"
        }
      },
      "display_format":"{name}"
    },
    "category":{
      "has_many":{
        "tasks":{
          "type":"task",
          "inverse_of":"category",
          "name":"tasks"
        }
      },
      "belongs_to":{

      },
      "name":"category",
      "label":"Category",
      "attributes":{
        "name":{
          "name":"name",
          "label":"Name",
          "type":"string"
        }
      },
      "display_format":"{name}"
    },
    "task":{
      "has_many":{

      },
      "belongs_to":{
        "category":{
          "type":"category"
        }
      },
      "name":"task",
      "label":"Task",
      "attributes":{
        "name":{
          "name":"name",
          "label":"Name",
          "type":"string"
        },
        "instructions":{
          "name":"instructions",
          "label":"Instructions",
          "type":"string"
        },
        "status":{
          "name":"status",
          "label":"Status",
          "type":"enum",
          "options":[
            "Open",
            "Closed"
          ]
        }
      },
      "display_format":"{name}"
    }
  }
}

8. JSON Response Format Supported Only

Whereas API v1 supports XML and JSON response formats, API v4 only supports JSON.

9. Structured Error Responses

{
  "type": "INVALID_VALUE",
  "title": "Invalid value specified.",
  "detail": "Invalid option \"test\" for field 'status'.",
  "see": "https://resources.journeyapps.com/v4/api/errors/INVALID_VALUE"
}
{
  "errors": [
    "Invalid object type: 'car'"
  ]
}
PreviousWhat's New in V4NextConfigure your Data Model

Last updated 2 years ago

Refer to for more details.

Take note that the are reflected when retrieving an app's Data Model.

API error responses in API v4 are now more structured, with specific :

💻
Field Representation
error types
Changes in Naming in JourneyApps v4