We are trying to setup a mobileDevicePreStage using REST API but I am having the following issue:
We fist get the site, dep program.
We do not want to setup any locationInformation or purchasingInformation as when we create it from the web console.
But it always tells us we are missing some locationInformation & purchasingInformation properties we do not know were we must fetch them from:
message: '400 - {"httpStatus":400,"errors":[{"code":"FIELD_REQUIRED","description":"field is required","id":0,"field":"purchasingInformation.versionLock"},{"code":"FIELD_REQUIRED","description":"field is required","id":0,"field":"locationInformation.versionLock"},{"code":"FIELD_REQUIRED","description":"field is required","id":0,"field":"locationInformation.id"},{"code":"FIELD_REQUIRED","description":"field is required","id":0,"field":"purchasingInformation.id"}]}
When creating the preStage using web console seems the create some new location & purchasing info with empty data. This is the output of a GET /uapi/v1//v1/mobile-device-prestages/6
{ enrollmentSiteId: 1, id: 6, displayName: 'hmsch', supportPhoneNumber: '', supportEmailAddress: '', department: '', authenticationPrompt: '', profileUUID: '', deviceEnrollmentProgramInstanceId: 1, versionLock: 1, skipSetupItems: { Biometric: true, SoftwareUpdate: true, Diagnostics: true, iMessageAndFaceTime: true, TVRoom: true, Passcode: true, SIMSetup: true, ScreenTime: true, TVProviderSignIn: true, Siri: true, Restore: true, ScreenSaver: true, HomeButtonSensitivity: true, CloudStorage: true, Privacy: true, Zoom: true, TVHomeScreenSync: true, AppleID: true, DisplayTone: true, WatchMigration: true, Android: true, Payment: true, OnBoarding: true, TOS: true, TapToSetup: true, Location: false }, locationInformation: { username: '', realname: '', phone: '', email: '', room: '', position: '', departmentId: -1, buildingId: -1, id: 4, versionLock: 0 }, purchasingInformation: { id: 4, isLeased: false, isPurchased: true, appleCareID: '', poNumber: '', vendor: '', purchasePrice: '', lifeExpectancy: 0, purchasingAccount: '', purchasingContact: '', leaseDate: '1970-01-01', poDate: '1970-01-01', warrantyDate: '1970-01-01', versionLock: 0 }, anchorCertificates: [], maximumSharedAccounts: 10, language: 'es', region: 'ES', siteId: 1, names: { assignNamesUsing: 'Default Names', prestageDeviceNames: [], deviceNamePrefix: '', deviceNameSuffix: '', isManageNames: false, isDeviceNamingConfigured: false }, isAutoAdvanceSetup: true, isEnableDeviceBasedActivationLock: false, isPreventActivationLock: true, isConfigureDeviceBeforeSetupAssistant: true, isAllowPairing: true, isSupervised: true, isMultiUser: false, isKeepExistingSiteMembership: false, isMdmRemovable: false, isMandatory: true, isRequireAuthentication: false, isKeepExistingLocationInformation: false, isDefaultPrestage: false }