I want to order Public Secondary IP Addresses when I ordering. And How to submit these order infomation by softlayer api ?
相关问题
- IPAddress.[Try]Parse parses 192.168 to 192.0.0.168
- Google places autocomplete suggestion without coun
- Karate API Testing - Access variable value across
- How to verify laravel passport api token in node /
- Converting byte array output into Blob corrupts fi
相关文章
- 我用scrapy写了一个蛮简单的爬虫怎么封装成一个api啊
- 后端给前端的API接口是怎么用代码写的
- Convert C# Object to Json Object
- How to resolve hostname to an ip address in node j
- Android camera2 API get focus distance in AF mode
- Getting all listing images from an Etsy shop
- Is there an API to get statictics on Google Play d
- How to search specific user's tracks by tag wi
To submit the order information described above, you need to fill the parameter "itemCategoryQuestionAnswers" during the order, that parameter can be found in datatypes like Container_Product_Order_Virtual_Guest and Container_Product_Order_Hardware_Server
Below is an example in JSON for REST:
The example above belongs to the first two questions in the form. As you can see, it is necessary to know the id of categoryId and questionId parameters. Follow the steps below.
CategoryID
As greyhoundforty comment you, the link SoftLayer API: Ordering Subnet is a good starting point. On that page mcruz shows how to execute the method Product_Item_Category::getSubnetCategories. The method returns some thing like this:
On this case the categoryId is 14 for category "Public Secondary IP Addresses".
QuestionID
To get all questions related to the category "sec_ip_addresses" you can use the method Product_Item_Category::getQuestions or Product_Item_Category::getQuestionReferences. On this case I'll show you how execute getQuestionReferences method:
It should returns something like this:
Now you can know the questionId of each question in the form.
Order Virtual Guest with a Secondary Public Ip Address
Below is an example in REST to order a virtual guest with a secondary ip address and two first questions in the form.
Note: Don't forget change [username], [apikey], prices, and other ids with your own data
About your REST structure
I don't know what REST client you are using, but I was able to reproduce your issue in a RESTclient from firefox, in other REST clients like Insomnia I'm just getting errors.
Basically, you are getting empty response because your JSON structure have some mistakes. First, all data in body needs to be into "parameters" object, please review the example above. Second, value of "sshKeyIds" needs to be into double quotes because it is an string. Finally, I recommend you put all objects and string values into double quotation mark due to it is the JSON standard format, you can verify this information in jQuery.parseJSON single quote vs double quote and http://www.json.org/.
Important: Before to use placeOrder method I recommend you to execute verifyOrder first. When, you are ready to order just change verifyOrder by placeOrder in the URL request.
I modified your request as following
Let me know if you have any doubt or need further assistance.