Highlighted
Brian119
1 Nickel

Optional parameter not working in a REST API call

Jump to solution

Hi experts,

I am using Python script to create a SMB/CIFS service for a NAS server. The passing parameters below with "organizationalUnit" look not accepted by Unity,

data = {"nasServer":{"id":"nas_34"},"netBiosName":"test_nas","name":"test_nas","domain":"mydomain.win","organizationalUnit":"cn=org,cn=Storage","domainUsername":"test","domainPassword":"test"}

The response follows,

status_code= 422
Content = b'{"error":{"errorCode":131149877,"httpStatusCode":422,"messages":[{"en-US":"Req
uest body is not correct. There may be duplicate parameters, wrong parameter nam
e. Please refer to API documentation page and ensure the body is correct. (Error
Code:0x7d13035)"}],"created":"2019-02-12T00:34:17.715Z"}}'

It works after the field of "organizationalUnit" was removed.

data = {"nasServer":{"id":"nas_34"},"netBiosName":"test_nas","name":"test_nas","domain":"mydomain.win","domainUsername":"test","domainPassword":"test"}

Any suggestions?  Many thanks.

 

Capture.JPG

Labels (1)
0 Kudos
1 Reply
Brian119
1 Nickel

Re: Optional parameter not working in a REST API call

Jump to solution

netBiosName should be netbiosName. All field names are case-sensitive!

0 Kudos