invokeurl variable mapping

invokeurl variable mapping

Hi,
I have set up a 'connection' to Mosyle MDM so I can pull usernames  via API
I have the following code which seems ok but doesn't work 'Error occurred while executing on load script.'


  1. header_data = Map();
  2. header_data.put("Content-Type":"application/json","accesstoken":"MyAPIToken");
  3. response = invokeurl
  4. [
  5. url :"https://businessapi.mosyle.com/v1/users"
  6. type :POST
  7. parameters:"operation:list_users"
  8. headers:header_data
  9. connection:"mosyle"
  10. ];

Question 1
How can I test this code?
- I can't use the Deluge website because the code relies on a 'connection'
I could debug it myself but I can't see how to test it!
(I have it working in Postman)

Question 2
See anything wrong with the code, please tell me!