Enrollmenttokens: create

สร้างโทเค็นการลงทะเบียนสำหรับองค์กร เมธอดนี้เป็นส่วนหนึ่งของ EnrollmentTokensService

ส่งคำขอ

คำขอ HTTP

POST https://www.googleapis.com/androidenterprise/v1/enterprises/enterpriseId/enrollmentTokens

พารามิเตอร์

ชื่อพารามิเตอร์ ค่า คำอธิบาย
พารามิเตอร์เส้นทาง
enterpriseId string รหัสขององค์กร

การให้สิทธิ์

คำขอนี้ต้องมีการให้สิทธิ์ที่มีขอบเขตต่อไปนี้

ขอบเขต
https://www.googleapis.com/auth/androidenterprise

ดูข้อมูลเพิ่มเติมได้ที่หน้าการตรวจสอบสิทธิ์และการให้สิทธิ์

เนื้อความของคำขอ

ในเนื้อหาคำขอ ให้ระบุข้อมูลที่มีโครงสร้างดังต่อไปนี้

{
  "kind": "androidenterprise#enrollmentToken",
  "token": string,
  "enrollmentTokenType": string,
  "duration": {
    "seconds": long,
    "nanos": integer
  },
  "googleAuthenticationOptions": {
    "authenticationRequirement": string,
    "requiredAccountEmail": string
  }
}
ชื่อพร็อพเพอร์ตี้ ค่า คำอธิบาย หมายเหตุ
kind string
token string ค่าโทเค็นที่ส่งไปยังอุปกรณ์และให้สิทธิ์อุปกรณ์ในการลงทะเบียน ช่องนี้เป็นแบบอ่านอย่างเดียวที่เซิร์ฟเวอร์สร้างขึ้น
enrollmentTokenType string [ต้องระบุ] ประเภทของโทเค็นการลงทะเบียน

ค่าที่ยอมรับมีดังนี้
  • "enrollmentTokenTypeUnspecified"
  • "userDevice"
  • "userlessDevice"
duration nested object [ไม่บังคับ] ระยะเวลาที่โทเค็นการลงทะเบียนใช้งานได้ โดยมีตั้งแต่ 1 นาทีจนถึง Durations.MAX_VALUE ซึ่งประมาณ 10,000 ปี หากไม่ได้ระบุไว้ ระยะเวลาเริ่มต้นคือ 1 ชั่วโมง
duration.seconds long วินาทีที่ลงชื่อของช่วงเวลา
googleAuthenticationOptions nested object [ไม่บังคับ] ระบุตัวเลือกที่เกี่ยวข้องกับการตรวจสอบสิทธิ์ของ Google ระหว่างการลงทะเบียน
googleAuthenticationOptions.authenticationRequirement string [ไม่บังคับ] ระบุว่าผู้ใช้ควรตรวจสอบสิทธิ์กับ Google ในระหว่างการลงทะเบียนหรือไม่ หากระบุไว้ จะลบล้าง GoogleAuthenticationSettings สำหรับทรัพยากรขององค์กรเมื่อลงทะเบียนอุปกรณ์ด้วยโทเค็นนี้

ค่าที่ยอมรับมีดังนี้
  • "authenticationRequirementUnspecified"
  • "optional"
  • "required"
googleAuthenticationOptions.requiredAccountEmail string [ไม่บังคับ] ระบุบัญชี Google ที่มีการจัดการซึ่งผู้ใช้ต้องใช้ในระหว่างการลงทะเบียน ต้องตั้งค่า AuthenticationRequirement เป็น REQUIRED หากตั้งค่าช่องนี้

การตอบกลับ

หากทำสำเร็จ เมธอดนี้จะแสดงเนื้อหาการตอบกลับที่มีโครงสร้างดังต่อไปนี้

{
  "kind": "androidenterprise#enrollmentToken",
  "token": string,
  "enrollmentTokenType": string,
  "duration": {
    "seconds": long,
    "nanos": integer
  },
  "googleAuthenticationOptions": {
    "authenticationRequirement": string,
    "requiredAccountEmail": string
  }
}
ชื่อพร็อพเพอร์ตี้ ค่า คำอธิบาย หมายเหตุ
kind string
token string ค่าโทเค็นที่ส่งไปยังอุปกรณ์และให้สิทธิ์อุปกรณ์ในการลงทะเบียน ช่องนี้เป็นแบบอ่านอย่างเดียวที่เซิร์ฟเวอร์สร้างขึ้น
enrollmentTokenType string [ต้องระบุ] ประเภทของโทเค็นการลงทะเบียน

ค่าที่ยอมรับมีดังนี้
  • "enrollmentTokenTypeUnspecified"
  • "userDevice"
  • "userlessDevice"
duration nested object [ไม่บังคับ] ระยะเวลาที่โทเค็นการลงทะเบียนใช้งานได้ โดยมีตั้งแต่ 1 นาทีจนถึง Durations.MAX_VALUE ซึ่งประมาณ 10,000 ปี หากไม่ได้ระบุไว้ ระยะเวลาเริ่มต้นคือ 1 ชั่วโมง
duration.seconds long วินาทีที่ลงชื่อของช่วงเวลา
googleAuthenticationOptions nested object [ไม่บังคับ] ระบุตัวเลือกที่เกี่ยวข้องกับการตรวจสอบสิทธิ์ของ Google ระหว่างการลงทะเบียน
googleAuthenticationOptions.authenticationRequirement string [ไม่บังคับ] ระบุว่าผู้ใช้ควรตรวจสอบสิทธิ์กับ Google ในระหว่างการลงทะเบียนหรือไม่ หากมีการระบุการตั้งค่านี้ GoogleAuthenticationSettings specified for the enterprise resource is ignored for devices enrolled with this token.

ค่าที่ยอมรับมีดังนี้
  • "authenticationRequirementUnspecified"
  • "optional"
  • "required"
googleAuthenticationOptions.requiredAccountEmail string [ไม่บังคับ] ระบุบัญชี Google ที่มีการจัดการซึ่งผู้ใช้ต้องใช้ในระหว่างการลงทะเบียนAuthenticationRequirement ต้องตั้งค่าเป็นREQUIRED if this field is set.