Connecting to ShipWise via SQL
You can use SQL to connect to ShipWise in the CData Virtuality Studio or the Code Editor in the Web UI.
Pre-requisites
You need the endpoint and the client pair for gaining access to the API.
How to Connect
Before you start retrieving data, you need to run the connector script for ShipWise in the CData Virtuality Studio or the Web UI and input your credentials in the following line:
CALL SYSADMIN.createConnection(
name => 'shipwise_src',
jbossCliTemplateName => 'ws',
connectionOrResourceAdapterProperties => 'EndPoint=https://api.getshipwise.com/v1,AuthUserName=<AuthUserName>,AuthPassword=<AuthPassword>'
);;
CALL SYSADMIN.createDatasource(
name => 'shipwise_src',
translator => 'shipwise'
);;
CREATE VIEW shipwise.Credentials
AS
SELECT
'<label_1>' AS label,
'<EndPoint_1>' AS EndPoint,
'<AuthUserName_1>' AS AuthUserName,
'<AuthPassword_1>' AS AuthPassword
UNION ALL
SELECT
'<label_2>' AS label,
'<EndPoint_2>' AS EndPoint,
'<AuthUserName_2>' AS AuthUserName,
'<AuthPassword_2>' AS AuthPassword
;;
You may add additional sets using UNION ALL
- just make sure the labels are unique.
You may optionally add a multi-tenancy table if you wish to access data from multiple accounts in the API. Keep in mind that you have to manually pass a label
parameter to the procedures of the API, which will identify, which credentials should be used in the request. If you are not using multi-tenancy, remove the multitenancy_tablename
parameter from the model properties, as the default value is not intended to be present in production environments.