Skip to main content

订阅端点

订阅端点和参数

要详细了解对象关系,请参阅 对象关系 部分。

如需详细了解订阅,请访问 订阅(工作室) 帮助页面。

创建新订阅

要创建新订阅,请使用 POST {baseURL}/v3/subscriptions 端点。

注意

此端点仅供管理员(Server 管理员)使用。

参数

contract (body):要创建新订阅,必须指定 contract 参数。请指定以下参数:

  • name (string):必填。输入新订阅的名称。

  • canShareSchedule (Boolean):必填。指定是否将为您要创建的订阅启用共享计划。

  • credentialId (string):必填。此参数是指凭证的唯一 ID,默认分配给用户。如果未指定,则默认值为 ""。

curl -X 'POST' \
  'http://localhost/webapi/v3/subscriptions' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer BearerTokenGoesHere' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "New Studio",
  "canShareSchedule": true,
  "credentialId": ""
}'
  • 200: OK

  • 201: Created

    {
      "name": "string",
      "apiKey": "string",
      "apiSecret": "string",
      "active": true,
      "expirationDate": "string",
      "expDate": "2024-09-19T13:13:44.245Z",
      "dateUpdated": "2024-09-19T13:13:44.245Z",
      "apiEnabled": true,
      "canShareSchedules": true,
      "credentialId": "string",
      "credentials": [
        {
          "credentialId": "string",
          "id": "string"
        }
      ],
      "dataConnections": [
        {
          "dataConnectionId": "string",
          "id": "string"
        }
      ],
      "id": "string"
    }
  • 400: BadRequest

  • 401: Unauthorized

  • 404: NotFound

检索所有订阅

要检索有关所有订阅的详细信息,请使用 GET {baseURL}/v3/subscriptions 端点。使用各种参数作为筛选条件来搜索订阅。

注意

此端点仅供管理员(Server 管理员)使用。

参数

  • name (string):可选。要搜索特定订阅,请输入该订阅的名称。

  • canShareSchedules (Boolean):可选。选择是否为您要搜索的订阅启用共享计划。

  • defaultWorkflowCredentialId (string):可选。输入您要搜索的订阅的默认工作流凭证 ID。

  • userCountGreaterThanEquals (int32):指定您要查找的订阅中应包含多少用户,大于或等于指定数字。

  • workflowCountGreaterThanEquals (int32):指定您要查找的订阅中应包含多少个工作流,大于或等于指定数字。

  • workflowCountLessThanEquals (int32):指定您要查找的订阅中应包含多少个工作流,小于或等于指定数字。

curl -X 'GET' \
  'http://localhost/webapi/v3/subscriptions?userCountGreaterThanEquals=1&workflowCountGreaterThanEquals=3' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer BearerTokenGoesHere'
  • 200: OK

    [
      {
        "userCount": 0,
        "workflowCount": 0,
        "id": "string",
        "name": "string",
        "credentialId": "string",
        "canShareSchedules": true
      }
    ]
  • 401: Unauthorized

搜索特定订阅

要搜索特定订阅,请使用 GET {baseURL}/v3/subscriptions/{subscriptionId} 端点。

注意

此端点仅供管理员(Server 管理员)使用。

参数

subscriptionsId (string):必填。输入订阅 ID 以检索有关此订阅的信息。

curl -X 'GET' \
  'http://localhost/webapi/v3/subscriptions/66ebd0896e52ae73b495106f' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer BearerTokenGoesHere'
  • 200: OK

      "users": [
        {
          "id": "string",
          "name": "string"
        }
      ],
      "workflows": [
        {
          "id": "string",
          "name": "string"
        }
      ],
      "id": "string",
      "name": "string",
      "credentialId": "string",
      "canShareSchedules": true
    }
  • 401: Unauthorized

  • 404: NotFound

更新现有订阅

要更新现有订阅,请使用 PUT {baseURL}/v3/subscription/{subscriptionId} 端点。

注意

此端点仅供管理员(Server 管理员)使用。

参数

  • subscriptionId (string):必填。输入订阅 ID 以更新此订阅。

  • subscription (body):必填。要更新订阅,必须指定 updateContract 参数。请指定以下参数:

    • name (string):必填。输入订阅的新名称。

    • credentialId (string):必填。此参数是指凭证的唯一 ID,默认分配给用户。如果未指定,则默认值为 ""。

    • canShareSchedules (Boolean):必填。指定是否将为您要更新的订阅启用共享计划。

curl -X 'PUT' \
  'http://localhost/webapi/v3/subscriptions/66ebd0896e52ae73b495106f' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer BearerTokenGoesHere' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "Doe'\''s Studio",
  "credentialId": "",
  "canShareSchedules": false
}'
  • 200: OK

    {
      "id": "string",
      "name": "string",
      "credentialId": "string",
      "canShareSchedules": true
    }
  • 400: BadRequest

  • 401: Unauthorized

  • 404: NotFound

删除订阅

要从系统中删除特定订阅,请使用 DELETE {baseURL}/v3/subscriptions 端点。

注意

此端点仅供管理员(Server 管理员)使用。

参数

subscriptionId (string):必填。输入要删除的订阅 ID。

curl -X 'DELETE' \
  'http://localhost/webapi/v3/subscriptions?subscriptionId=66ec22e86e52ae73b49510a1' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer BearerTokenGoesHere'
  • 200: OK

  • 400: BadRequest

  • 401: Unauthorized

  • 404: NotFound

更改用户的订阅

要将一个用户(或多个用户)从一个订阅转移到另一个订阅,请使用 PUT {baseURL}/v3/subscriptions/{subscriptionId}/users 端点。

注意

此端点仅供管理员(Server 管理员)使用。

参数

  • subscriptionId (string):必填。输入要将用户移动到的现有订阅 ID。

  • contract (body):

    • userIds (string):输入要移动到指定 subscriptionId 下的用户的 ID。

curl -X 'PUT' \
  'http://localhost/webapi/v3/subscriptions/66ffbb75125b93320a8bb5c7/users' \
  -H 'accept: application/json' \
  -H 'authorization: Bearer BearerTokenGoesHere' \
  -H 'Content-Type: application/json' \
  -d '{
  "userIds": [
    "66ffbb4b125b93320a8bb5bd"
  ]
}'
  • 200: OK

  • 400: BadRequest

  • 401: Unauthorized

  • 404: NotFound

对象关系

如果要 创建订阅,您可以按如下方式使用已创建的对象:

已创建的对象:“subscriptionId”(例如,“subscriptionId”:“619158e57e607d0011ac3009”)

您可以将其用作:

Postman 请求示例

GET {baseURL}/v3/subscriptions/{subscriptionId}

Postman_subscriptions_get2.png

GET {baseURL}/v3/subscriptions

Postman_subscriptions_get.png

如需详细了解有关 Postman 请求的更多信息,请访问 如何使用 Postman 帮助页面。