- Trying to run the a PUT operation via the API, updating name and mapLocation. Using Postman to submit the requests and followed the instructions noted here Using self-signed SSL certificates with Postman – Postman Blog to ensure that our self-signed certificate is accepted.
- Here are the details:
- URL for my request is:
https://ciscoprime.domain/webacs/api/v1/op/apService/accessPoint.json
The request payload is as follows, where accessPointId has been selected from a previous GET operation:
{ "accessPoint" : { "accessPointId" : 12860886, "mapLocation" : "New Location Name", "name" : "ap-new-name-test" } }
The response I'm getting is:
{ "errorDocument": { "httpResponseCode": 500, "httpMethod": "PUT", "message": "java.lang.NullPointerException", "exception": "javax.ws.rs.WebApplicationException: java.lang.NullPointerException", "uriPath": "op/apService/accessPoint", "queryParams": "{}" } }
- Got basic auth credentials setup in the header of the request, which works fine for GETs. Have been granted NBIWrite permissions by the system admin.
- Getting a 500 error. Able to do GET requests all day long and they work just fine. Also, when running these prior to getting my NBIWrite permission setup was getting permissions errors, so assuming my permissions are now setup correctly.
When using the v1/op/apService/accessPoint service, you need to specify all of the parameters in the request payload. The NullPointerException is due to the service trying to find information in the request that hasn't been specified, and is therefore null.
- In the documentation it is mentioned that "you need to specify all the parameters" is even a little deceiving. What, exactly, constitutes "all the parameters". Is it all the parameters that are specified in the documentation for that API endpoint. Assumed that's what it meant, and that seemed to do the trick.
Does the documentation for some of the WLAN Provisioning resources meet your expectations. If not, do you have suggestions for what we could do to make it better.
For the request parameters, would prefer to see a separate column that says what's required vs. optional. Even on the example pointed to only the ones that are optional say so. assuming the rest are required. If a parameter is required why would you be silent on that fact.Especially for API documentation this is a requirement to ensure that someone can pick it up quickly and get it working fast. There are places where it would be helpful for the documentation to call out required versus optional parameters.
You may find this reply relevant on how to use this particular AP call a little better.
Comments
0 comments
Please sign in to leave a comment.