【问题标题】:Azure DevOps RestAPI to change the User Access LevelAzure DevOps Rest API 更改用户访问级别
【发布时间】:2021-08-05 15:54:18
【问题描述】:

我正在使用 Azure DevOps RestAPI 自动将用户的访问级别从 Basic 更新为涉众。

我已尝试按照 documentation 遵循 Rest API,但收到错误请求。

https://vsaex.dev.azure.com/xxxxxxxx/_apis/userentitlements/d42xxxx-xxxxxxxx-xxxxxx-xxxxxxxxxx?api-version=6.0-preview.3

输入Json:

{
    "from": "",
    "op": "replace",
    "path": "/accessLevel",
    "value": {
      "accountLicenseType": "stakeholder",
      "licensingSource": "account"
    }
  }

【问题讨论】:

    标签: azure azure-devops azure-devops-rest-api rest


    【解决方案1】:

    据我所知,您发送的请求的主体是 JSON 对象,但 example in the documentation 将主体指定为 JSON数组。不确定这是否是严格要求,但请尝试将 body 包裹到 [] 中。

    【讨论】:

      【解决方案2】:

      请使用以下应该按预期工作的主体。

      [
          {
              "from":"",
              "op":"replace",
              "path":"/accessLevel",
              "value":{
                  "accountLicenseType":"stakeholder",
                  "licensingSource":"account"
              }
          }
      ]
      

      有关详细信息,请参阅:Examples。

      【讨论】:

        猜你喜欢
        • 2021-08-04
        • 1970-01-01
        • 2019-11-27
        • 1970-01-01
        • 2019-10-24
        • 1970-01-01
        • 2020-04-23
        • 2020-06-12
        • 2020-01-08
        相关资源
        最近更新 更多