- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Create Host Record.. record:host with Powershell against WAPI V2.0
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2015 10:07 AM
Data fields on POST need to be in JSON format
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-07-2015 11:52 AM
I'm pretty sure that your problem is that you need to specify that the data submitted as part of the POST request is in JSON format. For example, if I do the following Curl command then it works as expected and the host record is successfully created:
curl --tlsv1 --user 'admin:infoblox' --header 'Content-Type: application/json' --data '{"name": "foobar.example.com", "ipv4addrs": [{"ipv4addr": "192.168.1.15"}]}' 'https://gm.example.com/wapi/v2.0/record:host'
However if I omit the --header option, as in the following command:
curl --tlsv1 --user 'admin:infoblox' --data '{"name": "foobar.example.com", "ipv4addrs": [{"ipv4addr": "192.168.1.16"}]}' 'https://gm.example.com/wapi/v2.0/record:host'
then I get the exact same error you're seeing.
Re: Data fields on POST need to be in JSON format
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2016 01:20 PM
I have similar error
{ "Error": "AdmConProtoError: Unknown argument/field: 'ipv4addrs'",
"code": "Client.Ibap.Proto",
"text": "Unknown argument/field: 'ipv4addrs'"
}
when doing PUT request https://[GRID]//wapi/v2.3/record:a/_ref (reference here) and neither { [ { "ipv4addr":"1.1.1.31" } ] } nor { "name":"webt.xxx.com","ipv4addrs":[ { "ipv4addr":"1.1.1.31" } ] } help.