Chad Buser Posted May 1 Share Posted May 1 I have the API installed and it shows as running however, I keep getting these warnings when trying to authenticate, POST https://mgmt-ip/mgmt/api/nextgen/v1/login { "login": { "username": "nsroot", "password": "PASSWORD" } } Warning: Unable to verify the first certificate {"errorcode":1500,"errormessage":"We only support requests in JSON format","details":[]}↵ Has anyone played with this yet? Chad Link to comment Share on other sites More sharing options...
Solution Chad Buser Posted May 1 Author Solution Share Posted May 1 For me it was two things - I was not sending the request in JSON format. It was in plain text. And I was sending the creds in the JSON body and I still had Basic Auth selected on the Auth Tab - I set this to No Auth. 'Unable to verify the first cert' is just a warning since 'SSL Cert Verification' is off in the settings. Link to comment Share on other sites More sharing options...
Rick Davis Posted May 1 Share Posted May 1 Add the Content-Type and Accept headers: POST http://NetScaler/mgmt/api/nextgen/v1/login Content-Type: application/json Accept: application/json { "login": { "username": "user1", "password": "verysecret" } } Next-Gen API https://developer-docs.netscaler.com/en-us/nextgen-api/getting-started-guide.html Link to comment Share on other sites More sharing options...
Konstantinos Kaltsas Posted May 1 Share Posted May 1 Hello Chad, You can find a description for all error codes under the API Specification here: https://developer-docs.netscaler.com/en-us/nextgen-api/apis/#/Authentication/Login Link to comment Share on other sites More sharing options...
Chad Buser Posted May 3 Author Share Posted May 3 { "login": { "username": "nsroot", "password": "password", "headers": { "Content-Type": "application/json", "Accept": "application/json" } } } 200 OK NO AUTH Link to comment Share on other sites More sharing options...
Rick Davis Posted May 3 Share Posted May 3 17 minutes ago, Chad Buser said: { "login": { "username": "nsroot", "password": "password", "headers": { "Content-Type": "application/json", "Accept": "application/json" } } } 200 OK NO AUTH It did not work for me when specifying the CT and Accept headers only in the json body. "We only support requests in JSON format" Error code 1500 = missing Content-Type: application/json "We only support sending responses in JSON format" Error code 1300 = missing Accept: application/json Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now