简体   繁体   English

使用Android管理API创建企业时如何获取enterpriseToken?

[英]How to get the enterpriseToken when creating an enterprise with the Android Management API?

I'm trying to create a new enterprise using api method.我正在尝试使用 api 方法创建一个新企业。 First I maked signupUrls.create with request parameters projectId and callbackUrl .首先,我使用请求参数projectIdcallbackUrl创建了signupUrls.create In field callbackUrl , I put my Google Cloud platform admin url.在字段callbackUrl中,我输入了我的 Google Cloud 平台管理员 url。 And I got a response我得到了回应

{
  "name": "signupUrls/C78787fa85be23de9f",
  "url": "https://play.google.com/work/adminsignup?token=SAEQ6V4kHngQPk5wCSl37KkZPlfw-wJtlVHndDfsmH1R1twiXM1LC6FpYFSndpEaw2mbsmqd3T5eBaRWtQPrVClngJHZcKaGc0V_4dOhz-F8D0vSjb_1MnxRheUP0Ij8el6zNE5GYYA1LOECCUFLip8kcg6e99_3DfNbmutqHONjhdi8hQBQUa0Q5nWN-nMRF3EUgffvLk1zo4BAA0AUscQ"
}

The next point is method: enterprises.create with projectId , signupUrlName and enterpriseToken parameters.下一点是方法: enterprise.create带有projectIdsignupUrlNameenterpriseToken参数。

And then I send request I get erorr:然后我发送请求我得到错误:

"message": "The enterprise token is invalid: SAEQ6V4kHngQPk5wCSl37KkZPlfw-wJtlVHndDfsmH1R1twiXM1LC6FpYFSndpEaw2mbsmqd3T5eBaRWtQPrVClngJHZcKaGc0V_4dOhz-F8D0vSjb_1MnxRheUP0Ij8eCUFLip8kcg6e99_3DfNbmutqHONjhdi8hQBQUa0Q5nWN-nMRF3EUgffBWwGHSA8AkFWvLk1zo4BAA0AUscQ",
    "status": "INVALID_ARGUMENT"

In the field enterpriseToken I put token values from signupUrls.create url response.在字段enterpriseToken中,我输入了来自signupUrls.create url 响应的令牌值。

To obtain the enterpriseToken you (or your customer) need to go through the enterprise sign-up flow by visiting the url returned by signupUrls.create , which looks like https://play.google.com/work/adminsignup?token=... (the token in this URL is not the enterpriseToken ).为了获得enterpriseToken您(或您的客户)需要通过访问要经过企业申请流程中url由归国signupUrls.create ,它看起来像https://play.google.com/work/adminsignup?token=... (此 URL 中的令牌不是enterpriseToken )。

Upon completing the sign-up flow you will be redirected to the callbackUrl passed in signupUrls.create , with the enterpriseToken appended as a parameter.在完成注册流程,你会被重定向到callbackUrl传入signupUrls.create ,与enterpriseToken附加作为参数。 So if you set the callbackUrl to https://example.com/mycallback you will be redirected to a URL like https://example.com/mycallback?enterpriseToken=... .因此,如果您将callbackUrl设置为https://example.com/mycallback您将被重定向到类似https://example.com/mycallback?enterpriseToken=...的 URL。

You then need to extract the enterpriseToken and pass it to enterprises.create .然后,您需要提取enterpriseToken并将其传递给enterprises.create

So if you create the enterprise yourself you can set any callbackUrl , even an invalid one, and just copy the enterpriseToken manually.因此,如果您自己创建企业,您可以设置任何callbackUrl ,甚至是无效的,只需手动复制enterpriseToken令牌。 However if you want your customer to create the enterprise then the callbackUrl should point to your server so you can retrieve the enterpriseToken , you may also want to pass an additional token in the callbackUrl so you can identify your customer.但是,如果您希望您的客户创建企业,则callbackUrl应指向您的服务器,以便您可以检索enterpriseToken ,您可能还希望在callbackUrl传递一个额外的令牌,以便您可以识别您的客户。

More details in the guide for creating an enterprise .更多详细信息,请参阅创建企业指南。

https://play.google.com/work/adminsignup?token=.. 
how can we call through code using javascript

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 企业应用程序的托管配置(Android 管理 API) - Managed Configurations for an enterprise app (Android Management API) Android 管理 API - 调用者无权管理企业 - Android Management API - Caller is not authorized to manage enterprise 无论如何要通过android管理API来获得特定企业的批准申请细节? - Is anyway to get approved application details for a specific enterprise through android management API? Android管理api EMM中来自企业的域和域用户 - Domain and domain user from the enterprise in Android management api EMM 如何通过 Android Management API 获取设备内存 - How to get device memory via Android Management API 如何从企业 android 管理中删除所有设备? - How to remove all devices from enterprise android management? 如何获取使用 Android 管理 API 的设备 ID? - How to get Device id for using Android Management API? 如何使用android管理API获取设备的Location信息 - How to get the Location information of a device using android management API 如何通过企业移动性管理工具远程配置企业Android应用程序? - How to remotely configure an enterprise Android app via an Enterprise Mobility Management tool? 如何在 Android Management API 中使用“disabledReason”? - How to use "disabledReason" in Android Management API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM