0

我有一组用户想要订阅通过门户提供的相同通知。但是,当我自动创建/管理这些用户时,我还想自动订阅这些通知。

我已经查看了 API 文档,搜索了任何示例/教程,但我仍然没有运气弄清楚如何实现这一点。

任何线索或例子都会很棒。

4

1 回答 1

0

要添加权限,请执行以下请求:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_User_Customer/[user_id]/addBulkPortalPermission

方法: POST

Json(有效负载):

{
  "parameters": [
    [
      {
        "keyName": "NTF_SUBSCRIBER_MANAGE"
      }
    ]
  ]
}

要获取用户权限,请执行:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_User_Customer/[ User_Customer_ID]/getPermissions

参考: http ://sldn.softlayer.com/reference/services/SoftLayer_User_Customer

编辑:

按照以下步骤为客户用户订阅通知:

示例:添加“PLANNED_MAINTENANCE”通知订阅。

1.为用户创建通知订阅记录,使用:SoftLayer_User_Customer::addNotificationSubscriber

网址:

https://[username:[apikey]@api.softlayer.com/rest/v3/SoftLayer_User_Customer/[user_customer_id]/addNotificationSubscriber

方法: POST

Json(有效负载):

{
  "parameters": [
    " PLANNED_MAINTENANCE"
  ]
}

参考:

http://sldn.softlayer.com/reference/services/SoftLayer_User_Customer/addNotificationSubscriber

2.为用户订阅的通知创建传递方法 (SoftLayer_User_Customer::createSubscriberDeliveryMethods)。

网址:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_User_Customer/[user_customer_id]/createSubscriberDeliveryMethods

方法: POST

Json(有效负载):

{
  "parameters": [
    "PLANNED_MAINTENANCE",
    [
       "EMAIL"

    ]
  ]
}

要获取有关“notificationKeyName”和“deliveryMethodKeyNames”的信息,请执行:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getActiveNotificationSubscribers?objectMask=mask[id, notification, active,deliveryMethods[notificationDeliveryMethod[active,keyName],notificationSubscriber]]

参考:

http://sldn.softlayer.com/reference/services/SoftLayer_User_Customer/createSubscriberDeliveryMethods
于 2015-10-05T13:17:34.917 回答