0

当我发送GET https://api.softlayer.com/rest/v3/SoftLayer_Account返回我的 SoftLayer_Account 数据时:

<root>
  <accountManagedResourcesFlag/>
  <accountStatusId></accountStatusId>
  <address1></address1>
  <address2></address2>
  <allowedPptpVpnQuantity></allowedPptpVpnQuantity>
  <city></city>
  <claimedTaxExemptTxFlag/>
  <companyName></companyName>
  <country></country>
  <createDate></createDate>
  <email></email>
  <firstName></firstName>
  <id></id>
  <isReseller></isReseller>
  <lastName></lastName>
  <lateFeeProtectionFlag/>
  <modifyDate></modifyDate>
  <officePhone></officePhone>
  <postalCode></postalCode>
  <state></state>
  <statusDate/>
</root>

有什么方法可以使用 API 更改我的帐户资料?

通过 control.softlayer.com,我可以发送一种“更改配置文件请求”,有没有办法通过 API 发送此请求(并在请求被批准/拒绝时跟进)?

我已经尝试找到解决方案:

  1. 在http://sldn.softlayer.com/reference/services/SoftLayer_Account上查找了一些相关方法,没有找到。

  2. 我试图用这些数据获取一些对象,所以我可以看到对象类型并进行操作

    • #getAddresses
    • #getActiveAddresses

但没有人返回我可以操作的对象(调用方法)

  1. 是否有http://sldn.softlayer.com/reference/services/SoftLayer_Account_Address但似乎我需要创建一个,我想要的是更改现有数据

#getAddresses(我真的认为如果帐户上的数据链接到该地址,则应该返回该地址)

谢谢

4

1 回答 1

1

要更新Account profile,我们需要创建一个 Request Profile Update 使用SoftLayer_Ticket::createAdministrativeTicket

看:

http://sldn.softlayer.com/reference/services/SoftLayer_Ticket/createAdministrativeTicket

SOAP 示例:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v3="http://api.service.softlayer.com/soap/v3/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Header>
      <SoftLayer_ObjectMask xsi:type="v3:SoftLayer_ObjectMask">
         <mask xsi:type="xsd:string">1</mask>
      </SoftLayer_ObjectMask>
      <SoftLayer_TicketObjectMask xsi:type="v3:SoftLayer_TicketObjectMask">
         <mask xsi:type="v3:SoftLayer_Ticket" />
      </SoftLayer_TicketObjectMask>
      <authenticate xsi:type="v3:authenticate">
         <username xsi:type="xsd:string">?</username>
         <apiKey xsi:type="xsd:string">?</apiKey>
      </authenticate>
   </soapenv:Header>
   <soapenv:Body>
      <v3:createAdministrativeTicket soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <templateObject xsi:type="v3:SoftLayer_Ticket">
            <assignedUserId xsi:type="xsd:int">12345</assignedUserId>
            <notifyUserOnUpdateFlag xsi:type="xsd:boolean">true</notifyUserOnUpdateFlag>
            <title xsi:type="xsd:string">Account Profile Update Request</title>
         </templateObject>
         <contents xsi:type="xsd:string">address1: "Address Edited"
                                                    address2: "newAddress2"
                                                    city: "cityEdited"
                                                    companyName: "My Company"
                                                    country: "BR"
                                                    email: "mynewemail@softlayer.com"
                                                    faxPhone: ""
                                                    firstName: "EditedName"
                                                    lastName: "Last Name"
                                                    officePhone: "123456789"
                                                    postalCode: "11111-2222"</contents>
         <rootPassword xsi:type="xsd:string">TestPassword</rootPassword>
         <controlPanelPassword xsi:type="xsd:string">TestPassword</controlPanelPassword>
         <accessPort xsi:type="xsd:string">22</accessPort>
         <attachedFiles xsi:type="v3:SoftLayer_Container_Utility_File_AttachmentArray" />
      </v3:createAdministrativeTicket>
   </soapenv:Body>
</soapenv:Envelope>

如何获取“assignedUserId”?

利用:

https://api.softlayer.com/rest/v3/SoftLayer_Account/getMasterUser

参考:

http://sldn.softlayer.com/reference/services/SoftLayer_Ticket/createAdministrativeTicket http://sldn.softlayer.com/reference/services/SoftLayer_Account/getMasterUser

REST 示例:

网址:

https://[用户名]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Ticket/createAdministrativeTicket

方法: POST

Json(有效负载):

{
    "parameters": [
        {
            "assignedUserId": 12345,
            "title": "Account Profile Update Request"
        },
        "Request generated via API\nCompany Name: myComanyName\nFirst Name: nameEdited\nLast Name: LastNameEdited\nEmail: mynewemail@softlayer.com \nPrimary Phone: 21478270366\nSecondary Phone: \nStreet Address 1: myAddressEdited\nStreet Address 2: \nCity: newCity\nCountry: US\nState: CA\nPostal Code: 111-222\n"
    ]
}
于 2015-10-02T20:59:58.193 回答