Hi Jacob,
This Knowledge Base article may help with getting the API to work initially:
Once you get past the 'SyntaxError: Unexpected token n in JSON at position 0' error you'll also need to modify your payload. I don't think the documentation makes it explictly clear which parameters are for wi-fi vs PMP/ePMP devices.
First you'll want to create a configuration template in the cnMaestro GUI. Once templates are created in the GUI they will available to push to devices via the API.
This thread goes over some of the basics with templates and using replacement variables. There is also information in the main user guide. You'll want to use replacement variables if values need to be unique per device. If not, you can just set static values in the template that will be used for any device to which you apply the template.
Finally, you'll need to update the API payload to use PMP supported parameters. Below is a list of what is supported in the payload/body along with a brief description. In short, you'll need to specify a template to apply and use the "variables" object to set any device-unique values. I'm guessing for the example you provided this will be the VLAN IP address. The rest could be set statically in the template if you plan on them being the same for each device.
Payload supported by PMP/ePMP for the device PUT API:
approved: description: Pre-approve the device after claim type: boolean description: description: Basic information about the device type: string default: '' latitude: description: Latitude coordinate (in decimal format) of the AP type: number minimum: -90 maximum: 90 longitude: description: Longitude coordinate (in decimal format) of the AP type: number minimum: -180 maximum: 180 name: description: Name of the AP type: string minLength: 2 maxLength: 64 network: description: Name of the network type: string minLength: 1 template: description: The target template name to be applied on the device type: string tower: description: Name of the tower type: string minLength: 1 variables: description: User defined variable inside templates type: object additionalProperties: type: - string - 'null'
Parameters not listed here should not be included in the payload for PMP/ePMP devices.
"variables" is an object of key-value pairs with the key being the replacement variable name defined in the template and the value being the target value for that specific device. Variables are saved to the database so they can be reused between templates pushes without having to set them every time. You could even pre-stage values before applying a template.
We are working on improving our API documentation which I think will make it clearer which parameters are for specific device types.
Regards,
Jordan