Skip to content

yovuDeveloper/netsapiens-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Scripts using Netsapiens API

Developed by YOVU Office Phone

1. Delete all Shared Contacts

source/delete-shared-contact/DeleteSharedContact.py

Netsapiens API Documentation - Delete a Contact

You can delete all shared contacts using this script. You may repurpose the script to loop through your own list of contact ids and delete them from the server.

Warning: Make sure you know what you are doing before proceeding. Backup if needed. We are not responsible for any changes you make to your system using this script.

Files

You must add your credentails in Settings.ini for the script to work.These details are used for Authentication

  1. Server Name. example: api.netsapiens.com ; Please do not include http// or https://
  2. API Client Id : Client Id of your app that you created in Netsapiens.
  3. Client Secret : Client Secret corresponding to the client id above.
  4. Domain : Domain Name from which you want to delete the shared contacts.
  5. User Name : Your login username for the server.
  6. Password : Your password you use to login.

If you like you can also hardcode the credentials within the py script and run the script.

After Execution of the script:

Logs can be found in : NSLog.log
Success.csv will hold the list of shared contacts that were successfully deleted.
Fail.csv will hold the list of shared contacts that were not deleted.

GUI Version

We have included a GUI version of the same script. source/delete-shared-contact/DeleteShareContactUI.py You can modify the GUI version to meet your purpose. GUIImages

2. Read All Device/Subscriber within a Domain

source/read-all-devices-domain/ReadAllDevices.py

Netsapiens API Documentation - Devices Read

  1. You can use this script to fetch all devices within a domain. I have added only eight fields for download. You can alter the class Device to add more as per your need.
  2. You can edit line 108 : read_all_devices('domainName') to run the script for different domain.
  3. You need to have atleast Reseller permission to read all devices within the domain. Please refer netsapiens documentation for fields,parameters and response.

After successfully running the script: ListOfSubscribers.csv will hold the details of all the devices within that domain.

Technical Details: There is a 5 second delay after every 25th delete request in case you are deleting a lot of request. But it is recommended to batchify the code if required.

Releases

No releases published

Packages

No packages published

Languages