Use API keys for authentication and access
You can use the API key provided by your administrator to securely authenticate in the following scenarios:
-
In Excel for authentication when accessing Prophix One Portal
-
In web services to authenticate API secrets instead of using a username and password
Excel authentication
-
Open an Excel sheet.
-
Click Data > Get Data and Launch Power Query Editor.
-
Change the credentials to Anonymous:
-
Create a Blank Query.
-
Open the Advanced Editor.
-
Paste the URL and API secret in the code as shown:
Here is a sample code:
Copylet
baseUrl = "https://prophix-devops.com/cr/example/odata/GetHubData(packageid='TestPackage',customercode='CUSTOMERCODE')",
apiSecret = "xxxxxxxxxxx",
authToken = "Bearer " & apiSecret,
headers = [
#"Authorization" = authToken
],
source = OData.Feed(baseUrl, null, [Headers=headers])
in
source
Restore backups from a URL
For detailed instructions on using an API key to restore a backup file, refer to Restore backup from a URL using an API Key in the Job Schedules article.
Web services authentication
When importing data using the Web Connector (OData) file type, users have the option to authenticate using an API Secret instead of a traditional username and password.
-
Go to
Transfers > Data > Define File Structure > Import.
-
In the General tab.
-
Select an import file structure or add a new one .
-
In the File Type drop-down, select Web Connector (OData).
-
-
Go to the Parameters tab.
-
Configure any other necessary settings based on your organization's requirements, then click
Note: The same authentication method will now be available in
Automation > Jobs > Schedules for jobs with Job Type = Web Service: