Connecting to Samanage
To use the Samanage Profile set the Profile property of the CData API Driver to the path of the Samanage profile, and configure the connection properties specified below. Once the CData API Driver has been configured, you can issue SQL queries to access data from any of the Samanage tables.
Using Token Authentication
Samanage uses JSON Web Token (JWT) authentication to control access to the API.
Obtaining Your API Token
- Log in to your Samanage (SolarWinds Service Desk) account.
- Navigate to Setup > Users.
- Click your username to open the User Detail page.
- In the Action dropdown, select Generate JSON Web Token.
- Copy the generated token and set it as the APIKey in your connection string.
Connection Properties
After setting the following connection properties, you are ready to connect:
- AuthScheme: Set this to APIKey.
- APIKey: Set this to your Samanage JSON Web Token.
Example Connection String
Profile=C:\profiles\Samanage.apip;ProfileSettings='APIKey=your_token';
Available Tables
The Samanage API Profile provides access to 25 tables covering IT assets, incidents, changes, users, and service catalog data:
- Audits - Returns a list of all audit log entries. Filter by SourceType and SourceId to retrieve audits for a specific object.
- CatalogItems - Returns a list of all service catalog items available for request.
- Categories - Returns a list of all incident and service request categories.
- ChangeCatalogs - Returns a list of all change catalog entries (standard change templates).
- Changes - Returns a list of all change requests.
- ConfigurationItems - Returns a list of all configuration items (CMDB records).
- Contracts - Returns a list of all contracts.
- Departments - Returns a list of all departments.
- Groups - Returns a list of all user groups.
- Hardware - Returns a list of all hardware assets discovered or managed in the account.
- Incidents - Returns a list of all incidents and service requests.
- MobileDevices - Returns a list of all mobile devices managed in the account.
- OtherAssets - Returns a list of all non-IT assets.
- Printers - Returns a list of all printers managed in the account.
- Problems - Returns a list of all problem records.
- PurchaseOrders - Returns a list of all purchase orders.
- Releases - Returns a list of all release records.
- Risks - Returns a list of all risk records.
- Roles - Returns a list of all user roles defined in the account.
- Sites - Returns a list of all sites.
- Software - Returns a list of all software inventory detected in the account.
- Solutions - Returns a list of all knowledge base articles.
- Users - Returns a list of all users in the account.
- Vendors - Returns a list of all vendors.
- Warranties - Returns a list of all warranties for a given hardware asset. Requires HardwareId in the WHERE clause.
Usage Examples
Incidents:
SELECT * FROM Incidents SELECT * FROM Incidents WHERE Id = 12345
Hardware:
SELECT * FROM Hardware SELECT * FROM Hardware WHERE Id = 12345
Users:
SELECT * FROM Users SELECT * FROM Users WHERE Id = 12345
Changes:
SELECT * FROM Changes SELECT * FROM Changes WHERE Id = 12345
ConfigurationItems:
SELECT * FROM ConfigurationItems SELECT * FROM ConfigurationItems WHERE Id = 12345
Warranties:
SELECT * FROM Warranties WHERE HardwareId = 12345
Audits:
SELECT * FROM Audits SELECT * FROM Audits WHERE SourceType = 'incidents' AND SourceId = 12345
Software:
SELECT * FROM Software SELECT * FROM Software WHERE Id = 12345
PurchaseOrders:
SELECT * FROM PurchaseOrders SELECT * FROM PurchaseOrders WHERE Id = 12345
CatalogItems:
SELECT * FROM CatalogItems SELECT * FROM CatalogItems WHERE Id = 12345
Connection Properties
The connection string properties are the various options that can be used to establish a connection. This section provides a complete list of the options you can configure in the connection string for this provider.
| Property | Description |
| APIKey | Your Samanage API Token. |
| AuthScheme | The scheme used for authentication. Accepted entries are APIKey or None. Allowed values are: BASIC, NONE, NTLM, OAUTH, APIKEY, OAUTH_CLIENT, OAUTH_PASSWORD |