Now I'm developing a project about softlayer api, I wan't create a child account by call softlayer api. Then I will associate the child account with major account by call softlayer api. And destroy the child account by aoftlayer api.
So there is three questions follow:
regards~
The SoftLayer_Brand service is the one needed to create new Accounts. In order to successfully create a new Account you need a BAP account, which are accounts for branding usage, if you haven’t got any, I suggest you to contact Sales department and ask for one.
You can create a Brand Account in this way using REST:
https://$username:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Brand/$brandId/createCustomerAccount.json
Method: POST
Body:
{
"parameters": [
{
"brandId": 2,
"companyName": "test-571-companyname",
"firstName": "test-571-firstname",
"lastName": "test-571-lastname",
"address1": "4444 Alpha Rd",
"postalCode": "75244-4608",
"city": "Dallas",
"state": "TX",
"country": "US",
"officePhone": "281.714.3333",
"email": "test-571-email@softlayer.com",
"lateFeeProtectionFlag": true,
"claimedTaxExemptTxFlag": false,
"allowedPptpVpnQuantity": 1,
"isReseller": 0,
"accountStatusId": 1001
}
]
}
You can create a sub brand in this way using REST:
https://$username:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Brand/createObject.json
Method: POST
Body:
{
"parameters": [
{
"longName": "Company Long Name02",
"name": "Company Name02",
"keyName": "KEY_NAME_Marce",
"account": {
"address1": "4444 Alpha Rd",
"city": "Dallas",
"companyName": "companyname02",
"country": "US",
"email": "test-571-email@softlayer.com",
"firstName":"firstname",
"lastName": "lastname",
"officePhone": "281.714.3333",
"postalCode": "75244-4608",
"state": "TX"
}
}
]
}
Note: Regarding how associate a child account with a major account, it would be accomplished creating a child brand and then creating accounts for that child brand.
Additionally, I suggest you to read the next links for further information: http://sldn.softlayer.com/reference/services/SoftLayer_Brand http://sldn.softlayer.com/reference/services/SoftLayer_Account